mbox series

[0/2] PCI endpoint BAR hardware description cleanup

Message ID 20240210012634.600301-1-cassel@kernel.org
Headers show
Series PCI endpoint BAR hardware description cleanup | expand

Message

Niklas Cassel Feb. 10, 2024, 1:26 a.m. UTC
The series is based on top of:
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=endpoint


Hello all,

This series cleans up the hardware description for PCI endpoint BARs.

The problems with the existing hardware description:
-The documentation is lackluster.
-Some of the names are confusingly similar, e.g. fixed_64bit and
 fixed_size, even though these are for completely unrelated things.
-The way that the BARs are defined in the endpoint controller drivers
 is messy, because the left hand side is not a BAR, so you can mark a
 BAR as e.g. both fixed size and reserved.

This series tries to address all the problems above.

Personally, I think that the code is more readable, both the endpoint
controller drivers, but also pci-epc-core.c.

(Oh, and as you can probably guess, I will be sending out a patch series
that adds BAR_RESIZABLE to enum pci_epc_bar_type in the coming week(s).)


Kind regards,
Niklas


Niklas Cassel (2):
  PCI: endpoint: Clean up hardware description for BARs
  PCI: endpoint: Drop only_64bit on reserved BARs

 drivers/pci/controller/dwc/pci-imx6.c         |  3 +-
 drivers/pci/controller/dwc/pci-keystone.c     | 12 +++---
 .../pci/controller/dwc/pci-layerscape-ep.c    |  5 ++-
 drivers/pci/controller/dwc/pcie-keembay.c     |  8 +++-
 drivers/pci/controller/dwc/pcie-rcar-gen4.c   |  4 +-
 drivers/pci/controller/dwc/pcie-tegra194.c    | 10 +++--
 drivers/pci/controller/dwc/pcie-uniphier-ep.c | 15 ++++++--
 drivers/pci/controller/pcie-rcar-ep.c         | 14 ++++---
 drivers/pci/endpoint/functions/pci-epf-ntb.c  |  4 +-
 drivers/pci/endpoint/functions/pci-epf-test.c |  8 ++--
 drivers/pci/endpoint/functions/pci-epf-vntb.c |  2 +-
 drivers/pci/endpoint/pci-epc-core.c           | 25 +++++-------
 drivers/pci/endpoint/pci-epf-core.c           | 15 ++++----
 include/linux/pci-epc.h                       | 38 ++++++++++++++++---
 14 files changed, 105 insertions(+), 58 deletions(-)

Comments

Kishon Vijay Abraham I Feb. 14, 2024, 4:17 a.m. UTC | #1
Hi Niklas,

On 2/10/2024 6:56 AM, Niklas Cassel wrote:
> The series is based on top of:
> https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=endpoint
> 
> 
> Hello all,
> 
> This series cleans up the hardware description for PCI endpoint BARs.
> 
> The problems with the existing hardware description:
> -The documentation is lackluster.
> -Some of the names are confusingly similar, e.g. fixed_64bit and
>   fixed_size, even though these are for completely unrelated things.
> -The way that the BARs are defined in the endpoint controller drivers
>   is messy, because the left hand side is not a BAR, so you can mark a
>   BAR as e.g. both fixed size and reserved.
> 
> This series tries to address all the problems above.
> 
> Personally, I think that the code is more readable, both the endpoint
> controller drivers, but also pci-epc-core.c.

Thank you for cleaning this up!

FWIW:
Reviewed-by: Kishon Vijay Abraham I <kishon@kernel.org>
> 
> (Oh, and as you can probably guess, I will be sending out a patch series
> that adds BAR_RESIZABLE to enum pci_epc_bar_type in the coming week(s).)
> 
> 
> Kind regards,
> Niklas
> 
> 
> Niklas Cassel (2):
>    PCI: endpoint: Clean up hardware description for BARs
>    PCI: endpoint: Drop only_64bit on reserved BARs
> 
>   drivers/pci/controller/dwc/pci-imx6.c         |  3 +-
>   drivers/pci/controller/dwc/pci-keystone.c     | 12 +++---
>   .../pci/controller/dwc/pci-layerscape-ep.c    |  5 ++-
>   drivers/pci/controller/dwc/pcie-keembay.c     |  8 +++-
>   drivers/pci/controller/dwc/pcie-rcar-gen4.c   |  4 +-
>   drivers/pci/controller/dwc/pcie-tegra194.c    | 10 +++--
>   drivers/pci/controller/dwc/pcie-uniphier-ep.c | 15 ++++++--
>   drivers/pci/controller/pcie-rcar-ep.c         | 14 ++++---
>   drivers/pci/endpoint/functions/pci-epf-ntb.c  |  4 +-
>   drivers/pci/endpoint/functions/pci-epf-test.c |  8 ++--
>   drivers/pci/endpoint/functions/pci-epf-vntb.c |  2 +-
>   drivers/pci/endpoint/pci-epc-core.c           | 25 +++++-------
>   drivers/pci/endpoint/pci-epf-core.c           | 15 ++++----
>   include/linux/pci-epc.h                       | 38 ++++++++++++++++---
>   14 files changed, 105 insertions(+), 58 deletions(-)
>
Niklas Cassel Feb. 14, 2024, 10:38 a.m. UTC | #2
On Wed, Feb 14, 2024 at 09:47:54AM +0530, Kishon Vijay Abraham I wrote:
> Hi Niklas,
> 
> On 2/10/2024 6:56 AM, Niklas Cassel wrote:
> > The series is based on top of:
> > https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/log/?h=endpoint
> > 
> > 
> > Hello all,
> > 
> > This series cleans up the hardware description for PCI endpoint BARs.
> > 
> > The problems with the existing hardware description:
> > -The documentation is lackluster.
> > -Some of the names are confusingly similar, e.g. fixed_64bit and
> >   fixed_size, even though these are for completely unrelated things.
> > -The way that the BARs are defined in the endpoint controller drivers
> >   is messy, because the left hand side is not a BAR, so you can mark a
> >   BAR as e.g. both fixed size and reserved.
> > 
> > This series tries to address all the problems above.
> > 
> > Personally, I think that the code is more readable, both the endpoint
> > controller drivers, but also pci-epc-core.c.
> 
> Thank you for cleaning this up!
> 
> FWIW:
> Reviewed-by: Kishon Vijay Abraham I <kishon@kernel.org>

IMHO, a FWIW is quite the undersell here, as there is no R-b I would value
higher than the R-b from the original author or the pci endpoint subsystem :)


Kind regards,
Niklas