Re: [PATCH] sh: Avoid using IRQ0 on SH3 and SH4

Guenter Roeck <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.ports.sh.devel
Message-ID <[email protected]>
On 7/7/23 08:19, John Paul Adrian Glaubitz wrote:
> Hi Guenter!
> 
>> On Jul 7, 2023, at 4:35 PM, Guenter Roeck <[email protected]> wrote:
>>
>> On 7/7/23 02:53, John Paul Adrian Glaubitz wrote:
>>> Hi Geert!
>>> On Fri, 2023-07-07 at 10:48 +0200, Geert Uytterhoeven wrote:
>>>>> I can reproduce the issue with rts7751r2dplus_defconfig, but I may
>>>>> not be able to look into it today...
>>>>
>>>> Disabling CONFIG_USB_OHCI_HCD fixes the hang.
>>> I picked rts7751r2dplus_defconfig, disabled CONFIG_USB_OHCI_HCD but it still
>>> hangs for me. Are you sure it's CONFIG_USB_OHCI_HCD and not something else?
>>
>> It seems to be related. With this patch reverted, ohci_irq() gets a single
>> interrupt, and boot continues. With this patch in place, ohci_irq() does
>> not get any interrupts, and boot hangs with qemu at 100% CPU. I confirmed
>> this by disabling CONFIG_MFD_SM501. After that, the hang is no longer seen.
>> Of course, that also means that OHCI and other emulated sm501 functionality
>> no longer works.
>>
>> My suspicion is that something goes wrong with interrupt routing to
>> SM501 and with it to ohci_irq(), but that is just a wild guess.
> 
> Looking at drivers/mfd/sm501.c, sm501_plat_probe() is explicitly requesting IRQ 0 which is no longer supported on SH:
> 
>  > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mfd/sm501.c <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mfd/sm501.c>
> 
> So, we need to shift this by 16, I guess.
> 

It isn't interrupt 0, it is interrupt _index_ 0. See platform_get_irq_optional()
which calls platform_get_resource(dev, IORESOURCE_IRQ, num). There are lots
of calls to platform_get_irq() with index 0 in the kernel.

Guenter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.