[PATCH 0/1] tty: Handle HAS_IOPORT dependencies

Niklas Schnelle posted 1 patch 1 year, 10 months ago
drivers/tty/Kconfig                  |  4 +--
drivers/tty/serial/8250/8250_early.c |  4 +++
drivers/tty/serial/8250/8250_pci.c   | 14 ++++++++++
drivers/tty/serial/8250/8250_port.c  | 42 +++++++++++++++++++++++-----
drivers/tty/serial/8250/Kconfig      |  7 ++---
drivers/tty/serial/Kconfig           |  2 +-
6 files changed, 59 insertions(+), 14 deletions(-)
[PATCH 0/1] tty: Handle HAS_IOPORT dependencies
Posted by Niklas Schnelle 1 year, 10 months ago
Hi Greg, Jiri, Ilpo,

This is a follow up in my ongoing effort of making inb()/outb() and
similar I/O port accessors compile-time optional. Previously I sent this
as a treewide series titled "treewide: Remove I/O port accessors for
HAS_IOPORT=n" with the latest being its 5th version[0]. With a significant
subset of patches merged I've changed over to per-subsystem series. These
series are stand alone and should be merged via the relevant tree such
that with all subsystems complete we can follow this up with the final
patch that will make the I/O port accessors compile-time optional.

The current state of the full series with changes to the remaining subsystems
and the aforementioned final patch can be found for your convenience on my
git.kernel.org tree in the has_ioport branch[1]. As for compile-time vs runtime
see Linus' reply to my first attempt[2].

The patch was previously acked[3] by Greg but given this was almost
a year ago and didn't apply then I didn't carry the Ack over. That said
I don't think there were non trivial changes.

Thanks,
Niklas

[0] https://lore.kernel.org/all/20230522105049.1467313-1-schnelle@linux.ibm.com/
[1] https://git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git/log/?h=has_ioport
[2] https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/
[3] https://lore.kernel.org/all/2023053050-prodigal-shine-4d1c@gregkh/

Niklas Schnelle (1):
  tty: serial: handle HAS_IOPORT dependencies

 drivers/tty/Kconfig                  |  4 +--
 drivers/tty/serial/8250/8250_early.c |  4 +++
 drivers/tty/serial/8250/8250_pci.c   | 14 ++++++++++
 drivers/tty/serial/8250/8250_port.c  | 42 +++++++++++++++++++++++-----
 drivers/tty/serial/8250/Kconfig      |  7 ++---
 drivers/tty/serial/Kconfig           |  2 +-
 6 files changed, 59 insertions(+), 14 deletions(-)

-- 
2.40.1
Re: [PATCH 0/1] tty: Handle HAS_IOPORT dependencies
Posted by Andy Shevchenko 1 year, 10 months ago
On Fri, Apr 05, 2024 at 05:29:23PM +0200, Niklas Schnelle wrote:
> Hi Greg, Jiri, Ilpo,
> 
> This is a follow up in my ongoing effort of making inb()/outb() and
> similar I/O port accessors compile-time optional. Previously I sent this
> as a treewide series titled "treewide: Remove I/O port accessors for
> HAS_IOPORT=n" with the latest being its 5th version[0]. With a significant
> subset of patches merged I've changed over to per-subsystem series. These
> series are stand alone and should be merged via the relevant tree such
> that with all subsystems complete we can follow this up with the final
> patch that will make the I/O port accessors compile-time optional.
> 
> The current state of the full series with changes to the remaining subsystems
> and the aforementioned final patch can be found for your convenience on my
> git.kernel.org tree in the has_ioport branch[1]. As for compile-time vs runtime
> see Linus' reply to my first attempt[2].
> 
> The patch was previously acked[3] by Greg but given this was almost
> a year ago and didn't apply then I didn't carry the Ack over. That said
> I don't think there were non trivial changes.

Hmm... Can those drivers simply be converted to use ioreadXX/iowriteXX
instead?

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH 0/1] tty: Handle HAS_IOPORT dependencies
Posted by Arnd Bergmann 1 year, 10 months ago
On Sat, Apr 6, 2024, at 00:33, Andy Shevchenko wrote:
> On Fri, Apr 05, 2024 at 05:29:23PM +0200, Niklas Schnelle wrote:
>> Hi Greg, Jiri, Ilpo,
>> 
>> This is a follow up in my ongoing effort of making inb()/outb() and
>> similar I/O port accessors compile-time optional. Previously I sent this
>> as a treewide series titled "treewide: Remove I/O port accessors for
>> HAS_IOPORT=n" with the latest being its 5th version[0]. With a significant
>> subset of patches merged I've changed over to per-subsystem series. These
>> series are stand alone and should be merged via the relevant tree such
>> that with all subsystems complete we can follow this up with the final
>> patch that will make the I/O port accessors compile-time optional.
>> 
>> The current state of the full series with changes to the remaining subsystems
>> and the aforementioned final patch can be found for your convenience on my
>> git.kernel.org tree in the has_ioport branch[1]. As for compile-time vs runtime
>> see Linus' reply to my first attempt[2].
>> 
>> The patch was previously acked[3] by Greg but given this was almost
>> a year ago and didn't apply then I didn't carry the Ack over. That said
>> I don't think there were non trivial changes.
>
> Hmm... Can those drivers simply be converted to use ioreadXX/iowriteXX
> instead?

Not 8250, for a couple of reasons:

- the irq autoconfig code uses outb_p(), which has no iowrite()
  equivalent
- the driver is used on machines that cannot implement
  ioport_map() because of the nonlinear address translation,
  e.g. certain early alpha and mips machines.
- it still needs its own I/O abstraction layer to deal with
  different-sized registers, so the result would not be any
  more readable even without the other issues.

     Arnd