From: Wei Xu <xuwei5@hisilicon.com>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>,
yuanzhichang <yuanzhichang@hisilicon.com>,
<john.garry@huawei.com>,
gabrielepaoloni <gabriele.paoloni@huawei.com>,
bhelgaas <bhelgaas@google.com>,
andyshevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Questions about logic_pio
Date: Thu, 20 Feb 2020 17:48:39 +0800 [thread overview]
Message-ID: <5E4E55F7.70800@hisilicon.com> (raw)
In-Reply-To: <1705dbe62ce.10ae800394772.9222265269135747883@flygoat.com>
Hi Jiaxun,
On 2020/2/19 21:58, Jiaxun Yang wrote:
> Hi there,
>
> Logic PIO gives us a way to make indirect PIO access, however,
> the way it handles direct (MMIO) I/O access confused me.
>
> I was trying to create a PCI controller Driver and noticed that I/O range parsed
> from DeviceTree will be added to the Logic PIO range by logic_pio_register_range.
> And than PCI subsystem will use the ioport obtained from `logic_pio_trans_cpuaddr`
> to allocate resources for the host bridge. In my case, the range added to the logic pio
> was set as hw_start 0x4000, size 0x4000. Later, `logic_pio_trans_cpuaddr` called
> by `pci_address_to_pio` gives a ioport of 0x0, which is totally wrong.
>
> After dig into logic pio logic, I found that logic pio is trying to "allocate" an io_start
> for MMIO ranges, the allocation starts from 0x0. And later the io_start is used to calculate
> cpu_address. In my opinion, for direct MMIO access, logic_pio address should always
> equal to hw address, because there is no way to translate address from logic pio address
> to actual hw address in {in,out}{b,sb,w,sb,l,sl} operations.
>
> How this mechanism intends to work? What is the reason that we are trying to
> allocate a io_start for MMIO rather than take their hw_start ioport directly?
>
> Thanks.
Corrected John's mail address.
Maybe he can help.
Best Regards,
Wei
>
> --
> Jiaxun Yang
>
>
>
> .
>
next prev parent reply other threads:[~2020-02-20 9:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 13:58 Jiaxun Yang
2020-02-20 9:48 ` Wei Xu [this message]
2020-02-20 10:52 ` John Garry
2020-02-20 11:55 ` Jiaxun Yang
2020-02-20 14:23 ` John Garry
2020-02-20 15:12 ` Jiaxun Yang
2020-02-20 17:39 ` John Garry
2020-02-20 18:32 ` John Garry
2020-02-21 0:42 ` Jiaxun Yang
2020-02-21 11:49 ` John Garry
2020-02-21 16:47 ` Jiaxun Yang
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=5E4E55F7.70800@hisilicon.com \
--to=xuwei5@hisilicon.com \
--cc=andy.shevchenko@gmail.com \
--cc=bhelgaas@google.com \
--cc=gabriele.paoloni@huawei.com \
--cc=jiaxun.yang@flygoat.com \
--cc=john.garry@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=yuanzhichang@hisilicon.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
Powered by JetHome