From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Ram Pai <linuxram@us.ibm.com>
Cc: Yinghai Lu <yinghai@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH -v2] pci: Check bridge resources after resource allocation.
Date: Mon, 16 May 2011 20:52:33 -0700 [thread overview]
Message-ID: <20110516205233.40ff7da4@jbarnes-e6510> (raw)
In-Reply-To: <20110516223621.GX8195@ram-laptop>
On Mon, 16 May 2011 15:36:21 -0700
Ram Pai <linuxram@us.ibm.com> wrote:
> On Mon, May 16, 2011 at 01:55:38PM -0700, Yinghai Lu wrote:
> > On 05/16/2011 12:59 AM, Ram Pai wrote:
> > > On Fri, May 13, 2011 at 06:06:17PM -0700, Yinghai Lu wrote:
> > >> On 05/12/2011 12:34 PM, Jesse Barnes wrote:
> > >>> On Thu, 12 May 2011 12:18:43 -0700
> > >>> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> > >>>
> > >>>> On Thu, May 12, 2011 at 11:37 AM, Jesse Barnes
> > >>>> <jbarnes@virtuousgeek.org> wrote:
> > >>>>>
> > >>>>> Linus, I don't have anything else queued up, so you may as
> > >>>>> well take this one directly if you want it in 2.6.39. It's a
> > >>>>> regression fix, but resource changes always make me nervous.
> > >>>>> Alternately, I could put it into 2.6.40 instead, the backport
> > >>>>> to 2.6.39.x if it survives until 2.6.40-rc2 or so...
> > >>>>
> > >>>> Considering the trouble resource allocation always ends up
> > >>>> being, I'd almost prefer that "mark it for stable and put it
> > >>>> in the 2.6.40 queue".
> > >>>>
> > >>>> Afaik this problem hasn't actually hit any "normal" users, has
> > >>>> it? So ...
> > >>>
> > >>> Sounds good, thanks. Yeah I don't think it's hit anyone but
> > >>> Yinghai (at least I don't know of any other reports).
> > >>>
> > >>
> > >> please check this one, it should be safe for 2.6.39 ?
> > >
> > >> size0 = calculate_iosize(size, min_size, size1,
> > >> resource_size(b_res), 4096);
> > >> - size1 = !add_size? size0:
> > >> + size1 = (!add_head || (add_head && !add_size)) ? size0 :
> > >> calculate_iosize(size, min_size+add_size, size1,
> > >> resource_size(b_res), 4096);
> > >
> > > This solves the problem you encountered.
> > >
> > > But, I think, it still does not fix the following scenario:
> > >
> > > adjust_resource() failing to allocate additional resource to a
> > > hotplug bridge that has no children. In this case ->flags of
> > > that 'struct resource' continues to be set even when no resource
> > > is allocated to that hot-plug bridge.
> > >
> > that case: requested_size will be 0, but add_size will not be zero.
> >
> > res->flags is not cleared in pbus_size_xx, so it will be put into
> > head. so it will go through first path.
> > ...
> > if (!resource_size(res) && add_size) {
> > res->end = res->start + add_size - 1;
> > if(pci_assign_resource(list->dev, idx))
> > reset_resource(res);
> > } else if (add_size) {
> > adjust_resource(res, res->start,
> > resource_size(res) + add_size);
> > }
> >
> > and if it fails to get assign, the flags will get clear in
> > reset_resource.
> >
> > so it should be ok. and testing in one my setup show those flags
> > get clear correctly and does not emit any warning.
>
>
> Ack. You are right.
>
> Linus/Jesse: can we consider this patch for 2.6.39? It is the
> simplest fix to the problem.
>
> Reviewed-by: Ram Pai <linuxram@us.ibm.com>
I'll queue it up for 2.6.40 with stable cc'd.
Thanks,
Jesse
next prev parent reply other threads:[~2011-05-17 3:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 7:24 [PATCH] pci: Check bridge resources after resource allocation Yinghai Lu
2011-05-06 8:12 ` Ram Pai
2011-05-06 20:22 ` Yinghai Lu
2011-05-06 20:43 ` [PATCH 1/2] pci: Using add_list in pcie hotplug path Yinghai Lu
2011-05-06 20:44 ` [PATCH 2/2] pci: honor child buses add_size in hot plug configuration Yinghai Lu
2011-05-07 1:52 ` [PATCH] pci: Check bridge resources after resource allocation Ram Pai
2011-05-07 2:37 ` Yinghai Lu
2011-05-08 7:55 ` [PATCH -v2] " Yinghai Lu
2011-05-09 21:20 ` Jesse Barnes
2011-05-09 22:36 ` Linus Torvalds
2011-05-11 1:19 ` Yinghai Lu
2011-05-12 18:06 ` Ram Pai
2011-05-12 18:14 ` Linus Torvalds
2011-05-12 18:22 ` Ram Pai
2011-05-12 18:37 ` Jesse Barnes
2011-05-12 19:18 ` Linus Torvalds
2011-05-12 19:34 ` Jesse Barnes
2011-05-14 1:06 ` Yinghai Lu
2011-05-16 7:59 ` Ram Pai
2011-05-16 20:55 ` Yinghai Lu
2011-05-16 22:36 ` Ram Pai
2011-05-17 3:52 ` Jesse Barnes [this message]
2011-05-17 5:22 ` Linus Torvalds
2011-05-12 18:22 ` Yinghai Lu
2011-05-12 18:30 ` Yinghai Lu
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=20110516205233.40ff7da4@jbarnes-e6510 \
--to=jbarnes@virtuousgeek.org \
--cc=akpm@linux-foundation.org \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=torvalds@linux-foundation.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).