From: Michael Ellerman <mpe@ellerman.id.au>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Linus Walleij <linus.walleij@linaro.org>,
linux-pci <linux-pci@vger.kernel.org>
Subject: Re: of/pci: Fix the conversion of IO ranges into IO resources
Date: Thu, 16 Oct 2014 13:55:48 +1100 [thread overview]
Message-ID: <1413428148.20705.2.camel@concordia> (raw)
In-Reply-To: <20141015090239.GB18070@e106497-lin.cambridge.arm.com>
On Wed, 2014-10-15 at 10:02 +0100, Liviu Dudau wrote:
> On Wed, Oct 15, 2014 at 08:35:07AM +0100, Benjamin Herrenschmidt wrote:
> > On Thu, 2014-10-09 at 20:02 +0000, Linux Kernel Mailing List wrote:
> > > Gitweb: http://git.kernel.org/linus/;a=commit;h=0b0b0893d49b34201a6c4416b1a707b580b91e3d
> > > Commit: 0b0b0893d49b34201a6c4416b1a707b580b91e3d
> > > Author: Liviu Dudau <Liviu.Dudau@arm.com>
> > > Committer: Bjorn Helgaas <bhelgaas@google.com>
> > >
> > > of/pci: Fix the conversion of IO ranges into IO resources
> > >
> > > The ranges property for a host bridge controller in DT describes the
> > > mapping between the PCI bus address and the CPU physical address. The
> > > resources framework however expects that the IO resources start at a pseudo
> > > "port" address 0 (zero) and have a maximum size of IO_SPACE_LIMIT. The
> > > conversion from PCI ranges to resources failed to take that into account,
> > > returning a CPU physical address instead of a port number.
> > >
> > > Also fix all the drivers that depend on the old behaviour by fetching the
> > > CPU physical address based on the port number where it is being needed.
> >
> > Michael just signaled me that this completely breaks IO space on powerpc ...
>
> Hi Benjamin,
>
> I'm sorry to hear that I've broke powerpc before I've had a chance to actually
> change the code there. I would like to get the details of what functionality
> get broken.
You changed code that arch/powerpc depends on, without updating it, or even
CC'ing us on the patches. I'm not sure what you mean by "before I've had a
chance to actually change the code there" - it's too late.
> The pci_register_io_range() function (the "allocator" for IO space) is a
> weak function. It takes the CPU physical address of the range and its size
> and makes sure that it can fit that area in the arch's space for PCI IO.
> The main purpose of that function is to be a helper to pci_address_to_pio()
> in order to help return the correct answer in that function. pci_address_to_pio()
> is also weak and can be overwritten.
Yes, we already provide our own version of pci_address_to_pio().
The problem is it's too early to call it when we come in from
find_and_init_phbs() -> pci_process_bridge_OF_ranges(), so it returns junk.
I think you were expecting us to hit the #ifndef PCI_IOBASE case, which looks
like it might have worked.
For now we're just going to stop using of_pci_range_to_resource().
cheers
next prev parent reply other threads:[~2014-10-16 2:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20141009200235.55E5166107E@gitolite.kernel.org>
2014-10-15 7:35 ` of/pci: Fix the conversion of IO ranges into IO resources Benjamin Herrenschmidt
2014-10-15 9:02 ` Liviu Dudau
2014-10-16 2:55 ` Michael Ellerman [this message]
2014-10-16 3:58 ` Benjamin Herrenschmidt
2014-10-16 9:05 ` Liviu Dudau
2014-10-16 10:04 ` Benjamin Herrenschmidt
2014-10-16 10:28 ` Liviu Dudau
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=1413428148.20705.2.camel@concordia \
--to=mpe@ellerman.id.au \
--cc=Liviu.Dudau@arm.com \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.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.