mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@kernel.org>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Niklas Schnelle" <schnelle@linux.ibm.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-serial@vger.kernel.org,
	"Heiko Carstens" <hca@linux.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] tty: serial: handle HAS_IOPORT dependencies
Date: Fri, 04 Oct 2024 06:53:51 +0000	[thread overview]
Message-ID: <b59d81ee-04af-4557-9d35-ec2c03fbcbe7@app.fastmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2410022305040.45128@angie.orcam.me.uk>

On Wed, Oct 2, 2024, at 22:59, Maciej W. Rozycki wrote:
> On Wed, 2 Oct 2024, Arnd Bergmann wrote:
>> Part of the problem that Niklas is trying to solve with the
>> CONFIG_HAS_IOPORT annotations is to prevent an invalid inb()/outb()
>> from turning into a NULL pointer dereference as it currently does
>> on architectures that have no way to support PIO but get the
>> default implementation from asm-generic/io.h.
>
>  It can be worse than that.  Part of my confusion with the defxx driver 
> trying to do port I/O with my POWER9 system came from the mapping actually 
> resulting in non-NULL invalid pointers, dereferencing which caused a flood 
> of obscure messages produced to the system console by the system firmware:
>
> LPC[000]: Got SYNC no-response error. Error address reg: 0xd0010014
> IPMI: dropping non severe PEL event
> LPC[000]: Got SYNC no-response error. Error address reg: 0xd0010014
> IPMI: dropping non severe PEL event
> LPC[000]: Got SYNC no-response error. Error address reg: 0xd0010014
> IPMI: dropping non severe PEL event
> LPC[000]: Got SYNC no-response error. Error address reg: 0xd0010014
> IPMI: dropping non severe PEL event
> [...]
>
> from which it was all but obvious that they were caused by an attempt to 
> use PCI port I/O with a system lacking support for it.

Ah, that's too bad. I think this is a result of the patch that
Michael did to shut up the NULL pointer warning we get, see
be140f1732b5 ("powerpc/64: Set _IO_BASE to POISON_POINTER_DELTA
not 0 for CONFIG_PCI=n"). I really wish we could have finished
Niklas' series earlier to avoid this.

>> I think that anyone using hardware that relies on port I/O on
>> non-x86 is at this point going to have a reasonable understanding
>> of the system, so I'm not too worried here. ;-)
>
>  Well, virtually all non-x86 systems continue supporting PCI/e port I/O 
> via a suitably decoded CPU-side MMIO window, so I think coming across one 
> that doesn't can still be a nasty surprise even in 2024.  For instance 
> I've been happily using a PC parallel port PCIe option card, one of the 
> very few interfaces if not the only one remaining that have not ever seen 
> an MMIO variant, with my RISC-V hardware, newer than said POWER9 system.
>
>  So far it's been the s390 and a couple of POWER system implementations 
> that have support for PCI/e port I/O removed.  Have I missed anything?

I meant PCIe cards with I/O space here, not host bridges. I know you
have a lot of them, but what I've heard from Arm platform maintainers
is that they tend to struggle finding any PCIe cards to test their
hsot bridge drivers on, and I expect that a lot of them are actually
broken because they have never been tested and just copied the
implementation badly from some other driver.

I think the only new PCIe devices you can find today that still use
I/O space are ones with compatibility registers for IBM PC style
hardware (vga, uart, parport), but most users would never have used
one of those and instead use the native register interface of their
GPU (on non-x86), USB-serial and no parport. Other devices that
needed I/O space never worked on PCIe anyway because of the lack
of ISA style DMA.

There are also a lot of Arm systems that have no I/O space support at
all, such as the Apple M2 I'm using at the moment.

      Arnd

  reply	other threads:[~2024-10-04  6:54 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 15:29 [PATCH 0/1] tty: Handle " Niklas Schnelle
2024-04-05 15:29 ` [PATCH 1/1] tty: serial: handle " Niklas Schnelle
2024-04-08  9:54   ` Ilpo Järvinen
2024-04-08 10:17     ` Arnd Bergmann
2024-04-08 10:25       ` Ilpo Järvinen
2024-10-01  9:04       ` Niklas Schnelle
2024-04-08 15:35     ` Niklas Schnelle
2024-04-08 15:41       ` Ilpo Järvinen
2024-04-08 15:50         ` Arnd Bergmann
2024-05-23  2:11   ` Maciej W. Rozycki
2024-10-01 11:21     ` Niklas Schnelle
2024-10-01 15:31       ` Arnd Bergmann
2024-10-01 16:41       ` Maciej W. Rozycki
2024-10-02 12:44         ` Niklas Schnelle
2024-10-02 18:12           ` Maciej W. Rozycki
2024-10-02 22:00             ` Arnd Bergmann
2024-10-02 22:59               ` Maciej W. Rozycki
2024-10-04  6:53                 ` Arnd Bergmann [this message]
2024-10-04 16:24                   ` Maciej W. Rozycki
2024-10-04 16:57                     ` Arnd Bergmann
2024-10-04 10:09                 ` Niklas Schnelle
2024-10-04 12:48                   ` Arnd Bergmann
2024-10-04 16:03                     ` Niklas Schnelle
2024-10-04 14:44                   ` Niklas Schnelle
2024-10-04 16:34                   ` Maciej W. Rozycki
2024-11-22 15:18   ` Guenter Roeck
2024-11-22 15:35     ` Niklas Schnelle
2024-11-22 16:31       ` Arnd Bergmann
2024-11-22 17:22         ` Guenter Roeck
2024-11-22 19:24           ` Arnd Bergmann
2024-11-22 20:44             ` Guenter Roeck
2024-11-22 22:51               ` Arnd Bergmann
2024-11-23  2:14                 ` Guenter Roeck
2024-11-25  7:55             ` Andy Shevchenko
2024-11-25  9:53               ` Arnd Bergmann
2024-11-25 10:33                 ` Andy Shevchenko
2024-11-25 11:06                   ` Arnd Bergmann
2024-11-25 11:26                     ` Andy Shevchenko
2024-11-25 13:50                       ` Arnd Bergmann
2024-11-25 15:42                         ` Andy Shevchenko
2024-11-25 16:54                         ` Maciej W. Rozycki
2024-11-25 17:54                           ` Arnd Bergmann
2024-11-25 18:42                             ` Maciej W. Rozycki
2024-12-04 18:51                             ` Guenter Roeck
2024-11-25 15:59                     ` Arnd Bergmann
2024-12-04 21:09                       ` Guenter Roeck
2024-12-04 22:17                         ` Arnd Bergmann
2024-12-04 22:44                           ` Guenter Roeck
2024-12-05  7:08                             ` Arnd Bergmann
2024-12-05 14:31                               ` Guenter Roeck
2024-12-06 15:44                           ` Andy Shevchenko
2024-12-06 16:02                             ` Arnd Bergmann
2025-01-16 12:26                               ` Andy Shevchenko
2024-11-22 17:07       ` Guenter Roeck
2024-11-22 23:27         ` Niklas Schnelle
2024-11-22 23:34         ` Niklas Schnelle
2024-11-23  9:21           ` Arnd Bergmann
2024-04-05 22:33 ` [PATCH 0/1] tty: Handle " Andy Shevchenko
2024-04-06  8:06   ` Arnd Bergmann

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=b59d81ee-04af-4557-9d35-ec2c03fbcbe7@app.fastmail.com \
    --to=arnd@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hca@linux.ibm.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=schnelle@linux.ibm.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®