diff mbox

PCI: Check bridge secondary/subordinate bus register

Message ID 1347322773-32283-1-git-send-email-yinghai@kernel.org
State Accepted
Headers show

Commit Message

Yinghai Lu Sept. 11, 2012, 12:19 a.m. UTC
Intel DP43BF requires "pci=assign-busses" to discover some devices.

It turns out BIOS set the bridge 00:1e.0 bus register wrong.

Try to check that wrong range and reject so next pass could only assign
bus for that bridge.

	https://bugzilla.kernel.org/show_bug.cgi?id=18412

Reported-by: VL <vl.homutov@gmail.com>
Tested-by: VL <vl.homutov@gmail.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: stable@vger.kernel.org

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ram Pai Sept. 11, 2012, 3:03 a.m. UTC | #1
On Mon, Sep 10, 2012 at 05:19:33PM -0700, Yinghai Lu wrote:
> Intel DP43BF requires "pci=assign-busses" to discover some devices.
> 
> It turns out BIOS set the bridge 00:1e.0 bus register wrong.
> 
> Try to check that wrong range and reject so next pass could only assign
> bus for that bridge.
> 
> 	https://bugzilla.kernel.org/show_bug.cgi?id=18412
> 
> Reported-by: VL <vl.homutov@gmail.com>
> Tested-by: VL <vl.homutov@gmail.com>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Cc: stable@vger.kernel.org
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 3cdba8b..a8f1bf6 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -729,7 +729,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
> 
>  	/* Check if setup is sensible at all */
>  	if (!pass &&
> -	    (primary != bus->number || secondary <= bus->number)) {
> +	    (primary != bus->number || secondary <= bus->number ||
> +	     secondary > subordinate)) {
>  		dev_dbg(&dev->dev, "bus configuration invalid, reconfiguring\n");
>  		broken = 1;
>  	}

Adding a unlikely() around the condition may help?

RP

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Sept. 18, 2012, 10:54 p.m. UTC | #2
On Mon, Sep 10, 2012 at 6:19 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> Intel DP43BF requires "pci=assign-busses" to discover some devices.
>
> It turns out BIOS set the bridge 00:1e.0 bus register wrong.
>
> Try to check that wrong range and reject so next pass could only assign
> bus for that bridge.
>
>         https://bugzilla.kernel.org/show_bug.cgi?id=18412

Applied to pci/yinghai-misc, thanks!

> Reported-by: VL <vl.homutov@gmail.com>
> Tested-by: VL <vl.homutov@gmail.com>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Cc: stable@vger.kernel.org
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 3cdba8b..a8f1bf6 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -729,7 +729,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
>
>         /* Check if setup is sensible at all */
>         if (!pass &&
> -           (primary != bus->number || secondary <= bus->number)) {
> +           (primary != bus->number || secondary <= bus->number ||
> +            secondary > subordinate)) {
>                 dev_dbg(&dev->dev, "bus configuration invalid, reconfiguring\n");
>                 broken = 1;
>         }
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yinghai Lu Sept. 18, 2012, 11:55 p.m. UTC | #3
On Tue, Sep 18, 2012 at 3:54 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Mon, Sep 10, 2012 at 6:19 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>> Intel DP43BF requires "pci=assign-busses" to discover some devices.
>>
>> It turns out BIOS set the bridge 00:1e.0 bus register wrong.
>>
>> Try to check that wrong range and reject so next pass could only assign
>> bus for that bridge.
>>
>>         https://bugzilla.kernel.org/show_bug.cgi?id=18412
>
> Applied to pci/yinghai-misc, thanks!

?
you already put it in pci/yinghai-bridge-subordinate and next

commit 4fe24116ccc5518d5b692cb4354342ee59970ca5
Merge: 8704936 a53d8d3
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Tue Sep 18 11:08:09 2012 -0600

    Merge branch 'pci/yinghai-bridge-subordinate' into next

    * pci/yinghai-bridge-subordinate:
      PCI: Check P2P bridge for invalid secondary/subordinate range

commit a53d8d32a2b768cdcdd0703f4754f49b02753d2c
Author: Yinghai Lu <yinghai@kernel.org>
Date:   Mon Sep 10 17:19:33 2012 -0700

    PCI: Check P2P bridge for invalid secondary/subordinate range
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Sept. 19, 2012, 1:56 p.m. UTC | #4
On Tue, Sep 18, 2012 at 5:55 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Tue, Sep 18, 2012 at 3:54 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On Mon, Sep 10, 2012 at 6:19 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>>> Intel DP43BF requires "pci=assign-busses" to discover some devices.
>>>
>>> It turns out BIOS set the bridge 00:1e.0 bus register wrong.
>>>
>>> Try to check that wrong range and reject so next pass could only assign
>>> bus for that bridge.
>>>
>>>         https://bugzilla.kernel.org/show_bug.cgi?id=18412
>>
>> Applied to pci/yinghai-misc, thanks!
>
> ?
> you already put it in pci/yinghai-bridge-subordinate and next

I did, but I thought it wasn't worth having a separate branch for each
of these onesy-twosy patches (this one, vgaarb, kmalloc/kzalloc, bus
resource free, etc.), so I decided to consolidate several of them on
pci/yinghai-misc and then merge *that* into next.

So pci/yinghai-bridge-subordinate is dead and I dropped it from next
(but as I said, it will get to next eventually via pci/yinghai-misc).
I don't recommend using my "next" branch as a base.  There's usually
no need, because patches usually don't depend on other things in
"next".  If they do, it's simpler to base them on the specific
"pci/yinghai-xxx" branch they require.

> commit 4fe24116ccc5518d5b692cb4354342ee59970ca5
> Merge: 8704936 a53d8d3
> Author: Bjorn Helgaas <bhelgaas@google.com>
> Date:   Tue Sep 18 11:08:09 2012 -0600
>
>     Merge branch 'pci/yinghai-bridge-subordinate' into next
>
>     * pci/yinghai-bridge-subordinate:
>       PCI: Check P2P bridge for invalid secondary/subordinate range
>
> commit a53d8d32a2b768cdcdd0703f4754f49b02753d2c
> Author: Yinghai Lu <yinghai@kernel.org>
> Date:   Mon Sep 10 17:19:33 2012 -0700
>
>     PCI: Check P2P bridge for invalid secondary/subordinate range
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 3cdba8b..a8f1bf6 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -729,7 +729,8 @@  int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
 
 	/* Check if setup is sensible at all */
 	if (!pass &&
-	    (primary != bus->number || secondary <= bus->number)) {
+	    (primary != bus->number || secondary <= bus->number ||
+	     secondary > subordinate)) {
 		dev_dbg(&dev->dev, "bus configuration invalid, reconfiguring\n");
 		broken = 1;
 	}