netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu Zhao <yu.zhao@intel.com>
To: Eric Dumazet <dada1@cosmosbay.com>, benli@broadcom.com
Cc: "willy@linux.intel.com" <willy@linux.intel.com>,
	"jbarnes@virtuousgeek.org" <jbarnes@virtuousgeek.org>,
	linux kernel <linux-kernel@vger.kernel.org>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Michael Chan <mchan@broadcom.com>
Subject: Re: [PATCH] PCI: Limit VPD length for Broadcom 5708S
Date: Tue, 28 Oct 2008 14:44:11 +0800	[thread overview]
Message-ID: <20081028064411.GA7043@yzhao12-linux.sh.intel.com> (raw)
In-Reply-To: <4906AF5F.9040704@cosmosbay.com>

On Tue, Oct 28, 2008 at 02:21:19PM +0800, Eric Dumazet wrote:
> Benjamin Li a écrit :
> > Hi Eric,
> > 
> > It looks like the same problem again: we are reading past a valid VPD
> > address.
> > 
> > After some initial debugging, it looks like dev->vpd is NULL when the
> > Broadcom 5706C/5706S/5708C/570S/5709 quirk is called.  Because of this
> > dev->vpd->len is never set to the proper length to limit the VPD reads.
> > I will debug further to determine what has changed.
> > 
> > Thanks again for pointing out the problem.
> > 
> 
> I did a git bisect this morning :
> 
> $ git bisect good
> 201de56eb22f1ff3f36804bc70cbff220b50f067 is first bad commit
> commit 201de56eb22f1ff3f36804bc70cbff220b50f067
> Author: Zhao, Yu <yu.zhao@intel.com>
> Date:   Mon Oct 13 19:49:55 2008 +0800
> 
>     PCI: centralize the capabilities code in probe.c
> 
>     This patch centralizes the initialization and release functions of
>     various PCI capabilities in probe.c, which makes the introduction
>     of new capability support functions cleaner in the future.
> 
>     Signed-off-by: Yu Zhao <yu.zhao@intel.com>
>     Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> 

Yes, the VPD initialization code has been moved to a later stage that is
after the pci_fixup_header. Can you please try following fix?

Thanks,
Yu

VPD quirks needs to be called after the capability is initialized. Since
VPD initialization is move to after pci_fixup_header, VPD quirks should
be done at pci_fixup_final stage correspondingly.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index bbf66ea..5049a47 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1692,24 +1692,24 @@ static void __devinit quirk_brcm_570x_limit_vpd(struct pci_dev *dev)
 	}
 }
 
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM,
-			 PCI_DEVICE_ID_NX2_5706,
-			 quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM,
-			 PCI_DEVICE_ID_NX2_5706S,
-			 quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM,
-			 PCI_DEVICE_ID_NX2_5708,
-			 quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM,
-			 PCI_DEVICE_ID_NX2_5708S,
-			 quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM,
-			 PCI_DEVICE_ID_NX2_5709,
-			 quirk_brcm_570x_limit_vpd);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM,
-			 PCI_DEVICE_ID_NX2_5709S,
-			 quirk_brcm_570x_limit_vpd);
+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);
 
 #ifdef CONFIG_PCI_MSI
 /* Some chipsets do not support MSI. We cannot easily rely on setting

  reply	other threads:[~2008-10-28  7:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 18:27 [PATCH] PCI: Limit VPD length for Broadcom 5708S Eric Dumazet
2008-07-31 19:39 ` Jesse Barnes
     [not found] ` <1217532284-7032-1-git-send-email-benli@broadcom.com>
     [not found]   ` <1217532284-7032-2-git-send-email-benli@broadcom.com>
2008-07-31 19:41     ` [PATCH] PCI: Add limits to VPD read/write lengths for Broadcom 5706S, 5708S Jesse Barnes
2008-10-27 22:27 ` [PATCH] PCI: Limit VPD length for Broadcom 5708S Eric Dumazet
2008-10-28  3:26   ` Benjamin Li
2008-10-28  6:21     ` Eric Dumazet
2008-10-28  6:44       ` Yu Zhao [this message]
2008-10-28  8:38         ` Eric Dumazet
2008-10-30 16:14         ` Jesse Barnes
2008-11-03 22:37         ` Jesse Barnes
2008-10-28 16:25     ` Benjamin Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081028064411.GA7043@yzhao12-linux.sh.intel.com \
    --to=yu.zhao@intel.com \
    --cc=benli@broadcom.com \
    --cc=dada1@cosmosbay.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).