Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-13 Thread H. Peter Anvin
On 08/13/2012 02:58 PM, Betty Dall wrote: > > I checked the PCI specification, and Peter is right that function > numbers can be sparse. Please go with version 1 of the patch, as Andi > suggested. I will follow up by looking at why the three scans are not > consistent and send a patch, if

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-13 Thread Betty Dall
On Sat, 2012-08-11 at 03:43 -0700, Andi Kleen wrote: > On Fri, Aug 10, 2012 at 04:57:02PM -0700, H. Peter Anvin wrote: > > On 08/09/2012 03:34 PM, Betty Dall wrote: > > > > > > I thought this should be a break instead of a continue since the code > > > does a break if the class is 0x. If

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-13 Thread Betty Dall
On Sat, 2012-08-11 at 03:43 -0700, Andi Kleen wrote: On Fri, Aug 10, 2012 at 04:57:02PM -0700, H. Peter Anvin wrote: On 08/09/2012 03:34 PM, Betty Dall wrote: I thought this should be a break instead of a continue since the code does a break if the class is 0x. If the function

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-13 Thread H. Peter Anvin
On 08/13/2012 02:58 PM, Betty Dall wrote: I checked the PCI specification, and Peter is right that function numbers can be sparse. Please go with version 1 of the patch, as Andi suggested. I will follow up by looking at why the three scans are not consistent and send a patch, if appropriate.

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-12 Thread Andi Kleen
> If that is the case, there is a problem in the original code in > arch/x86/kernel/aperture_64.c.The original code already stops scanning > functions the first time it finds an invalid PCI class: This was only for some AMD northbridges, since it worked there it should be ok. The code is obsolete

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-12 Thread H. Peter Anvin
On 08/12/2012 08:23 PM, Khalid Aziz wrote: If that is the case, there is a problem in the original code in arch/x86/kernel/aperture_64.c.The original code already stops scanning functions the first time it finds an invalid PCI class: Unless we can prove that that is invalid *for that

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-12 Thread Khalid Aziz
On 08/10/2012 05:57 PM, H. Peter Anvin wrote: On 08/09/2012 03:34 PM, Betty Dall wrote: I thought this should be a break instead of a continue since the code does a break if the class is 0x. If the function does not have a valid VENDOR_ID, then the remaining function numbers do not have

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-12 Thread Khalid Aziz
On 08/10/2012 05:57 PM, H. Peter Anvin wrote: On 08/09/2012 03:34 PM, Betty Dall wrote: I thought this should be a break instead of a continue since the code does a break if the class is 0x. If the function does not have a valid VENDOR_ID, then the remaining function numbers do not have

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-12 Thread H. Peter Anvin
On 08/12/2012 08:23 PM, Khalid Aziz wrote: If that is the case, there is a problem in the original code in arch/x86/kernel/aperture_64.c.The original code already stops scanning functions the first time it finds an invalid PCI class: Unless we can prove that that is invalid *for that

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-12 Thread Andi Kleen
If that is the case, there is a problem in the original code in arch/x86/kernel/aperture_64.c.The original code already stops scanning functions the first time it finds an invalid PCI class: This was only for some AMD northbridges, since it worked there it should be ok. The code is obsolete

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-11 Thread Andi Kleen
On Fri, Aug 10, 2012 at 04:57:02PM -0700, H. Peter Anvin wrote: > On 08/09/2012 03:34 PM, Betty Dall wrote: > > > > I thought this should be a break instead of a continue since the code > > does a break if the class is 0x. If the function does not have a > > valid VENDOR_ID, then the

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-11 Thread Andi Kleen
On Fri, Aug 10, 2012 at 04:57:02PM -0700, H. Peter Anvin wrote: On 08/09/2012 03:34 PM, Betty Dall wrote: I thought this should be a break instead of a continue since the code does a break if the class is 0x. If the function does not have a valid VENDOR_ID, then the remaining

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-10 Thread H. Peter Anvin
On 08/09/2012 03:34 PM, Betty Dall wrote: > > I thought this should be a break instead of a continue since the code > does a break if the class is 0x. If the function does not have a > valid VENDOR_ID, then the remaining function numbers do not have to be > scanned because functions are

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-10 Thread H. Peter Anvin
On 08/09/2012 03:34 PM, Betty Dall wrote: I thought this should be a break instead of a continue since the code does a break if the class is 0x. If the function does not have a valid VENDOR_ID, then the remaining function numbers do not have to be scanned because functions are

[PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first v2

2012-08-09 Thread Andi Kleen
From: Andi Kleen According to the Intel PCI experts it's not safe to check any other field than vendor ID for 0x when doing PCI scans to see if the device exists. Several of the early PCI scans violated this. I changed them all to always check the vendor ID first. v2: Change some continues

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-09 Thread Andi Kleen
Thanks Betty. All fixed. I'll post a v2. -Andi -- a...@linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-09 Thread Betty Dall
Hi Andi, On Wed, 2012-08-08 at 15:17 -0700, Andi Kleen wrote: > From: Andi Kleen > > According to the Intel PCI experts it's not safe to check any > other field than vendor ID for 0x when doing PCI scans > to see if the device exists. > > Several of the early PCI scans violated this. I

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-09 Thread Betty Dall
Hi Andi, On Wed, 2012-08-08 at 15:17 -0700, Andi Kleen wrote: From: Andi Kleen a...@linux.intel.com According to the Intel PCI experts it's not safe to check any other field than vendor ID for 0x when doing PCI scans to see if the device exists. Several of the early PCI scans

Re: [PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-09 Thread Andi Kleen
Thanks Betty. All fixed. I'll post a v2. -Andi -- a...@linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first v2

2012-08-09 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com According to the Intel PCI experts it's not safe to check any other field than vendor ID for 0x when doing PCI scans to see if the device exists. Several of the early PCI scans violated this. I changed them all to always check the vendor ID first. v2:

[PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-08 Thread Andi Kleen
From: Andi Kleen According to the Intel PCI experts it's not safe to check any other field than vendor ID for 0x when doing PCI scans to see if the device exists. Several of the early PCI scans violated this. I changed them all to always check the vendor ID first. Signed-off-by: Andi Kleen

[PATCH] x86, pci: Fix all early PCI scans to check the vendor ID first

2012-08-08 Thread Andi Kleen
From: Andi Kleen a...@linux.intel.com According to the Intel PCI experts it's not safe to check any other field than vendor ID for 0x when doing PCI scans to see if the device exists. Several of the early PCI scans violated this. I changed them all to always check the vendor ID first.