Message ID | 20090611100347.7c4160a4@nehalam |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Thu, Jun 11, 2009 at 10:03:47AM -0700, Stephen Hemminger wrote: > Some of the chip version have different registers, and some hardware vendors build > boards without VPD. Does this help: Thanks for the patch. I have built some kernels and pushed them out for testing. Will let you know what comes of it! Thanks. -apw -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Jun 12, 2009 at 12:51:20PM +0100, Andy Whitcroft wrote: > On Thu, Jun 11, 2009 at 10:03:47AM -0700, Stephen Hemminger wrote: > > > Some of the chip version have different registers, and some hardware vendors build > > boards without VPD. Does this help: > > Thanks for the patch. I have built some kernels and pushed them out > for testing. Will let you know what comes of it! Ok, that tests out good as well. Tested-by: Andy Whitcroft <apw@canonical.com> -apw -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Andy Whitcroft <apw@canonical.com> Date: Mon, 15 Jun 2009 11:17:53 +0100 > On Fri, Jun 12, 2009 at 12:51:20PM +0100, Andy Whitcroft wrote: >> On Thu, Jun 11, 2009 at 10:03:47AM -0700, Stephen Hemminger wrote: >> >> > Some of the chip version have different registers, and some hardware vendors build >> > boards without VPD. Does this help: >> >> Thanks for the patch. I have built some kernels and pushed them out >> for testing. Will let you know what comes of it! > > Ok, that tests out good as well. > > Tested-by: Andy Whitcroft <apw@canonical.com> Applied, thanks everyone. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/drivers/net/sky2.c 2009-06-11 09:26:05.420060719 -0700 +++ b/drivers/net/sky2.c 2009-06-11 09:28:27.004211122 -0700 @@ -4431,6 +4431,22 @@ static int __devinit sky2_probe(struct p goto err_out; } + /* Get configuration information + * Note: only regular PCI config access once to test for HW issues + * other PCI access through shared memory for speed and to + * avoid MMCONFIG problems. + */ + err = pci_read_config_dword(pdev, PCI_DEV_REG2, ®); + if (err) { + dev_err(&pdev->dev, "PCI read config failed\n"); + goto err_out; + } + + if (~reg == 0) { + dev_err(&pdev->dev, "PCI configuration read error\n"); + goto err_out; + } + err = pci_request_regions(pdev, DRV_NAME); if (err) { dev_err(&pdev->dev, "cannot obtain PCI resources\n"); @@ -4456,21 +4472,6 @@ static int __devinit sky2_probe(struct p } } - /* Get configuration information - * Note: only regular PCI config access once to test for HW issues - * other PCI access through shared memory for speed and to - * avoid MMCONFIG problems. - */ - err = pci_read_config_dword(pdev, PCI_DEV_REG2, ®); - if (err) { - dev_err(&pdev->dev, "PCI read config failed\n"); - goto err_out_free_regions; - } - - /* size of available VPD, only impact sysfs */ - err = pci_vpd_truncate(pdev, 1ul << (((reg & PCI_VPD_ROM_SZ) >> 14) + 8)); - if (err) - dev_warn(&pdev->dev, "Can't set VPD size\n"); #ifdef __BIG_ENDIAN /* The sk98lin vendor driver uses hardware byte swapping but