lkml.org 
[lkml]   [2010]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] PCI: fix pci_bus_alloc_resource() hang, prefer positive decode
On Wed, Nov 10, 2010 at 12:26:07PM -0500, Bjorn Helgaas wrote:
>
> When a PCI bus has two resources with the same start/end, e.g.,
>
> pci_bus 0000:04: resource 2 [mem 0xd0000000-0xd7ffffff pref]
> pci_bus 0000:04: resource 7 [mem 0xd0000000-0xd7ffffff]
>
> the previous pci_bus_find_resource_prev() implementation would alternate
> between them forever:
>
> pci_bus_find_resource_prev(... [mem 0xd0000000-0xd7ffffff pref])
> returns [mem 0xd0000000-0xd7ffffff]
> pci_bus_find_resource_prev(... [mem 0xd0000000-0xd7ffffff])
> returns [mem 0xd0000000-0xd7ffffff pref]
> pci_bus_find_resource_prev(... [mem 0xd0000000-0xd7ffffff pref])
> returns [mem 0xd0000000-0xd7ffffff]
> ...
>
> This happened because there was no ordering between two resources with the
> same start and end. A resource that had the same start and end as the
> cursor, but was not itself the cursor, was considered to be before the
> cursor.
>
> This patch fixes the hang by making a fixed ordering between any two
> resources.
>
> In addition, it tries to allocate from positively decoded regions before
> using any subtractively decoded resources. This means we will use a
> positive decode region before a subtractive decode one, even if it means
> using a smaller address.
>
> Reference: https://bugzilla.kernel.org/show_bug.cgi?id=22062
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

Looks good.

Reported-and-tested-by: Borislav Petkov <bp@amd64.org>

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632


\
 
 \ /
  Last update: 2010-11-12 16:21    [W:0.064 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site