[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a3f8b4c-2c0d-28bc-8dcd-c56c7b8a2bb4@landley.net>
Date: Mon, 2 May 2022 15:07:08 -0500
From: Rob Landley <rob@...dley.net>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Sergey Shtylyov <s.shtylyov@....ru>,
Rich Felker <dalias@...c.org>,
Linux-sh list <linux-sh@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v3] sh: avoid using IRQ0 on SH3/4
On 5/2/22 03:37, Geert Uytterhoeven wrote:
> Hi Rob,
...
> Until I tried "ifconfig eth0 up", which causes a lock-up.
> Interestingly, the 8139 irq was 112 with and without Sergey's patch,
> so there must be an irq remapping missing.
Yup, that's it.
> I also test regularly on landisk, where 8139 Ethernet works fine.
> Turns out landisk uses arch/sh/drivers/pci/fixups-landisk.c to fixup
> the irq...
I didn't think the patch was wrong per se, just that something broke when
jiggled. :(
> arch/sh/include/mach-common/mach/r2d.h has:
> #define R2D_FPGA_IRQ_BASE 100
> Subtracting 16 here does not help.
>
> With this (gmail-whitespace-damaged) patch:
>
> --- a/arch/sh/drivers/pci/fixups-rts7751r2d.c
> +++ b/arch/sh/drivers/pci/fixups-rts7751r2d.c
> @@ -31,9 +31,9 @@ static char lboxre2_irq_tab[] = {
> int pcibios_map_platform_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
> {
> if (mach_is_lboxre2())
> - return lboxre2_irq_tab[slot];
> + return lboxre2_irq_tab[slot] - 16;
> else
> - return rts7751r2d_irq_tab[slot];
> + return rts7751r2d_irq_tab[slot] - 16;
> }
>
> int pci_fixup_pcic(struct pci_channel *chan)
>
> it no longer crashes, but ifconfig still fails:
>
> / # ifconfig eth0 up
> ifconfig: ioctl 0x8914 failed: Invalid argument
Sounds like it's now outside of the IRQ range allocation, but I can't find where
that's requested when registering the controller? (What is a "swizzle" anyway?)
I'm looking at kernel/cpu/sh4/setup-sh7750.c but I don't understand why it might
work for landisk but not there. (Bit out of my depth in this plumbing.
Head-scratching at include/linux/sh_intc.h #defining DECLARE_INTC_DESC()... hard
to work backwards to find where this stuff STARTS...)
> Note that there are more implementations of pcibios_map_platform_irq()
> that do not use evt2irq(), and thus are probably broken by this patch.
Yup. Sounds like something could be consolidated. Unfortunately I only have 4
test systems for this platform, only 2 of which are easy to cycle...
> Gr{oetje,eeting}s,
>
> Geert
I can try sticking printk() into this to track it down if you haven't got any
more time to look at it. I don't understand this plumbing very well but "error
return code comes from here, that tested this variable, which was set here..."
is generally a deterministic approach, if glacial.
Rob
Powered by blists - more mailing lists