From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
"oe5hpm@gmail.com" <oe5hpm@gmail.com>,
Ralf Baechle <ralf@linux-mips.org>,
"James E.J. Bottomley" <jejb@parisc-linux.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Richard Henderson <rth@twiddle.net>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
David Howells <dhowells@redhat.com>,
Russell King <linux@arm.linux.org.uk>,
Tony Luck <tony.luck@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Ingo Molnar <mingo@redhat.com>,
Guenter Roeck <linux@roeck-us.net>,
Michal Simek <monstr@monstr.eu>, Chris Zankel <chris@zankel.net>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: trouble with PCI: Call pci_read_bridge_bases() from core instead of arch code
Date: Fri, 4 Sep 2015 17:44:12 +0100 [thread overview]
Message-ID: <20150904164412.GD22997@red-moon> (raw)
In-Reply-To: <CAE9FiQXeByB6zakDKKC=P68fWD-sKiP1tzn-DWZ+kBsVnXZLxg@mail.gmail.com>
On Fri, Sep 04, 2015 at 05:00:35PM +0100, Yinghai Lu wrote:
> On Fri, Sep 4, 2015 at 7:19 AM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> wrote:
>
> > By keeping the bridge old size while sizing the bridge if the new size
> > is < old size (ie bridge never shrinks), we implicitly assume that upon
> > first scan of the bridge apertures that are not claimed should be set to
> > size = 0 (ie as Bjorn said the size should be irrelevant in that case
> > because we are sizing the bridge to figure out what the size should be),
> > otherwise we might end up triggering issues as this thread shows because
> > the old size is always taken into consideration.
>
> oh, we have patches that will ignore old_size in last retry.
The problem here is not the last retry, it is the first bridge scan.
By moving pci_read_bridge_bases() to core PCI code, if we do not
vet the bridge apertures (ie claim them and reset them if the claiming
fails) we end up calling (on ARM) __pci_bus_size_bridges() with apertures
that can have sizes != 0, which does not make any sense since we are calling
__pci_bus_size_bridges() to *discover* what the aperture size should
be on first bridge scan, correct ?
__pci_bus_size_bridges() expects the "old_size" to be set to a sensible
value, and it seems to me that it should be 0 on first scan given
the current __pci_bus_size_bridges() implementation and my question
is where the bridge aperture resources must be reset for systems
(eg ARM) that reassign the whole PCI resource space.
The platform triggering this issue was working without any need for
realloc before, so your patches are indeed useful but I would like
to understand what you think about the issue described above.
Thanks you !
Lorenzo
>
> Please check
>
> git://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-yinghai.git
> for-pci-v4.3-next
>
> exact patches should be:
> https://git.kernel.org/cgit/linux/kernel/git/yinghai/linux-yinghai.git/patch/?id=e8539db0a669fc076ac50800e274af165ce3c5fe
> PCI: Treat optional as required in first try for bridge rescan
>
> https://git.kernel.org/cgit/linux/kernel/git/yinghai/linux-yinghai.git/patch/?id=a7a2e984194a051e77b88f59e2db030dd4d99e64
> PCI: Get new realloc size for bridge for last try
>
> Thanks
>
> Yinghai
>
next prev parent reply other threads:[~2015-09-04 16:44 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 9:51 trouble with PCI: Call pci_read_bridge_bases() from core instead of arch code oe5hpm
2015-09-02 17:47 ` Lorenzo Pieralisi
2015-09-02 20:32 ` Bjorn Helgaas
2015-09-03 10:01 ` Lorenzo Pieralisi
2015-09-03 16:21 ` Bjorn Helgaas
2015-09-03 17:57 ` Lorenzo Pieralisi
2015-09-04 14:19 ` Lorenzo Pieralisi
2015-09-04 16:00 ` Yinghai Lu
2015-09-04 16:44 ` Lorenzo Pieralisi [this message]
2015-09-04 23:53 ` Yinghai Lu
2015-09-07 9:12 ` Lorenzo Pieralisi
2015-09-14 10:09 ` Lorenzo Pieralisi
2015-09-14 16:05 ` Yinghai Lu
2015-09-14 16:28 ` Lorenzo Pieralisi
2015-09-14 17:36 ` Yinghai Lu
2015-09-14 23:58 ` Yinghai Lu
2015-09-15 9:46 ` Lorenzo Pieralisi
2015-09-15 15:57 ` Bjorn Helgaas
2015-09-15 16:30 ` Lorenzo Pieralisi
2015-09-15 16:51 ` Guenter Roeck
2015-09-15 19:25 ` Bjorn Helgaas
2015-09-15 20:26 ` Yinghai Lu
2015-09-16 8:58 ` Lorenzo Pieralisi
2015-09-15 20:17 ` Yinghai Lu
2015-09-15 21:07 ` Guenter Roeck
2015-09-15 21:12 ` Yinghai Lu
2015-09-09 11:32 ` Lorenzo Pieralisi
2015-09-09 16:59 ` Yinghai Lu
2015-09-09 17:22 ` Yinghai Lu
2015-09-09 17:38 ` Lorenzo Pieralisi
2015-09-03 10:03 ` oe5hpm
2015-09-03 10:30 ` oe5hpm
2015-09-03 10:51 ` Lorenzo Pieralisi
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=20150904164412.GD22997@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=chris@zankel.net \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=jejb@parisc-linux.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=linux@roeck-us.net \
--cc=mingo@redhat.com \
--cc=monstr@monstr.eu \
--cc=mpe@ellerman.id.au \
--cc=oe5hpm@gmail.com \
--cc=ralf@linux-mips.org \
--cc=rth@twiddle.net \
--cc=tony.luck@intel.com \
--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).