mbox series

[0/5] PCI/VPD: Add and use pci_read/write_vpd_any()

Message ID ba0b18a3-64d8-d72f-9e9f-ad3e4d7ae3b8@gmail.com
Headers show
Series PCI/VPD: Add and use pci_read/write_vpd_any() | expand

Message

Heiner Kallweit Sept. 10, 2021, 6:20 a.m. UTC
In certain cases we need a variant of pci_read_vpd()/pci_write_vpd() that
does not check against dev->vpd.len. Such cases are:
- reading VPD if dev->vpd.len isn't set yet (in pci_vpd_size())
- devices that map non-VPD information to arbitrary places in VPD address
  space (example: Chelsio T3 EEPROM write-protect flag)
Therefore add function variants that check against PCI_VPD_MAX_SIZE only.

Make the cxgb3 driver the first user of the new functions.

Preferably this series should go through the PCI tree.

Heiner Kallweit (5):
  PCI/VPD: Add pci_read/write_vpd_any()
  PCI/VPD: Use pci_read_vpd_any() in pci_vpd_size()
  cxgb3: Remove t3_seeprom_read and use VPD API
  cxgb3: Use VPD API in t3_seeprom_wp()
  cxgb3: Remove seeprom_write and user VPD API

 drivers/net/ethernet/chelsio/cxgb3/common.h   |  2 -
 .../net/ethernet/chelsio/cxgb3/cxgb3_main.c   | 38 +++----
 drivers/net/ethernet/chelsio/cxgb3/t3_hw.c    | 98 +++----------------
 drivers/pci/vpd.c                             | 79 ++++++++++-----
 include/linux/pci.h                           |  2 +
 5 files changed, 83 insertions(+), 136 deletions(-)

Comments

Bjorn Helgaas Oct. 8, 2021, 10:53 p.m. UTC | #1
On Fri, Sep 10, 2021 at 08:20:23AM +0200, Heiner Kallweit wrote:
> In certain cases we need a variant of pci_read_vpd()/pci_write_vpd() that
> does not check against dev->vpd.len. Such cases are:
> - reading VPD if dev->vpd.len isn't set yet (in pci_vpd_size())
> - devices that map non-VPD information to arbitrary places in VPD address
>   space (example: Chelsio T3 EEPROM write-protect flag)
> Therefore add function variants that check against PCI_VPD_MAX_SIZE only.
> 
> Make the cxgb3 driver the first user of the new functions.
> 
> Preferably this series should go through the PCI tree.
> 
> Heiner Kallweit (5):
>   PCI/VPD: Add pci_read/write_vpd_any()
>   PCI/VPD: Use pci_read_vpd_any() in pci_vpd_size()
>   cxgb3: Remove t3_seeprom_read and use VPD API
>   cxgb3: Use VPD API in t3_seeprom_wp()
>   cxgb3: Remove seeprom_write and user VPD API

Tentatively applied to pci/vpd for v5.16.

Ideally would like reviewed-by and ack for the cxgb3 parts from Raju,
Jakub, David.

>  drivers/net/ethernet/chelsio/cxgb3/common.h   |  2 -
>  .../net/ethernet/chelsio/cxgb3/cxgb3_main.c   | 38 +++----
>  drivers/net/ethernet/chelsio/cxgb3/t3_hw.c    | 98 +++----------------
>  drivers/pci/vpd.c                             | 79 ++++++++++-----
>  include/linux/pci.h                           |  2 +
>  5 files changed, 83 insertions(+), 136 deletions(-)
> 
> -- 
> 2.33.0
>
Jakub Kicinski Oct. 8, 2021, 11:42 p.m. UTC | #2
On Fri, 8 Oct 2021 17:53:40 -0500 Bjorn Helgaas wrote:
> Ideally would like reviewed-by and ack for the cxgb3 parts from Raju,
> Jakub, David.

Raju's ack would be best, there isn't much networking there, 
but certainly no objection for you merging the changes:

Acked-by: Jakub Kicinski <kuba@kernel.org>
Bjorn Helgaas Oct. 11, 2021, 8:43 p.m. UTC | #3
On Fri, Oct 08, 2021 at 04:42:49PM -0700, Jakub Kicinski wrote:
> On Fri, 8 Oct 2021 17:53:40 -0500 Bjorn Helgaas wrote:
> > Ideally would like reviewed-by and ack for the cxgb3 parts from Raju,
> > Jakub, David.
> 
> Raju's ack would be best, there isn't much networking there, 
> but certainly no objection for you merging the changes:
> 
> Acked-by: Jakub Kicinski <kuba@kernel.org>

Thanks, added your ack.