From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Guenter Roeck <linux@roeck-us.net>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>
Cc: <linux-sh@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [RFT] sh: mach-r2d: Handle virq offset in cascaded IRL demux
Date: Sun, 9 Jul 2023 15:50:48 +0300 [thread overview]
Message-ID: <ef715abc-6be4-6473-15a1-05069b23bdc1@omp.ru> (raw)
In-Reply-To: <d92853f1a37158d37fefcc84b59efae9b0fb903b.camel@physik.fu-berlin.de>
On 7/9/23 2:58 PM, John Paul Adrian Glaubitz wrote:
[...]
>> diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
>> index e34f81e9ae813b8d..c37b40398c5bc83e 100644
>> --- a/arch/sh/boards/mach-r2d/irq.c
>> +++ b/arch/sh/boards/mach-r2d/irq.c
>> @@ -117,10 +117,10 @@ static unsigned char irl2irq[R2D_NR_IRL];
>>
>> int rts7751r2d_irq_demux(int irq)
>> {
>> - if (irq >= R2D_NR_IRL || irq < 0 || !irl2irq[irq])
>> + if (irq >= 16 + R2D_NR_IRL || irq < 16 || !irl2irq[irq - 16])
>> return irq;
>>
>> - return irl2irq[irq];
>> + return irl2irq[irq - 16];
>> }
>>
>> /*
>
> Btw, I think this needs to be adjusted to test for "ret <= 0" since IRQs cannot
> be zero anymore, correct?
>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mfd/sm501.c#n1389
No, just ignore IRQ0 from now on, it can't be returned. Else you'd just complicate
your code as you'd have to add a separate check for IRQ0 in order to return -EINVAL
in this case (you can't return 0 from probe in case of ret == 0 as that would mean
successful probe when it's not). My patch to platfrom_get_irq() ensures that IRQ0
check in its users is never needed, in order to avoid the (badly scaling) checks)...
> Adrian
MBR, Sergey
next prev parent reply other threads:[~2023-07-09 12:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-09 11:15 Geert Uytterhoeven
2023-07-09 11:52 ` John Paul Adrian Glaubitz
2023-07-09 11:53 ` John Paul Adrian Glaubitz
2023-07-09 11:58 ` John Paul Adrian Glaubitz
2023-07-09 12:50 ` Sergey Shtylyov [this message]
2023-07-09 13:51 ` Guenter Roeck
2023-07-10 1:13 ` Guenter Roeck
2023-07-10 7:03 ` Geert Uytterhoeven
2023-07-10 7:44 ` John Paul Adrian Glaubitz
2023-07-10 7:54 ` Geert Uytterhoeven
2023-07-10 7:57 ` John Paul Adrian Glaubitz
2023-07-10 8:18 ` Geert Uytterhoeven
2023-07-10 8:20 ` John Paul Adrian Glaubitz
2023-07-10 8:25 ` Geert Uytterhoeven
2023-07-10 7:23 ` John Paul Adrian Glaubitz
2023-07-13 6:54 ` John Paul Adrian Glaubitz
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=ef715abc-6be4-6473-15a1-05069b23bdc1@omp.ru \
--to=s.shtylyov@omp.ru \
--cc=dalias@libc.org \
--cc=geert+renesas@glider.be \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=ysato@users.sourceforge.jp \
/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
all inboxes | Powered by JetHome®