Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34080329rwd; Sun, 9 Jul 2023 04:56:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZ/RPBlRBsg+Y8HePKOtfU5mfqpvowzhtZzWz8gKLOdyheLIRHuVzar4+Sj2QAftP9kU4o X-Received: by 2002:a05:6a20:8e13:b0:123:4ffe:4018 with SMTP id y19-20020a056a208e1300b001234ffe4018mr12443434pzj.60.1688903816655; Sun, 09 Jul 2023 04:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688903816; cv=none; d=google.com; s=arc-20160816; b=AtMnjNm0tQJqqhz6ud1hY931pWnx/ybOpkDomocJCMz0efwTYielJFViRnm8Lt53oU XWyT63ZjzpzwNGpRy5zwDBz0I3ezNsMMFnRbndLJ+2NLaom8vwO27xkQ1IPqWp5Az3ga o4n50g3oU1evZL2Bn1n+LrVB+SLo2u3m6re8crsCo+ZEuNl5D9xqSbB2l+oJXz3GRgCI c0vGTrP0pDRxY3MKUBM2PrDEVqg5UzDY4EqzpX+ENEOKygVeG1xt92gg3oqnmcsS1lsA DypJyG9tZOjIOjF6P1GVR/ef9d+Cyw91aHp79WVEVXbxX8cucd5kBp4D9zgzB7W8bH5B eYnw== 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=OIdkZ3kTk+JhdBlF9pCoQzddfxKeuqaiq0au+b8NONo=; fh=oUXT0WwcpZLviTrQwnNPNfgK4mIHm7pn41x48inutU4=; b=YYko9pya10OkMsqGdEM9uMJ9GUMmkOfzQLUVHu+5v79tdRpZXPAx0eczHZ9a8DMxfu KnD9c5/kbFvBMgCbZwndsBoQ1nx8hXHJFwMarzd4Och6MjbGQLG4T/tvfqpTtLzrMi2c hcYw5dlqahdgeLNwkgbgTIWA8l6tFhtRsArrxje330hcx5bVLMLvCaIrWTjXk19VDW4P ZKf/lLEbEfAt0s/Ellb+5q91yEXWTQQ7uuR2Ix3E8WgTFfS1Wf6D6Q4dMgaPiv2AmGHc Gk+yXFz0L0JH+1n4hqdKm76OcCBEGB6qB/9LNfNq/8f6beveWEl1AkS9raXjaFWVZSBX 9Bmg== 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 s11-20020a63450b000000b0055aff745fe2si1368349pga.406.2023.07.09.04.56.45; Sun, 09 Jul 2023 04:56:56 -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 S233024AbjGILw4 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 9 Jul 2023 07:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbjGILwz (ORCPT ); Sun, 9 Jul 2023 07:52:55 -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 62363DB; Sun, 9 Jul 2023 04:52:54 -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 1qISxz-001xzw-0W; Sun, 09 Jul 2023 13:52:39 +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 1qISxy-0016ZT-Ph; Sun, 09 Jul 2023 13:52:38 +0200 Message-ID: <3f1a79cb42c1518ca18cc72a21f3b58974fff96d.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:52:29 +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]; > } > > /* Funny, this is actually almost what I did myself when trying to fix this issue. Only difference was that I applied the offset of 16 only to one of the instances at a time and it never occurred to me that it needs to be applied to all instances. Thanks for fixing this! Reviewed-by: John Paul Adrian Glaubitz Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913