public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	jacob.jun.pan@intel.com
Subject: Re: Regression:  2.6.34 boot fails on E5405 system, bisected:  de08e2c26
Date: Wed, 14 Jul 2010 12:27:48 -0700	[thread overview]
Message-ID: <4C3E0FB4.8020500@candelatech.com> (raw)
In-Reply-To: <4C3E077C.9040609@zytor.com>

On 07/14/2010 11:52 AM, H. Peter Anvin wrote:
> So I suggest the following changes...
>
> On 07/13/2010 07:19 PM, Jesse Barnes wrote:
>>>
>>> static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
>>> {
>>> 	int pos;
>>> 	u32 pcie_cap = 0, cap_data;
>>> 	printk("fixed_bar_cap, bus: %p  devfn: %u\n", bus, devfn);
>>> 	pos = PCIE_CAP_OFFSET;
>>> 	while (pos) {
>
> while (pos>= PCIE_CAP_OFFSET) {
>
>>> 		printk("Before read..\n");
>>> 		if (raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number,
>>> 					  devfn, pos, 4,&pcie_cap))
>>> 			return 0;
>>> 		printk("pcie_cap: %u", pcie_cap);
>>> 		
>     -		if (pcie_cap == 0xffffffff)
>     -			return 0;
> 		
>     +		if (PCI_EXT_CAP_ID(pcie_cap) == 0x0000 ||
>     +		    PCI_EXT_CAP_ID(pcie_cap) == 0xffff)
>     +			break;

This seems to work for me.  I'm using this patch against
2.6.34.y:

diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
index 1cdc02c..ee93fd0 100644
--- a/arch/x86/pci/mrst.c
+++ b/arch/x86/pci/mrst.c
@@ -61,13 +61,14 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
         if (!raw_pci_ext_ops)
                 return 0;

-       while (pos) {
+       while (pos >= PCIE_CAP_OFFSET) {
                 if (raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number,
                                           devfn, pos, 4, &pcie_cap))
                         return 0;

-               if (pcie_cap == 0xffffffff)
-                       return 0;
+               if (PCI_EXT_CAP_ID(pcie_cap) == 0x0000 ||
+                   PCI_EXT_CAP_ID(pcie_cap) == 0xffff)
+                       break;

                 if (PCI_EXT_CAP_ID(pcie_cap) == PCI_EXT_CAP_ID_VNDR) {
                         raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number,
@@ -76,7 +77,7 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
                                 return pos;
                 }

-               pos = pcie_cap >> 20;
+               pos = (pcie_cap >> 20) & 0xffc;
         }

         return 0;


Thanks,
Ben


> 		
>>> 		printk("Checking vendor..\n");
>
>>> 		if (PCI_EXT_CAP_ID(pcie_cap) == PCI_EXT_CAP_ID_VNDR) {
>>> 			printk("reading domain_nr\n");
>>> 			raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number,
>>> 					      devfn, pos + 4, 4,&cap_data);
>>> 			printk("cap_data: %u\n", cap_data);
>>> 			if ((cap_data&  0xffff) == PCIE_VNDR_CAP_ID_FIXED_BAR)
>>> 				return pos;
>>> 		}
>>>
>>> 		pos = pcie_cap>>  20;
>
> 		pos = (pcie_cap>>  20)&  0xffc;
>
>>> 		printk("pos after shift: %i\n", pos);
>>> 	}
>>>
>>> 	printk("Returning from fixed_bar_cap\n");
>>> 	return 0;
>>> }
>>>
>>>
>>
>> I thought a related bug was fixed already; the code should be returning
>> all zeros for non-existent BAR reads.
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


      parent reply	other threads:[~2010-07-14 19:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14  0:36 Regression: 2.6.34 boot fails on E5405 system, bisected: de08e2c26 Ben Greear
2010-07-14  1:17 ` Ben Greear
2010-07-14  1:56   ` Robert Hancock
2010-07-14  2:22     ` Ben Greear
2010-07-14  3:29       ` Robert Hancock
2010-07-14 14:14         ` Ben Greear
2010-07-14 15:36           ` Pan, Jacob jun
2010-07-14 16:09             ` Ben Greear
2010-07-14 16:11             ` Ben Greear
2010-07-14 17:06             ` Ben Greear
2010-07-14 18:19               ` Pan, Jacob jun
2010-07-14 18:22                 ` Ben Greear
2010-07-14 18:47                   ` H. Peter Anvin
2010-07-14 18:25                 ` H. Peter Anvin
2010-07-14 18:35           ` H. Peter Anvin
2010-07-14 18:41             ` Ben Greear
2010-07-14  2:19   ` Jesse Barnes
2010-07-14  2:24     ` Ben Greear
2010-07-14 18:52     ` H. Peter Anvin
2010-07-14 18:59       ` Jesse Barnes
2010-07-14 19:01         ` Pan, Jacob jun
2010-07-14 19:55           ` H. Peter Anvin
2010-07-15 16:38             ` Ben Greear
2010-07-16 17:33               ` Pan, Jacob jun
2010-07-16 18:28                 ` H. Peter Anvin
2010-07-14 19:03         ` H. Peter Anvin
2010-07-14 19:27       ` Ben Greear [this message]

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=4C3E0FB4.8020500@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=hpa@zytor.com \
    --cc=jacob.jun.pan@intel.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    /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