Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Mateusz Jończyk" <mat.jonczyk@o2.pl>,
	"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>,
	linux-kernel@vger.kernel.org, "Baoquan He" <bhe@redhat.com>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	regressions@lists.linux.dev
Subject: Re: [REGRESSION] mipsel: no RTC CMOS on the Malta platform in QEMU
Date: Tue, 14 Jan 2025 18:04:02 +0100	[thread overview]
Message-ID: <13d0c3f1-7e6b-4f25-ae00-9e41a15ec36c@app.fastmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2501141605550.50458@angie.orcam.me.uk>

On Tue, Jan 14, 2025, at 17:11, Maciej W. Rozycki wrote:
> On Tue, 14 Jan 2025, Arnd Bergmann wrote:
>> >> A quick fix would be #undef PCI_IOBASE in arch/mips/include/asm/io.h
>> >> just after including #include <asm-generic/io.h>, with ralink and loongson64
>> >> as exception.
>> >
>> > Shouldn't arch/mips/include/asm/io.h do
>> >
>> >     #define PCI_IOBASE mips_io_port_base
>> >
>> > unconditionally, _before_ including  <asm-generic/io.h>?
>> 
>> Yes, I think this would make the most sense, but the ordering
>> with the PCI initialization needs to be done carefully,
>> to ensure that PCI_IOBASE has its final value before the first
>> call to pci_remap_iospace().
>
>  Is defining PCI_IOBASE going to do the right thing for non-PCI MIPS 
> platforms, or should the definition be #ifdef CONFIG_PCI rather than 
> unconditional?  FWIW I think all PCI MIPS platforms support port I/O.

PCI_IOBASE should be defined whenever CONFIG_HAS_IOPORT is set.
Ideally that should allow using the generic inb/outb and
ioread/iowrite helpers from include/asm-generic/io.h, but
unfortunately those don't support the address swizzling required
on SGI and Octeon platforms.

These platforms look like they currently set a NULL pointer
as the I/O port base:

arch/mips/alchemy/common/setup.c:       set_io_port_base(0);
arch/mips/ath79/setup.c:        set_io_port_base(KSEG1);
arch/mips/bcm63xx/setup.c:      set_io_port_base(0);
arch/mips/bmips/setup.c:        set_io_port_base(0);
arch/mips/lantiq/prom.c:        set_io_port_base((unsigned long) KSEG1);

At least some of these, possibly all, also have a PCI or PCMCIA
host controller driver that sets a different value later
when that bus is probed.

I don't see any I/O space getting set up for ath25, dec, ingenic,
loongson32, pic32, eyeq, nintendo64, and realtek-rtl. It looks to
me like any I/O port access on these turns into a misaligned NULL
pointer dereference, but there is a good chance I'm missing how
it gets set up there.

       Arnd.

  reply	other threads:[~2025-01-14 17:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13 22:16 [REGRESSION] mipsel: no RTC CMOS on the Malta platform in QEMU Mateusz Jończyk
2025-01-13 23:29 ` Jiaxun Yang
2025-01-14  7:01   ` Arnd Bergmann
2025-01-14  8:02   ` Geert Uytterhoeven
2025-01-14  9:59     ` Arnd Bergmann
2025-01-14 10:22       ` Jiaxun Yang
2025-01-14 16:11       ` Maciej W. Rozycki
2025-01-14 17:04         ` Arnd Bergmann [this message]
2025-01-14 19:10           ` Maciej W. Rozycki
2025-01-15  8:15             ` Arnd Bergmann
2025-01-14 17:56         ` Jiaxun Yang
2025-01-14 10:09     ` Jiaxun Yang
2025-01-14 10:30       ` 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=13d0c3f1-7e6b-4f25-ae00-9e41a15ec36c@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bhe@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=mat.jonczyk@o2.pl \
    --cc=regressions@lists.linux.dev \
    --cc=tsbogend@alpha.franken.de \
    /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