From: John Garry <john.garry@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: <xuwei5@huawei.com>, <linuxarm@huawei.com>, <arm@kernel.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
Joe Perches <joe@perches.com>
Subject: Re: [PATCH v2] bus: hisi_lpc: Don't use devm_kzalloc() to allocate logical PIO range
Date: Tue, 18 Jun 2019 09:44:26 +0100 [thread overview]
Message-ID: <539835d3-770c-285c-0c49-ae15ceaa3079@huawei.com> (raw)
In-Reply-To: <CAErSpo4DemDWtnP2Gtram9tfQ0CaN9Na9_Gxk6Qk+nG5+JLuzA@mail.gmail.com>
>>
- zhichang personal mail
>> It's now on my todo list.
>>
>> I'll need advice on how to test this for hot-pluggable host bridges.
>>
>>>
>>> Could you just move the logic_pio_register_range() call farther down
>>> in hisi_lpc_probe()? IIUC, once logic_pio_register_range() returns,
>>> an inb() with the right port number will try to access that port, so
>>> we should be prepared for that, i.e., maybe this in the wrong order to
>>> begin with?
>>
>> No, unfortunately we can't. The reason is that we need the logical PIO
>> base for that range before we enumerate the children of that host. We
>> need that base address for "translating" the child bus addresses to
>> logical PIO addresses.
>
Hi Bjorn,
> Ah, yeah, that makes sense. I think. We do assume that we know all
> the MMIO and I/O port translations before enumerating devices. It's
> *conceivable* that could be changed someday since we don't actually
> need the translations until a driver claims the device,
We actually need them before a driver claims the device.
The reason is that when we create that child platform device we set the
device's IORESOURCE_IO resources according to the translated logic PIO
addresses, and not the host bus address. This is what makes the host
transparent to the child device driver.
and it would
> gain some flexibility if we didn't have to program the host bridge
> windows until we know how much space is required. But I don't see
> that happening anytime soon.
>
> Bjorn
>
> .
>
BTW, as you may have noticed, in v3 I said I would drop this patch and
fix it all properly.
My problem is that I need to ensure that the new logical PIO unregister
function works ok for hot-pluggable host bridges. I need to get some way
to test this. Advice?
Thanks,
John
next prev parent reply other threads:[~2019-06-18 8:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 10:24 John Garry
2019-06-14 13:20 ` Bjorn Helgaas
2019-06-14 13:23 ` Bjorn Helgaas
[not found] ` <82840955-6365-0b95-6d69-8a2f7c7880af@huawei.com>
2019-06-14 21:56 ` Bjorn Helgaas
[not found] ` <9e8b6971-3189-9d4b-de9a-ff09f859f4f6@huawei.com>
2019-06-17 20:33 ` Bjorn Helgaas
2019-06-18 8:44 ` John Garry [this message]
2019-06-18 17:50 ` Bjorn Helgaas
2019-06-19 9:48 ` PCI host bridge hotplug test question (was Re: [PATCH v2] bus: hisi_lpc: Don't use devm_kzalloc() to allocate logical PIO range) John Garry
2019-06-19 9:53 ` John Garry
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=539835d3-770c-285c-0c49-ae15ceaa3079@huawei.com \
--to=john.garry@huawei.com \
--cc=arm@kernel.org \
--cc=bhelgaas@google.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=xuwei5@huawei.com \
/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
all inboxes | Powered by JetHome®