Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34081972rwd; Sun, 9 Jul 2023 04:59:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlGeLNN18PHXnpZxxLeERXUVCKb49u2CqbScsvydufUGWBKMhJaLeboXbvx4gfemhO2gttIq X-Received: by 2002:a17:906:c1:b0:978:8e58:e1a9 with SMTP id 1-20020a17090600c100b009788e58e1a9mr9290394eji.15.1688903957112; Sun, 09 Jul 2023 04:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688903957; cv=none; d=google.com; s=arc-20160816; b=WiP6VU6xgXeeiaY30CKId02H/9BFk95EC9nKyqrzgRdjoRxb1gmZ04ChsgloUYc4+X opLJ5WwC0xDpCqzv2V0e1NMFZ5z7/a7jNb43M5STHMDbIomC9R2+tqkMxIQdEL+mJRib bh2aGMbNoZA8JzrvK/kWA0WkWF6au7XgvNpnJmsIYPvrGwMMTnDq04MubrYD5xyqbgP8 CchLXL5NPNi8MxyeOgUw20jYmHq2S6vtUpDSTwiHY9C1rmAiFR3H3bIXEt1IA/b/dynr WyFcUWpARjH+9SRcYh1Rb0b8tzCkoUXyGCWpBnlajE41KNC60w54SZutM7xi/JPy/JvA gySg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=VL65xDTax/fOr7TaM3xJ/KvDeUgFgg6mBZScfvSSM7s=; fh=oUXT0WwcpZLviTrQwnNPNfgK4mIHm7pn41x48inutU4=; b=UQ22rvxSuIY0PPAfBMAX4U/1QIn5V04/78E1P7I7LcK8paqwSL0QRmPR5qXh2jsMVK qBHKp8px94WpLiYE9n7G9Sserli8FxV3tdaRkXzHCCU+gS90m9TFCSaGsa/HNprbMDAI qaXk1qjVtiQVu6180p1nTZMuqSGhC2Y/3UsbStIZJR2JA+GC1G/MQZXhd6hx+xcLDaKj Ujpui1u2O8oF6klS69G2elobd2t2/V7IuVNXho/ddCGu9cNShwa3totGWxX/Py8pRsoB Ht6JKGKjz9NVBpki6sp7VhBXIQZkn2ZBlicSMCGczNmSc9nypMGevyeGL1hALfC2TqY2 AgzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f23-20020a170906561700b0099364d9f0e0si6239780ejq.540.2023.07.09.04.58.53; Sun, 09 Jul 2023 04:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233040AbjGILxc convert rfc822-to-8bit (ORCPT + 99 others); Sun, 9 Jul 2023 07:53:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjGILxb (ORCPT ); Sun, 9 Jul 2023 07:53:31 -0400 Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C41C6F9; Sun, 9 Jul 2023 04:53:30 -0700 (PDT) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.95) with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1qISyd-001yBo-Ki; Sun, 09 Jul 2023 13:53:19 +0200 Received: from dynamic-077-191-183-238.77.191.pool.telefonica.de ([77.191.183.238] helo=[192.168.1.11]) by inpost2.zedat.fu-berlin.de (Exim 4.95) with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1qISyd-0016ew-Dc; Sun, 09 Jul 2023 13:53:19 +0200 Message-ID: <58697ba16c0e14aea7337330ae6f03bb35cd76ff.camel@physik.fu-berlin.de> Subject: Re: [PATCH] [RFT] sh: mach-r2d: Handle virq offset in cascaded IRL demux From: John Paul Adrian Glaubitz To: Geert Uytterhoeven , Guenter Roeck , Sergey Shtylyov , Yoshinori Sato , Rich Felker Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 09 Jul 2023 13:53:09 +0200 In-Reply-To: <2c99d5df41c40691f6c407b7b6a040d406bc81ac.1688901306.git.geert+renesas@glider.be> References: <2c99d5df41c40691f6c407b7b6a040d406bc81ac.1688901306.git.geert+renesas@glider.be> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 77.191.183.238 X-ZEDAT-Hint: PO X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert! On Sun, 2023-07-09 at 13:15 +0200, Geert Uytterhoeven wrote: > When booting rts7751r2dplus_defconfig on QEMU, the system hangs due to > an interrupt storm on IRQ 20. IRQ 20 aka event 0x280 is a cascaded IRL > interrupt, which maps to IRQ_VOYAGER, the interrupt used by the Silicon > Motion SM501 multimedia companion chip. As rts7751r2d_irq_demux() does > not take into account the new virq offset, the interrupt is no longer > translated, leading to an unhandled interrupt. > > Fix this by taking into account the virq offset when translating > cascaded IRL interrupts. > > Fixes: a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") > Reported-by: Guenter Roeck > Closes: https://lore.kernel.org/r/fbfea3ad-d327-4ad5-ac9c-648c7ca3fe1f@roeck-us.net > Signed-off-by: Geert Uytterhoeven > --- > Highlander and Dreamcast probably have the same issue. > I'll send patches for these later... > --- > arch/sh/boards/mach-r2d/irq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > 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]; > } > > /* I can also confirm that this fixes the hang on QEMU. Tested-by: John Paul Adrian Glaubitz Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913