All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
	Bob Picco <bpicco@redhat.com>,
	Brian Bloniarz <phunge0@hotmail.com>,
	Charles Butterfield <charles.butterfield@nextcentury.com>,
	Denys Vlasenko <dvlasenk@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"Horst H. von Brand" <vonbrand@inf.utfsm.cl>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Stefan Becker <chemobejk@gmail.com>,
	Chuck Ebbert <cebbert@redhat.com>,
	Fabrice Bellet <fabrice@bellet.info>,
	Yinghai Lu <yinghai@kernel.org>,
	Leann Ogasawara <leann.ogasawara@canonical.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2] PCI: fix pci_bus_alloc_resource() hang, prefer positive decode
Date: Fri, 12 Nov 2010 16:17:37 +0100	[thread overview]
Message-ID: <20101112151737.GC28968@aftab> (raw)
In-Reply-To: <20101110172607.2537.10985.stgit@bob.kio>

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

  parent reply	other threads:[~2010-11-12 15:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 17:26 [PATCH v2] PCI: fix pci_bus_alloc_resource() hang, prefer positive decode Bjorn Helgaas
2010-11-11 18:48 ` Jesse Barnes
2010-11-11 19:24   ` Linus Torvalds
2010-11-12 15:17 ` Borislav Petkov [this message]
2010-11-12 17:18 ` Jesse Barnes

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=20101112151737.GC28968@aftab \
    --to=bp@amd64.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=bpicco@redhat.com \
    --cc=cebbert@redhat.com \
    --cc=charles.butterfield@nextcentury.com \
    --cc=chemobejk@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=fabrice@bellet.info \
    --cc=hpa@zytor.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=leann.ogasawara@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=phunge0@hotmail.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vonbrand@inf.utfsm.cl \
    --cc=yinghai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.