diff mbox series

PCI/VPD: Remove not any longer needed Broadcom NIC quirk

Message ID 1c0c94d1-37bd-442f-a93e-6e2fa202526b@gmail.com (mailing list archive)
State Superseded
Headers show
Series PCI/VPD: Remove not any longer needed Broadcom NIC quirk | expand

Commit Message

Heiner Kallweit Dec. 17, 2020, 8:29 p.m. UTC
This quirk was added in 2008 when we didn't have the logic yet to
determine VPD size based on checking for the VPD end tag. Now that we
have this logic and don't read beyond the end tag this quirk can be
removed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
This is basically the same as what you're currently discussing
for the Marvell / QLogic 1077 quirk.
---
 drivers/pci/vpd.c | 46 ----------------------------------------------
 1 file changed, 46 deletions(-)

Comments

Bjorn Helgaas Dec. 17, 2020, 8:47 p.m. UTC | #1
On Thu, Dec 17, 2020 at 09:29:19PM +0100, Heiner Kallweit wrote:
> This quirk was added in 2008 when we didn't have the logic yet to
> determine VPD size based on checking for the VPD end tag. Now that we
> have this logic and don't read beyond the end tag this quirk can be
> removed.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> This is basically the same as what you're currently discussing
> for the Marvell / QLogic 1077 quirk.

We need to reference the commit that makes the quirk unnecessary so
people can tell how far it is safe to backport this patch.

> ---
>  drivers/pci/vpd.c | 46 ----------------------------------------------
>  1 file changed, 46 deletions(-)
> 
> diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
> index 7915d10f9..ef5165eb3 100644
> --- a/drivers/pci/vpd.c
> +++ b/drivers/pci/vpd.c
> @@ -578,52 +578,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_QLOGIC, 0x2261, quirk_blacklist_vpd);
>  DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031,
>  			      PCI_CLASS_BRIDGE_PCI, 8, quirk_blacklist_vpd);
>  
> -/*
> - * For Broadcom 5706, 5708, 5709 rev. A nics, any read beyond the
> - * VPD end tag will hang the device.  This problem was initially
> - * observed when a vpd entry was created in sysfs
> - * ('/sys/bus/pci/devices/<id>/vpd').   A read to this sysfs entry
> - * will dump 32k of data.  Reading a full 32k will cause an access
> - * beyond the VPD end tag causing the device to hang.  Once the device
> - * is hung, the bnx2 driver will not be able to reset the device.
> - * We believe that it is legal to read beyond the end tag and
> - * therefore the solution is to limit the read/write length.
> - */
> -static void quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
> -{
> -	/*
> -	 * Only disable the VPD capability for 5706, 5706S, 5708,
> -	 * 5708S and 5709 rev. A
> -	 */
> -	if ((dev->device == PCI_DEVICE_ID_NX2_5706) ||
> -	    (dev->device == PCI_DEVICE_ID_NX2_5706S) ||
> -	    (dev->device == PCI_DEVICE_ID_NX2_5708) ||
> -	    (dev->device == PCI_DEVICE_ID_NX2_5708S) ||
> -	    ((dev->device == PCI_DEVICE_ID_NX2_5709) &&
> -	     (dev->revision & 0xf0) == 0x0)) {
> -		if (dev->vpd)
> -			dev->vpd->len = 0x80;
> -	}
> -}
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> -			PCI_DEVICE_ID_NX2_5706,
> -			quirk_brcm_570x_limit_vpd);
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> -			PCI_DEVICE_ID_NX2_5706S,
> -			quirk_brcm_570x_limit_vpd);
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> -			PCI_DEVICE_ID_NX2_5708,
> -			quirk_brcm_570x_limit_vpd);
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> -			PCI_DEVICE_ID_NX2_5708S,
> -			quirk_brcm_570x_limit_vpd);
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> -			PCI_DEVICE_ID_NX2_5709,
> -			quirk_brcm_570x_limit_vpd);
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> -			PCI_DEVICE_ID_NX2_5709S,
> -			quirk_brcm_570x_limit_vpd);
> -
>  static void quirk_chelsio_extend_vpd(struct pci_dev *dev)
>  {
>  	int chip = (dev->device & 0xf000) >> 12;
> -- 
> 2.29.2
>
Heiner Kallweit Dec. 17, 2020, 8:55 p.m. UTC | #2
Am 17.12.2020 um 21:47 schrieb Bjorn Helgaas:
> On Thu, Dec 17, 2020 at 09:29:19PM +0100, Heiner Kallweit wrote:
>> This quirk was added in 2008 when we didn't have the logic yet to
>> determine VPD size based on checking for the VPD end tag. Now that we
>> have this logic and don't read beyond the end tag this quirk can be
>> removed.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> This is basically the same as what you're currently discussing
>> for the Marvell / QLogic 1077 quirk.
> 
> We need to reference the commit that makes the quirk unnecessary so
> people can tell how far it is safe to backport this patch.
> 
OK, will add the info in a v2.

>> ---
>>  drivers/pci/vpd.c | 46 ----------------------------------------------
>>  1 file changed, 46 deletions(-)
>>
>> diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
>> index 7915d10f9..ef5165eb3 100644
>> --- a/drivers/pci/vpd.c
>> +++ b/drivers/pci/vpd.c
>> @@ -578,52 +578,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_QLOGIC, 0x2261, quirk_blacklist_vpd);
>>  DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031,
>>  			      PCI_CLASS_BRIDGE_PCI, 8, quirk_blacklist_vpd);
>>  
>> -/*
>> - * For Broadcom 5706, 5708, 5709 rev. A nics, any read beyond the
>> - * VPD end tag will hang the device.  This problem was initially
>> - * observed when a vpd entry was created in sysfs
>> - * ('/sys/bus/pci/devices/<id>/vpd').   A read to this sysfs entry
>> - * will dump 32k of data.  Reading a full 32k will cause an access
>> - * beyond the VPD end tag causing the device to hang.  Once the device
>> - * is hung, the bnx2 driver will not be able to reset the device.
>> - * We believe that it is legal to read beyond the end tag and
>> - * therefore the solution is to limit the read/write length.
>> - */
>> -static void quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
>> -{
>> -	/*
>> -	 * Only disable the VPD capability for 5706, 5706S, 5708,
>> -	 * 5708S and 5709 rev. A
>> -	 */
>> -	if ((dev->device == PCI_DEVICE_ID_NX2_5706) ||
>> -	    (dev->device == PCI_DEVICE_ID_NX2_5706S) ||
>> -	    (dev->device == PCI_DEVICE_ID_NX2_5708) ||
>> -	    (dev->device == PCI_DEVICE_ID_NX2_5708S) ||
>> -	    ((dev->device == PCI_DEVICE_ID_NX2_5709) &&
>> -	     (dev->revision & 0xf0) == 0x0)) {
>> -		if (dev->vpd)
>> -			dev->vpd->len = 0x80;
>> -	}
>> -}
>> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
>> -			PCI_DEVICE_ID_NX2_5706,
>> -			quirk_brcm_570x_limit_vpd);
>> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
>> -			PCI_DEVICE_ID_NX2_5706S,
>> -			quirk_brcm_570x_limit_vpd);
>> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
>> -			PCI_DEVICE_ID_NX2_5708,
>> -			quirk_brcm_570x_limit_vpd);
>> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
>> -			PCI_DEVICE_ID_NX2_5708S,
>> -			quirk_brcm_570x_limit_vpd);
>> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
>> -			PCI_DEVICE_ID_NX2_5709,
>> -			quirk_brcm_570x_limit_vpd);
>> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
>> -			PCI_DEVICE_ID_NX2_5709S,
>> -			quirk_brcm_570x_limit_vpd);
>> -
>>  static void quirk_chelsio_extend_vpd(struct pci_dev *dev)
>>  {
>>  	int chip = (dev->device & 0xf000) >> 12;
>> -- 
>> 2.29.2
>>
diff mbox series

Patch

diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index 7915d10f9..ef5165eb3 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -578,52 +578,6 @@  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_QLOGIC, 0x2261, quirk_blacklist_vpd);
 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031,
 			      PCI_CLASS_BRIDGE_PCI, 8, quirk_blacklist_vpd);
 
-/*
- * For Broadcom 5706, 5708, 5709 rev. A nics, any read beyond the
- * VPD end tag will hang the device.  This problem was initially
- * observed when a vpd entry was created in sysfs
- * ('/sys/bus/pci/devices/<id>/vpd').   A read to this sysfs entry
- * will dump 32k of data.  Reading a full 32k will cause an access
- * beyond the VPD end tag causing the device to hang.  Once the device
- * is hung, the bnx2 driver will not be able to reset the device.
- * We believe that it is legal to read beyond the end tag and
- * therefore the solution is to limit the read/write length.
- */
-static void quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
-{
-	/*
-	 * Only disable the VPD capability for 5706, 5706S, 5708,
-	 * 5708S and 5709 rev. A
-	 */
-	if ((dev->device == PCI_DEVICE_ID_NX2_5706) ||
-	    (dev->device == PCI_DEVICE_ID_NX2_5706S) ||
-	    (dev->device == PCI_DEVICE_ID_NX2_5708) ||
-	    (dev->device == PCI_DEVICE_ID_NX2_5708S) ||
-	    ((dev->device == PCI_DEVICE_ID_NX2_5709) &&
-	     (dev->revision & 0xf0) == 0x0)) {
-		if (dev->vpd)
-			dev->vpd->len = 0x80;
-	}
-}
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
-			PCI_DEVICE_ID_NX2_5706,
-			quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
-			PCI_DEVICE_ID_NX2_5706S,
-			quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
-			PCI_DEVICE_ID_NX2_5708,
-			quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
-			PCI_DEVICE_ID_NX2_5708S,
-			quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
-			PCI_DEVICE_ID_NX2_5709,
-			quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
-			PCI_DEVICE_ID_NX2_5709S,
-			quirk_brcm_570x_limit_vpd);
-
 static void quirk_chelsio_extend_vpd(struct pci_dev *dev)
 {
 	int chip = (dev->device & 0xf000) >> 12;