linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Tiwei Bie" <tiwei.btw@antgroup.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>
Cc: "Richard Weinberger" <richard@nod.at>,
	"Anton Ivanov" <anton.ivanov@cambridgegreys.com>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	linux-um@lists.infradead.org, "kernel test robot" <lkp@intel.com>
Subject: Re: [PATCH] um: Turn HAS_IOPORT_MAP off
Date: Wed, 02 Jul 2025 13:09:23 +0200	[thread overview]
Message-ID: <1724be1e-174c-4837-8768-83a90004f7fe@app.fastmail.com> (raw)
In-Reply-To: <c71581d8-350f-4523-862f-5be84358ad8f@antgroup.com>

On Tue, Jul 1, 2025, at 14:22, Tiwei Bie wrote:
> On 2025/7/1 16:43, Arnd Bergmann wrote:
>> On Tue, Jul 1, 2025, at 10:26, Geert Uytterhoeven wrote:
>> --- a/lib/Kconfig
>> +++ b/lib/Kconfig
>> @@ -381,7 +381,7 @@ config HAS_IOPORT
>>  config HAS_IOPORT_MAP
>>         bool
>>         depends on HAS_IOMEM && !NO_IOPORT_MAP
>> -       default y
>> +       default HAS_IOPORT
>>  
>>  source "kernel/dma/Kconfig"
>>  
>> It seems silly to turn off HAS_IOPORT_MAP on platforms that don't
>> have HAS_IOPORT to start with.
>
> I'm not entirely clear on the meaning of HAS_IOPORT though. It looks
> HAS_IOPORT was introduced to support disabling compilation of the I/O
> accessor functions inb()/outb() and friends [1].

Correct

> And looking at the
> code, xtensa supports IOPORT_MAP [2][3], but doesn't select HAS_IOPORT
> (which is also stated in the commit log in [1]).

xtensa selects NO_IOPORT_MAP, which means that HAS_IOPORT_MAP
gets disabled here:

arch/xtensa/Kconfig:config NO_IOPORT_MAP
arch/xtensa/Kconfig-    def_bool n

The NO_IOPORT_MAP symbol is a bit confusing, but I think it
works as intended, at least on xtensa. There are probably
still some platforms that started selecting NO_IOPORT_MAP
because they have no actual I/O port implementation, but
that still need to be updated to not select HAS_IOPORT.

With my patch above, we should probably stop selecting
NO_IOPORT_MAP on platforms that don't also set HAS_IOPORT,
and keep the HAS_IOPORT_MAP/NO_IOPORT_MAP logic around
only for the few cases that cannot abstract inb()/outb()
through ioread8()/iowrite8(), i.e. Arm RiscPC, m68k q40,
etc.

      Arnd


  reply	other threads:[~2025-07-02 12:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-28 16:47 [PATCH] um: Turn HAS_IOPORT_MAP off Tiwei Bie
2025-07-01  8:26 ` Geert Uytterhoeven
2025-07-01  8:43   ` Arnd Bergmann
2025-07-01 12:22     ` Tiwei Bie
2025-07-02 11:09       ` Arnd Bergmann [this message]
2025-07-02 13:02         ` Tiwei Bie
2025-07-02 13:39           ` Arnd Bergmann
2025-07-02 15:02             ` Tiwei Bie

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=1724be1e-174c-4837-8768-83a90004f7fe@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=geert@linux-m68k.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-um@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=richard@nod.at \
    --cc=tiwei.btw@antgroup.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;
as well as URLs for NNTP newsgroup(s).