[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200427202129.34f8807e@flygoat-x1e>
Date: Mon, 27 Apr 2020 20:21:29 +0800
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: John Garry <john.garry@...wei.com>
Cc: Arnd Bergmann <arnd@...db.de>, Bjorn Helgaas <bhelgaas@...gle.com>,
<linux-mips@...r.kernel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Huacai Chen <chenhc@...ote.com>,
Paul Burton <paulburton@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Kitt <steve@....org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Serge Semin <fancer.lancer@...il.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Daniel Silsby <dansilsby@...il.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Paul Cercueil <paul@...pouillou.net>,
Mark Tomlinson <mark.tomlinson@...iedtelesis.co.nz>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Allison Randal <allison@...utok.net>,
Tiezhu Yang <yangtiezhu@...ngson.cn>,
Wei Xu <xuwei5@...ilicon.com>, <linux-kernel@...r.kernel.org>,
Linuxarm <linuxarm@...wei.com>, Rob Herring <robh@...nel.org>,
linux-arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 3/4] lib: logic_pio: Introduce MMIO_LOWER_RESERVED
On Mon, 27 Apr 2020 12:54:06 +0100
John Garry <john.garry@...wei.com> wrote:
> On 27/04/2020 12:03, Jiaxun Yang wrote:
> >
> >
> > 于 2020年4月27日 GMT+08:00 下午6:43:09, John Garry
> > <john.garry@...wei.com> 写到:
> >> On 26/04/2020 12:47, Jiaxun Yang wrote:
> >>> That would allow platforms reserve some lower address in PIO MMIO
> >>> range to deal with legacy drivers with hardcoded I/O ports that
> >>> can't be managed by logic_pio.
> >>
> >> Hi,
> >>
> >> Is there some reason why the logic_pio code cannot be improved to
> >> handle these devices at these "fixed" addresses? Or do you have a
> >> plan to improve it? We already support fixed bus address devices
> >> in the INDIRECT IO region.
> >
> > Hi,
> >
> > The issue about "Fixed Address" is we can't control the ioport
> > That driver used to operate devices.
> > So any attempt to resolve it in logic_pio seems impossible.
> >
> > Currently we have i8259, i8042, piix4_smbus, mc146818 rely on this
> > assumption.
>
> Right, and from glancing at a couple of drivers you mentioned, if we
> were to register a logic pio region for that legacy region, there
> does not seem to be an easy place to fixup to use logic pio addresses
> (for those devices). They use hardcoded values. However if all those
> drivers were mips specific, you could fixup those drivers to use
> logic_pio addresses today through some macro. But not sure on that.
>
Well, most of these drivers are shared with x86 so....
I guess the conversion needs two or more release cycles.
>
> So, going back to your change, I have a dilemma wondering whether you
> should still register a logic pio region for the legacy region
> instead of the carveout reservation, but ensure it is the first
> region registered, such that logic pio address base is 0 and no
> translation is required. At least then you have a region registered
> and it shows in /proc/ioports, but then this whole thing becomes a
> bit fragile.
Thanks for your solution. So I must register this range as early as
possible. As IRQ is the first subsystem using ISA, I'll do it before
IRQ init, just at the place I setup iormap for reserved region now.
Should be early enough to avoid any collision, as the only logic_pio
user on our system is PCI controller.
Thanks.
>
--
Jiaxun Yang
Powered by blists - more mailing lists