]> git.baikalelectronics.ru Git - kernel.git/commit
cxgb4: Set VPD size so we can read both VPD structures
authorHariprasad Shenai <hariprasad@chelsio.com>
Fri, 15 Apr 2016 18:00:18 +0000 (13:00 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 15 Apr 2016 18:00:18 +0000 (13:00 -0500)
commitea6b3dcef08d86d1aac8dcddc69beeb8335963a1
treea5b0cad802e1327e671aa01e705ce97514325527
parent6ca24ab8bc926c8057edc43942c83bb8529a709e
cxgb4: Set VPD size so we can read both VPD structures

Chelsio adapters have two VPD structures stored in the VPD:

  - offset 0x000: an abbreviated VPD, and
  - offset 0x400: the complete VPD.

After 6607d8017b01 ("PCI: Determine actual VPD size on first access"), the
PCI core computes the valid VPD size by parsing the VPD starting at offset
0x0.  That size only includes the abbreviated VPD structure, so reads of
the complete VPD at 0x400 fail.

Explicitly set the VPD size with pci_set_vpd_size() so the driver can read
both VPD structures.

[bhelgaas: changelog, split patches, rename to pci_set_vpd_size() and
return int (not ssize_t)]
Fixes: 6607d8017b01 ("PCI: Determine actual VPD size on first access")
Tested-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c