From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org, chenhc@lemote.com, john.garry@huawei.com
Subject: Re: [PATCH RESEND v3 2/3] MIPS: Introduce PCI_IO_VMMAP
Date: Thu, 14 May 2020 16:21:49 +0200 [thread overview]
Message-ID: <20200514142149.GA14003@alpha.franken.de> (raw)
In-Reply-To: <928CB1C1-9852-4CEA-8B3E-E5EAB23E4A0B@flygoat.com>
On Sat, May 09, 2020 at 01:09:07AM +0800, Jiaxun Yang wrote:
>
>
> 于 2020年5月9日 GMT+08:00 上午12:52:35, Thomas Bogendoerfer <tsbogend@alpha.franken.de> 写到:
> >On Sat, May 09, 2020 at 12:22:25AM +0800, Jiaxun Yang wrote:
> >>
> >>
> >> 于 2020年5月9日 GMT+08:00 上午12:11:02, Thomas Bogendoerfer <tsbogend@alpha.franken.de> 写到:
> >> >On Fri, May 08, 2020 at 07:44:37PM +0800, Jiaxun Yang wrote:
> >> >> Define PCI_IOBASE for MIPS at the strat of kernel mapping segment.
> >> >> That would allow virt address of I/O ports to be dynamicly mapped.
> >> >> So we'll be able to combine multiple MMIO ranges into I/O ports
> >> >> and thus we can take advantage of logic_pio mechanism.
> >> >
> >> >What is the advantage ?
> >> >
> >> >From my point of view this will be slower because of TLB faults for
> >> >PCI IO space accesses.
> >>
> >> Advantage is we can use logic_pio to manage multiple I/O Port ranges.
> >
> >and what exactly does this buy us ? I looked at lib/logic_pio.c and
> >there didn't appear anything in my mind other than yet another
> >interface for doing the same thing...
>
> With Logic_PIO subsystem, each I/O region will be registered
> in logic_pio and being mapped in TLB, that means I/O regions can l
> be sparsely layouted in MMIO.
this isn't an advantage. You will get TLB miss exceptions, which you
don't get when using XPHYS addresses, which the current code does.
IMHO it you make more sense to use normal iomap/iounmap functions
in logic_pio.c. With that you would get TLB less access for memory
mapped PCI IO regions.
> And device drivers are accessing in*/out* functions via ioport allocated by
> logic_pio instead of the physical I/O ports.
your current patches don't select INDIRECT_PIO, so you are still
using the MIPS access methods just via the mapping from logic_pio. This
works as long as you are using already mapped ranges. This is at least
inconsistent.
If you really want to ignore the TLB miss problem, please drop
patch 1 and 2 and use something like
#define PCI_IOBASE _AC(0xc000000000000000, UL)
#define PCI_IOSIZE SZ_16SM
#define MAP_BASE (PCI_IOBASE + PCI_IOSIZE)
in arch/mips/include/asm/mach-loongson64/spaces.h
That should do the trick without moving stuff around and it will
keep it out of the normal MIPS stuff.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
next prev parent reply other threads:[~2020-05-14 14:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-26 11:47 [PATCH 0/4] MIPS: Loongson64: Use logic_pio Jiaxun Yang
2020-04-26 11:47 ` [PATCH 1/4] MIPS: Massage address spaces headers Jiaxun Yang
2020-04-26 11:47 ` [PATCH 2/4] MIPS: Introduce PCI_IO_VMMAP Jiaxun Yang
2020-04-26 11:47 ` [PATCH 3/4] lib: logic_pio: Introduce MMIO_LOWER_RESERVED Jiaxun Yang
2020-04-27 10:43 ` John Garry
2020-04-27 11:03 ` Jiaxun Yang
2020-04-27 11:54 ` John Garry
2020-04-27 12:21 ` Jiaxun Yang
2020-04-26 11:47 ` [PATCH 4/4] MIPS: Loongson64: Enable PCI_IO_VMMAP Jiaxun Yang
2020-04-30 0:57 ` [PATCH v3 1/3] MIPS: Move VMALLOC_START into spaces.h Jiaxun Yang
2020-04-30 0:57 ` [PATCH v3 2/3] MIPS: Introduce PCI_IO_VMMAP Jiaxun Yang
2020-04-30 0:57 ` [PATCH v3 3/3] MIPS: Loongson64: Enable PCI_IO_VMMAP Jiaxun Yang
2020-05-08 11:44 ` [PATCH RESEND v3 1/3] MIPS: Move VMALLOC_START into spaces.h Jiaxun Yang
2020-05-08 11:44 ` [PATCH RESEND v3 2/3] MIPS: Introduce PCI_IO_VMMAP Jiaxun Yang
2020-05-08 16:11 ` Thomas Bogendoerfer
2020-05-08 16:22 ` Jiaxun Yang
2020-05-08 16:52 ` Thomas Bogendoerfer
2020-05-08 17:09 ` Jiaxun Yang
2020-05-14 14:21 ` Thomas Bogendoerfer [this message]
2020-05-14 14:56 ` Jiaxun Yang
2020-05-14 13:20 ` Jiaxun Yang
2020-05-08 11:44 ` [PATCH RESEND v3 3/3] MIPS: Loongson64: Enable PCI_IO_VMMAP Jiaxun Yang
2021-01-13 18:02 ` logical PIO code for mips question (was Re: [PATCH RESEND v3 3/3] MIPS: Loongson64: Enable PCI_IO_VMMAP) John Garry
2021-01-14 0:13 ` Jiaxun Yang
2021-01-14 9:18 ` John Garry
2021-01-14 11:10 ` Jiaxun Yang
2021-01-14 11:20 ` 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=20200514142149.GA14003@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=chenhc@lemote.com \
--cc=jiaxun.yang@flygoat.com \
--cc=john.garry@huawei.com \
--cc=linux-mips@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 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).