From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: 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,
"Horst H. von Brand" <vonbrand@inf.utfsm.cl>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, Borislav Petkov <bp@amd64.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 09:18:58 -0800 [thread overview]
Message-ID: <20101112091858.3db4787a@jbarnes-desktop> (raw)
In-Reply-To: <20101110172607.2537.10985.stgit@bob.kio>
On Wed, 10 Nov 2010 10:26:07 -0700
Bjorn Helgaas <bjorn.helgaas@hp.com> 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
> Reported-by: Borislav Petkov <bp@amd64.org>
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> ---
Applied to my for-linus branch, thanks.
--
Jesse Barnes, Intel Open Source Technology Center
prev parent reply other threads:[~2010-11-12 17:19 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
2010-11-12 17:18 ` Jesse Barnes [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=20101112091858.3db4787a@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=bjorn.helgaas@hp.com \
--cc=bp@amd64.org \
--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=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.