All of
 help / color / mirror / Atom feed
From: Rob Landley <>
To: John Paul Adrian Glaubitz <>,
	Sergey Shtylyov <>,
	Rich Felker <>,,
Cc: Yoshinori Sato <>,
	Greg Kroah-Hartman <>
Subject: Re: [PATCH v3] sh: avoid using IRQ0 on SH3/4
Date: Sat, 30 Apr 2022 05:30:05 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 4/29/22 09:24, John Paul Adrian Glaubitz wrote:
> Hi Sergey!
> On 4/27/22 20:46, Sergey Shtylyov wrote:
>> Using IRQ0 by the platform devices is going to be disallowed soon (see [1])
>> and even now, when IRQ0 is about to be returned by platfrom_get_irq(), you
>> see a big warning.  The code supporting SH3/4 SoCs maps the IRQ #s starting
>> at 0 -- modify that code to start the IRQ #s from 16 instead.
>> The patch should mostly affect the AP-SH4A-3A/AP-SH4AD-0A boards as they
>> indeed use IRQ0 for the SMSC911x compatible Ethernet chip...
> Maybe try getting it landed through Andrew Morton's tree?

As I told him in IRC, the problem is still that sh4 never gives me a shell
prompt with this patch applied. I just reconfirmed it against current git:

Freeing unused kernel image (initmem) memory: 124K
This architecture does not have kernel memory protection.
Run /init as init process
mountpoint: dev/pts: No such file or directory
8139cp 0000:00:02.0 eth0: link up, 100Mbps, full-duplex, lpa 0x05E1

It makes it partway through the init script, but it hangs with qemu-system-sh4
stuck in a CPU-eating loop before finishing. Without the patch, I get a shell

If you don't want to build the userspace from source with mkroot, the last
release's binary tarball is 4 megs and reproduced the problem just fine. First,
confirm it works as-shipped:

$ wget
$ tar xvf sh4.tgz
$ cd sh4
$ ./
printk: console [netcon0] enabled
netconsole: network logging started
Freeing unused kernel image (initmem) memory: 116K
This architecture does not have kernel memory protection.
Run /init as init process
8139cp 0000:00:02.0 eth0: link up, 100Mbps, full-duplex, lpa 0x05E1
random: fast init done
Type exit when done.
# exit
reboot: Restarting system


Once you've confirmed that works with your qemu-system-sh4 install, replace the
kernel using the config in that directory:

$ git clone ~/linux/linux linux
$ cd linux
$ patch -p1 -i ~/linux/sh4irq.eml
$ CROSS_COMPILE=~/mcm/ccc/sh4-linux-musl-cross/bin/sh4-linux-musl- make \
  ARCH=sh allnoconfig KCONFIG_ALLCONFIG=../miniconfig-sh4
$ CROSS_COMPILE=~/mcm/ccc/sh4-linux-musl-cross/bin/sh4-linux-musl- make \
  ARCH=sh -j $(nproc)
$ cp arch/sh/boot/zImage ..
$ cd ..
$ ./qemu-*.sh

and it hangs without ever saying "random: fast init done" or giving a prompt.

(You could also use the linux-fullconfig file to build your kernel, but you'll
have to say "n" to a bunch of make oldconfig questions.)

> Adrian


  parent reply	other threads:[~2022-04-30 10:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 18:46 [PATCH v3] sh: avoid using IRQ0 on SH3/4 Sergey Shtylyov
2022-04-27 19:24 ` Sergey Shtylyov
2022-04-29 14:24 ` John Paul Adrian Glaubitz
2022-04-29 14:39   ` Greg Kroah-Hartman
2022-04-29 17:16   ` Rich Felker
2022-05-01 17:58     ` Sergey Shtylyov
2022-05-01 18:09       ` Sergey Shtylyov
2022-04-30 10:30   ` Rob Landley [this message]
2022-05-01 10:19     ` John Paul Adrian Glaubitz
2022-05-02  8:37     ` Geert Uytterhoeven
2022-05-02 20:07       ` Rob Landley
2022-05-03  7:02         ` Geert Uytterhoeven
2022-05-03 19:46           ` Maciej W. Rozycki
2022-05-02 20:56       ` Sergey Shtylyov
2022-05-03  6:58         ` Geert Uytterhoeven
2022-05-03 19:33         ` Sergey Shtylyov

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.