From: Sergei Shtylyov <sergei.shtylyov@gmail.com> To: Arnd Bergmann <arnd@arndb.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>, Rob Herring <robh+dt@kernel.org>, Nicolas Saenz Julienne <nsaenz@kernel.org>, Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>, Chris Brandt <chris.brandt@renesas.com>, Wolfram Sang <wsa+renesas@sang-engineering.com>, Linux I2C <linux-i2c@vger.kernel.org>, linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>, Linux ARM <linux-arm-kernel@lists.infradead.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux-Renesas <linux-renesas-soc@vger.kernel.org>, Prabhakar <prabhakar.csengg@gmail.com>, Linux-sh list <linux-sh@vger.kernel.org> Subject: Re: [PATCH 2/3] i2c: sh_mobile: Use platform_get_irq_optional() to get the interrupt Date: Wed, 9 Feb 2022 19:08:20 +0300 [thread overview] Message-ID: <9a07be5a-914b-cec9-f6bc-8c1b0ecef766@gmail.com> (raw) In-Reply-To: <CAK8P3a0gf6TeK2vZ+u3NZ2VrrvrGUohAPz5WiZ4Mbk5QQg9FFg@mail.gmail.com> On 2/9/22 7:02 PM, Arnd Bergmann wrote: >>>>> since 2009 after 1e1030dccb10 ("sh: nmi_debug support."). On a >>>> >>>> Mhm... this commit changes the SH3 code while SH778x are SH4A, no? >>> >>> This code is shared between both: >>> >>> arch/sh/kernel/cpu/sh4/Makefile:common-y += $(addprefix >>> ../sh3/, entry.o ex.o) >> >> Ah, quite convoluted! :-) >> So you mean thet broke the delivery of EVT 0x200 when mucking with NMI? > > Yes, exactly: If I read this right, the added code: > > + shlr2 r4 > + shlr r4 > + mov r4, r0 ! save vector->jmp table offset for later > + > + shlr2 r4 ! vector to IRQ# conversion > + add #-0x10, r4 > + > + cmp/pz r4 ! is it a valid IRQ? > + bt 10f > > gets the vector (0x200 for this device), shifts it five bits to 0x10, > and subtracts 0x10, > then branches to do_IRQ if the interrupt number is non-zero, otherwise it goes > through the exception_handling_table. The SH4 manual I found on my disk (have it from MontaVista times) tells me cmp/pz sets T if Rn is >= 0, then bt branches if T = 1. So I do think the code is correct. One more thing: the board code for those boards was added in 2011, we can assume it was working back then, right? :-_ > Arnd MBR, Sergey
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@gmail.com> To: Arnd Bergmann <arnd@arndb.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>, Rob Herring <robh+dt@kernel.org>, Nicolas Saenz Julienne <nsaenz@kernel.org>, Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>, Chris Brandt <chris.brandt@renesas.com>, Wolfram Sang <wsa+renesas@sang-engineering.com>, Linux I2C <linux-i2c@vger.kernel.org>, linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>, Linux ARM <linux-arm-kernel@lists.infradead.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux-Renesas <linux-renesas-soc@vger.kernel.org>, Prabhakar <prabhakar.csengg@gmail.com>, Linux-sh list <linux-sh@vger.kernel.org> Subject: Re: [PATCH 2/3] i2c: sh_mobile: Use platform_get_irq_optional() to get the interrupt Date: Wed, 9 Feb 2022 19:08:20 +0300 [thread overview] Message-ID: <9a07be5a-914b-cec9-f6bc-8c1b0ecef766@gmail.com> (raw) In-Reply-To: <CAK8P3a0gf6TeK2vZ+u3NZ2VrrvrGUohAPz5WiZ4Mbk5QQg9FFg@mail.gmail.com> On 2/9/22 7:02 PM, Arnd Bergmann wrote: >>>>> since 2009 after 1e1030dccb10 ("sh: nmi_debug support."). On a >>>> >>>> Mhm... this commit changes the SH3 code while SH778x are SH4A, no? >>> >>> This code is shared between both: >>> >>> arch/sh/kernel/cpu/sh4/Makefile:common-y += $(addprefix >>> ../sh3/, entry.o ex.o) >> >> Ah, quite convoluted! :-) >> So you mean thet broke the delivery of EVT 0x200 when mucking with NMI? > > Yes, exactly: If I read this right, the added code: > > + shlr2 r4 > + shlr r4 > + mov r4, r0 ! save vector->jmp table offset for later > + > + shlr2 r4 ! vector to IRQ# conversion > + add #-0x10, r4 > + > + cmp/pz r4 ! is it a valid IRQ? > + bt 10f > > gets the vector (0x200 for this device), shifts it five bits to 0x10, > and subtracts 0x10, > then branches to do_IRQ if the interrupt number is non-zero, otherwise it goes > through the exception_handling_table. The SH4 manual I found on my disk (have it from MontaVista times) tells me cmp/pz sets T if Rn is >= 0, then bt branches if T = 1. So I do think the code is correct. One more thing: the board code for those boards was added in 2011, we can assume it was working back then, right? :-_ > Arnd MBR, Sergey _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-02-09 16:08 UTC|newest] Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-18 16:52 [PATCH 0/3] i2c/busses: Use platform_get_irq/_optional() variants to fetch IRQ's Lad Prabhakar 2021-12-18 16:52 ` Lad Prabhakar 2021-12-18 16:52 ` [PATCH 1/3] i2c: bcm2835: Use platform_get_irq() to get the interrupt Lad Prabhakar 2021-12-18 16:52 ` Lad Prabhakar 2021-12-18 21:17 ` Florian Fainelli 2021-12-18 21:17 ` Florian Fainelli 2021-12-18 22:44 ` Lad, Prabhakar 2021-12-18 22:44 ` Lad, Prabhakar 2021-12-19 9:52 ` Lad, Prabhakar 2021-12-19 9:52 ` Lad, Prabhakar 2021-12-19 18:21 ` Florian Fainelli 2021-12-19 18:21 ` Florian Fainelli 2021-12-18 16:52 ` [PATCH 2/3] i2c: sh_mobile: Use platform_get_irq_optional() " Lad Prabhakar 2021-12-18 16:52 ` Lad Prabhakar 2021-12-20 10:16 ` Wolfram Sang 2021-12-20 10:16 ` Wolfram Sang 2021-12-20 11:58 ` Lad, Prabhakar 2021-12-20 11:58 ` Lad, Prabhakar 2021-12-20 10:17 ` Geert Uytterhoeven 2021-12-20 10:17 ` Geert Uytterhoeven 2021-12-20 11:53 ` Sergei Shtylyov 2021-12-20 11:53 ` Sergei Shtylyov 2022-02-08 12:31 ` Arnd Bergmann 2022-02-08 12:31 ` Arnd Bergmann 2022-02-09 15:11 ` Sergei Shtylyov 2022-02-09 15:11 ` Sergei Shtylyov 2022-02-09 15:18 ` Arnd Bergmann 2022-02-09 15:18 ` Arnd Bergmann 2022-02-09 15:48 ` Sergei Shtylyov 2022-02-09 15:48 ` Sergei Shtylyov 2022-02-09 16:02 ` Arnd Bergmann 2022-02-09 16:02 ` Arnd Bergmann 2022-02-09 16:08 ` Sergei Shtylyov [this message] 2022-02-09 16:08 ` Sergei Shtylyov 2022-02-09 22:56 ` Arnd Bergmann 2022-02-09 22:56 ` Arnd Bergmann 2022-02-10 8:54 ` Geert Uytterhoeven 2022-02-10 8:54 ` Geert Uytterhoeven 2022-02-10 9:32 ` Geert Uytterhoeven 2022-02-10 9:32 ` Geert Uytterhoeven 2022-02-10 9:46 ` Sergei Shtylyov 2022-02-10 9:46 ` Sergei Shtylyov 2021-12-20 11:55 ` Lad, Prabhakar 2021-12-20 11:55 ` Lad, Prabhakar 2021-12-20 12:54 ` Geert Uytterhoeven 2021-12-20 12:54 ` Geert Uytterhoeven 2021-12-20 13:00 ` Lad, Prabhakar 2021-12-20 13:00 ` Lad, Prabhakar 2021-12-18 16:52 ` [PATCH 3/3] i2c: riic: Use platform_get_irq() " Lad Prabhakar 2021-12-18 16:52 ` Lad Prabhakar 2021-12-20 10:16 ` Wolfram Sang 2021-12-20 10:16 ` Wolfram Sang 2021-12-20 10:20 ` Geert Uytterhoeven 2021-12-20 10:20 ` Geert Uytterhoeven
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=9a07be5a-914b-cec9-f6bc-8c1b0ecef766@gmail.com \ --to=sergei.shtylyov@gmail.com \ --cc=arnd@arndb.de \ --cc=bcm-kernel-feedback-list@broadcom.com \ --cc=chris.brandt@renesas.com \ --cc=f.fainelli@gmail.com \ --cc=geert@linux-m68k.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-i2c@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-renesas-soc@vger.kernel.org \ --cc=linux-rpi-kernel@lists.infradead.org \ --cc=linux-sh@vger.kernel.org \ --cc=nsaenz@kernel.org \ --cc=prabhakar.csengg@gmail.com \ --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \ --cc=rjui@broadcom.com \ --cc=robh+dt@kernel.org \ --cc=sbranden@broadcom.com \ --cc=wsa+renesas@sang-engineering.com \ /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: linkBe 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.