mbox series

[00/11] PCI dma-ranges parsing consolidation

Message ID 20190924214630.12817-1-robh@kernel.org (mailing list archive)
Headers show
Series PCI dma-ranges parsing consolidation | expand

Message

Rob Herring (Arm) Sept. 24, 2019, 9:46 p.m. UTC
This series moves the DT 'dma-ranges' parsing into common helpers
utilizing a resource list. In the process of doing this, I noticed
several cases where pci_parse_request_of_pci_ranges() could be used so
I converted those drivers first. The last 5 patches make the actual
change to use the common 'dma_ranges' resource list. There's no
(intended) functional change in this series though I'm also working on
a separate series to improve the handling of 'dma-ranges' and dma
masks.

pci-rcar-gen2 is the only remaining driver doing its own dma-ranges
handling as it is still using the old ARM PCI functions. Looks like it
is the last one (in drivers/pci/).

Compile tested only.

Rob

Rob Herring (11):
  PCI: aardvark: Use pci_parse_request_of_pci_ranges()
  PCI: altera: Use pci_parse_request_of_pci_ranges()
  PCI: mediatek: Use pci_parse_request_of_pci_ranges()
  PCI: versatile: Enable COMPILE_TEST
  PCI: versatile: Use pci_parse_request_of_pci_ranges()
  PCI: of: Add inbound resource parsing to helpers
  PCI: ftpci100: Use inbound resources for setup
  PCI: v3-semi: Use inbound resources for setup
  PCI: xgene: Use inbound resources for setup
  PCI: iproc: Use inbound resources for setup
  PCI: rcar: Use inbound resources for setup

 drivers/pci/controller/Kconfig                |  2 +-
 .../pci/controller/dwc/pcie-designware-host.c |  3 +-
 drivers/pci/controller/pci-aardvark.c         | 58 ++---------------
 drivers/pci/controller/pci-ftpci100.c         | 29 ++++-----
 drivers/pci/controller/pci-host-common.c      |  2 +-
 drivers/pci/controller/pci-v3-semi.c          | 40 +++++-------
 drivers/pci/controller/pci-versatile.c        | 62 ++++--------------
 drivers/pci/controller/pci-xgene.c            | 33 ++++------
 drivers/pci/controller/pcie-altera.c          | 38 +----------
 drivers/pci/controller/pcie-cadence-host.c    |  2 +-
 drivers/pci/controller/pcie-iproc-platform.c  |  1 +
 drivers/pci/controller/pcie-iproc.c           | 63 +++----------------
 drivers/pci/controller/pcie-mediatek.c        | 47 +++++---------
 drivers/pci/controller/pcie-mobiveil.c        |  4 +-
 drivers/pci/controller/pcie-rcar.c            | 48 ++++++--------
 drivers/pci/controller/pcie-rockchip-host.c   |  3 +-
 drivers/pci/controller/pcie-xilinx-nwl.c      |  2 +-
 drivers/pci/controller/pcie-xilinx.c          |  2 +-
 drivers/pci/of.c                              | 44 ++++++++++++-
 drivers/pci/pci.h                             |  8 ++-
 include/linux/pci.h                           |  2 +
 21 files changed, 162 insertions(+), 331 deletions(-)

--
2.20.1

Comments

Andrew Murray Sept. 26, 2019, 8:49 a.m. UTC | #1
On Tue, Sep 24, 2019 at 04:46:19PM -0500, Rob Herring wrote:
> This series moves the DT 'dma-ranges' parsing into common helpers
> utilizing a resource list. In the process of doing this, I noticed
> several cases where pci_parse_request_of_pci_ranges() could be used so
> I converted those drivers first. The last 5 patches make the actual
> change to use the common 'dma_ranges' resource list. There's no
> (intended) functional change in this series though I'm also working on
> a separate series to improve the handling of 'dma-ranges' and dma
> masks.
> 
> pci-rcar-gen2 is the only remaining driver doing its own dma-ranges
> handling as it is still using the old ARM PCI functions. Looks like it
> is the last one (in drivers/pci/).

It also seems that pcie-tango is using of_pci_dma_range_parser_init
and so parsing dma-ranges. Though it's using the dma_ranges for a
slightly different purpose.

Thanks,

Andrew Murray

> 
> Compile tested only.
> 
> Rob
> 
> Rob Herring (11):
>   PCI: aardvark: Use pci_parse_request_of_pci_ranges()
>   PCI: altera: Use pci_parse_request_of_pci_ranges()
>   PCI: mediatek: Use pci_parse_request_of_pci_ranges()
>   PCI: versatile: Enable COMPILE_TEST
>   PCI: versatile: Use pci_parse_request_of_pci_ranges()
>   PCI: of: Add inbound resource parsing to helpers
>   PCI: ftpci100: Use inbound resources for setup
>   PCI: v3-semi: Use inbound resources for setup
>   PCI: xgene: Use inbound resources for setup
>   PCI: iproc: Use inbound resources for setup
>   PCI: rcar: Use inbound resources for setup
> 
>  drivers/pci/controller/Kconfig                |  2 +-
>  .../pci/controller/dwc/pcie-designware-host.c |  3 +-
>  drivers/pci/controller/pci-aardvark.c         | 58 ++---------------
>  drivers/pci/controller/pci-ftpci100.c         | 29 ++++-----
>  drivers/pci/controller/pci-host-common.c      |  2 +-
>  drivers/pci/controller/pci-v3-semi.c          | 40 +++++-------
>  drivers/pci/controller/pci-versatile.c        | 62 ++++--------------
>  drivers/pci/controller/pci-xgene.c            | 33 ++++------
>  drivers/pci/controller/pcie-altera.c          | 38 +----------
>  drivers/pci/controller/pcie-cadence-host.c    |  2 +-
>  drivers/pci/controller/pcie-iproc-platform.c  |  1 +
>  drivers/pci/controller/pcie-iproc.c           | 63 +++----------------
>  drivers/pci/controller/pcie-mediatek.c        | 47 +++++---------
>  drivers/pci/controller/pcie-mobiveil.c        |  4 +-
>  drivers/pci/controller/pcie-rcar.c            | 48 ++++++--------
>  drivers/pci/controller/pcie-rockchip-host.c   |  3 +-
>  drivers/pci/controller/pcie-xilinx-nwl.c      |  2 +-
>  drivers/pci/controller/pcie-xilinx.c          |  2 +-
>  drivers/pci/of.c                              | 44 ++++++++++++-
>  drivers/pci/pci.h                             |  8 ++-
>  include/linux/pci.h                           |  2 +
>  21 files changed, 162 insertions(+), 331 deletions(-)
> 
> --
> 2.20.1
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Marc Gonzalez Sept. 26, 2019, 11:20 a.m. UTC | #2
[ Tweaking recipients list ]

On 26/09/2019 10:49, Andrew Murray wrote:

> On Tue, Sep 24, 2019 at 04:46:19PM -0500, Rob Herring wrote:
> 
>> pci-rcar-gen2 is the only remaining driver doing its own dma-ranges
>> handling as it is still using the old ARM PCI functions. Looks like it
>> is the last one (in drivers/pci/).
> 
> It also seems that pcie-tango is using of_pci_dma_range_parser_init
> and so parsing dma-ranges. Though it's using the dma_ranges for a
> slightly different purpose.

The rationale for that code can be found here:

	https://patchwork.kernel.org/patch/9915469/

NB: 1) The PCIE_TANGO_SMP8759 Kconfig symbol is marked "depends on BROKEN",
and 2) The driver adds TAINT_CRAP,
and 3) The maker of the tango platform is dead.

Regards.
Rob Herring (Arm) Sept. 26, 2019, 1:11 p.m. UTC | #3
On Thu, Sep 26, 2019 at 6:20 AM Marc Gonzalez <marc.w.gonzalez@free.fr> wrote:
>
> [ Tweaking recipients list ]
>
> On 26/09/2019 10:49, Andrew Murray wrote:
>
> > On Tue, Sep 24, 2019 at 04:46:19PM -0500, Rob Herring wrote:
> >
> >> pci-rcar-gen2 is the only remaining driver doing its own dma-ranges
> >> handling as it is still using the old ARM PCI functions. Looks like it
> >> is the last one (in drivers/pci/).
> >
> > It also seems that pcie-tango is using of_pci_dma_range_parser_init
> > and so parsing dma-ranges. Though it's using the dma_ranges for a
> > slightly different purpose.

Seems I missed that as I only grep'ed for for_each_of_pci_range...

>
> The rationale for that code can be found here:
>
>         https://patchwork.kernel.org/patch/9915469/
>
> NB: 1) The PCIE_TANGO_SMP8759 Kconfig symbol is marked "depends on BROKEN",
> and 2) The driver adds TAINT_CRAP,
> and 3) The maker of the tango platform is dead.

Given that and that I'd have to rework the probe to do the MSI range
setup after pci_host_common_probe, I'm just going to leave this one
alone.

Rob
Andrew Murray Sept. 26, 2019, 1:38 p.m. UTC | #4
On Thu, Sep 26, 2019 at 08:11:16AM -0500, Rob Herring wrote:
> On Thu, Sep 26, 2019 at 6:20 AM Marc Gonzalez <marc.w.gonzalez@free.fr> wrote:
> >
> > [ Tweaking recipients list ]
> >
> > On 26/09/2019 10:49, Andrew Murray wrote:
> >
> > > On Tue, Sep 24, 2019 at 04:46:19PM -0500, Rob Herring wrote:
> > >
> > >> pci-rcar-gen2 is the only remaining driver doing its own dma-ranges
> > >> handling as it is still using the old ARM PCI functions. Looks like it
> > >> is the last one (in drivers/pci/).
> > >
> > > It also seems that pcie-tango is using of_pci_dma_range_parser_init
> > > and so parsing dma-ranges. Though it's using the dma_ranges for a
> > > slightly different purpose.
> 
> Seems I missed that as I only grep'ed for for_each_of_pci_range...
> 
> >
> > The rationale for that code can be found here:
> >
> >         https://patchwork.kernel.org/patch/9915469/
> >
> > NB: 1) The PCIE_TANGO_SMP8759 Kconfig symbol is marked "depends on BROKEN",
> > and 2) The driver adds TAINT_CRAP,
> > and 3) The maker of the tango platform is dead.
> 

Thanks for the context Marc, much appreciated.

Is there a path to make this driver not BROKEN? Or is this likely to bit rot?

> Given that and that I'd have to rework the probe to do the MSI range
> setup after pci_host_common_probe, I'm just going to leave this one
> alone.

I don't see any harm with that.

Thanks,

Andrew Murray

> 
> Rob
Marc Gonzalez Sept. 26, 2019, 2:09 p.m. UTC | #5
On 26/09/2019 15:38, Andrew Murray wrote:

> On Thu, Sep 26, 2019 at 08:11:16AM -0500, Rob Herring wrote:
>
>> On Thu, Sep 26, 2019 at 6:20 AM Marc Gonzalez wrote:
>>>
>>> On 26/09/2019 10:49, Andrew Murray wrote:
>>>
>>>> On Tue, Sep 24, 2019 at 04:46:19PM -0500, Rob Herring wrote:
>>>>
>>>>> pci-rcar-gen2 is the only remaining driver doing its own dma-ranges
>>>>> handling as it is still using the old ARM PCI functions. Looks like it
>>>>> is the last one (in drivers/pci/).
>>>>
>>>> It also seems that pcie-tango is using of_pci_dma_range_parser_init
>>>> and so parsing dma-ranges. Though it's using the dma_ranges for a
>>>> slightly different purpose.
>>
>> Seems I missed that as I only grep'ed for for_each_of_pci_range...
>>
>>> The rationale for that code can be found here:
>>>
>>>         https://patchwork.kernel.org/patch/9915469/
>>>
>>> NB: 1) The PCIE_TANGO_SMP8759 Kconfig symbol is marked "depends on BROKEN",
>>> and 2) The driver adds TAINT_CRAP,
>>> and 3) The maker of the tango platform is dead.
> 
> Thanks for the context Marc, much appreciated.
> 
> Is there a path to make this driver not BROKEN? Or is this likely to bit rot?

It is not the device driver that is BROKEN, it is the device being driven ;-)

I don't know how many smp8759 boards exist in the wild. Mans might have one.
I didn't keep mine.

Regards.