Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1489095lql; Tue, 12 Mar 2024 21:35:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyYrn42ZW7gQV8P736sVcNu8QdFaKJZTRSCr5O1rADGRROGbJvddY3YW33cnkjzRGen074idV3KFZK2aUb+aCjIlXw8wz8FJfK44YajQ== X-Google-Smtp-Source: AGHT+IG/m0fuHHjqJyfuDhkQ1T1a08nrzI2iPaivZyRIYeJTRjzpDF7Bz3NwjWUXAszxerycsuW3 X-Received: by 2002:ac8:7fd4:0:b0:42f:30bc:a24a with SMTP id b20-20020ac87fd4000000b0042f30bca24amr14399345qtk.59.1710304515753; Tue, 12 Mar 2024 21:35:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710304515; cv=pass; d=google.com; s=arc-20160816; b=yDHlNj70M1zQ9dVmYPb4NuuJ1vpoGYWMCmEdnp9rOyLAkUO3XzIthshwwr5RFCs3y5 r1ebGRUVGKDG8p5k4NzOZFggv8U0kzEI/xwMvoDi7IVYkr3kkLd0vxx3NocsZx0FVAZS P2z9f9bJMDWnsLERrvmLVLfUC76vVFzmTYEZu+afiWVSmTKPzcaxfBsaHVXvSYuceMoX ObfLVxJzDEJq+CoFsJNDoZO5hrVpyZw/9xEvFFd3mAuw7SBjBvIfXkXkY+j0scryAJ4M Zhky4bW209NRDDJNHHWk8JKrFzSM5XBAj9BXlbPKKY9JhDb2whQP6LtVVfQpbKOhNiFI WZCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=G+ojfhId1+LThxcC+VoZJPeAkhUw8IvP6nZWtFu7M50=; fh=KcU4xcMH7JJ7mTYTEnlF8aOvXleyu8pTF2tRX53VrKE=; b=U0U3QtcbOIeUnemEf8vNFeoUHjx9hmvHBsiz2ciAC39fkUC5qXlcnGbi3IFdmuVasf gNX3s++uW+1dN8XCsHRSXq1K01rViDRal1cQlT2Uxpi2+DwxDZZDYpkJrg8HhRP9rJXz C7uy8Ud5CLqT5QLU+p5TfmtRtRQjGGD1JCO1BhuPX+75ySi+RGx1/lZchodiWEBr046I pk6emhkEzIBycgo+FnybsjUMWOBL916MybMEyxGUCyt+ri0D3RkZmZiRGxCa9tiqqXRR 0+DbPVHpfADKUdAq7N+pZjpC14HAGxHQrgbrCqDh7KSdvPjualhYeOMu/ARnNdSbUL+U YJSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@brainfault-org.20230601.gappssmtp.com header.s=20230601 header.b=LaXzoID2; arc=pass (i=1 dkim=pass dkdomain=brainfault-org.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-101100-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101100-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m12-20020a05622a054c00b0042f33084885si9328686qtx.150.2024.03.12.21.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 21:35:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101100-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20230601.gappssmtp.com header.s=20230601 header.b=LaXzoID2; arc=pass (i=1 dkim=pass dkdomain=brainfault-org.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-101100-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101100-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 30DA71C21837 for ; Wed, 13 Mar 2024 04:35:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00B6310A3E; Wed, 13 Mar 2024 04:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=brainfault-org.20230601.gappssmtp.com header.i=@brainfault-org.20230601.gappssmtp.com header.b="LaXzoID2" Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 759C1BA3F for ; Wed, 13 Mar 2024 04:35:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710304507; cv=none; b=VoceplMsxVYTXlr/TkJnhYkc7itymuRL0KLnbkCMww1vd0Q6rs1bSmwbSkQE3jk7BQay12RnjFIEEiOO1lbEEVlKCqmc1cvIx8M1gm1KM4JXanoMYjIflNjl6GPIOqThGYLD5nbahAKAlGwHDbsFs6VHaQi8I9yAHCLIC1RsS1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710304507; c=relaxed/simple; bh=+DL1Yw3hbujlOsf1drnPbBS2/sr3+wz7snK2f/4Qi3o=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YdhpQuC2H/HPA3AMvwdcgoG6n2dhhC2Q99ricB2uFbKPn9V+nLSGiZp2SBB73g4ueDUvOxlvszgTnT11ay0/ZVogLtqhO77nwbFn/2MBlgs4uzJwTO3bXb2WGYwGHqup3/t5ZnkMp5U60DwRVbqvWvR/UZYfSScXu5UxuiLBdSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=brainfault.org; spf=none smtp.mailfrom=brainfault.org; dkim=pass (2048-bit key) header.d=brainfault-org.20230601.gappssmtp.com header.i=@brainfault-org.20230601.gappssmtp.com header.b=LaXzoID2; arc=none smtp.client-ip=209.85.166.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=brainfault.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=brainfault.org Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-364f791a428so29346905ab.3 for ; Tue, 12 Mar 2024 21:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20230601.gappssmtp.com; s=20230601; t=1710304504; x=1710909304; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G+ojfhId1+LThxcC+VoZJPeAkhUw8IvP6nZWtFu7M50=; b=LaXzoID2bcBTXSoufFozfU3x/6FT2myy66fUKNWwkidfPLRoiTunafqzex9whfrkwS ZJhP0jVCdDiFQC1d21xsvQ9EYAaCdmKGq4ZA5kyCnbNK8ho2agkwzIDy4UC64vlD4+3X TAKBk440L29in9aeHpfZjlIxdf/qjlrJl3/cDZYpjtv+d2X1LON/jSu+MoYf8BPLPRgd QWC0JW8vfAzrP5cufMfxfEFnJdFr11V2eypIwffKg3bFUWRDNzk2vsPOIEhNqk//H+QR HXfyusj7mOUxX2YrsrOv2dzUkv3zn9m7nVIuoQ0j3JX/pTyd4kc4+96gPm6aKcQWQOei BCAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710304504; x=1710909304; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G+ojfhId1+LThxcC+VoZJPeAkhUw8IvP6nZWtFu7M50=; b=sBUz7Lr3HJviDQbIQDtMjHAhG4vY5E9p6FMtPGOFZJVMTlNcQrCDYnFnUsFJPP8nsm DJKyg8bz1ORDtuEKSpWilD4CDhYKEheKUF6uknEwoIGHVzP/n5MEhnbXaiFQZa4gKlml +nWh5mg94cVg6CVWBrt055YZrLW4hwjfWNViNa0/g4j41vmhG6yn9Ou6EAglICXtLJox MV35qloH1QFa/jYJ9cgHt1Zn602AqyUnw5P2Vj2gL3L0vzYga4Qo+UkWM3d4uRLbv2Yr KI4xOPoZ0PUURQraYc6ZSCRjo4J33lwxHI5KAyX2AboLPRD34BNyZw6EjeYYGWiWrskp eMZQ== X-Forwarded-Encrypted: i=1; AJvYcCX1cxoumnkqzadLqiZFIWBDFEJKuLYQdYaEe+SCOPezoWJnrZ1Kdt81EjrB3hkEURBtzdx5fn0JKZRIKKDJZOdDPFgajo7Kd5lShyVF X-Gm-Message-State: AOJu0YxR5yEipCRGWMFcJ0SrpH7V6pkJY2GsrM2Xpg5wkBaVhJFczpuQ t4k9g+XdR/2DfIDYl2rKu/fO8nxXEME24swTxB9O4yxKMdVOFWgVtnoXdKD0XJSUchxj8V7wRSe /9Kq2XNUZHSnaJP05Y4+WKCyoMvCMcbtbPQD+/g== X-Received: by 2002:a05:6e02:11a9:b0:366:4ad5:a066 with SMTP id 9-20020a056e0211a900b003664ad5a066mr7558070ilj.23.1710304504474; Tue, 12 Mar 2024 21:35:04 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240312212813.2323841-1-samuel.holland@sifive.com> In-Reply-To: <20240312212813.2323841-1-samuel.holland@sifive.com> From: Anup Patel Date: Wed, 13 Mar 2024 10:04:52 +0530 Message-ID: Subject: Re: [PATCH] irqchip/riscv-intc: Fix use of AIA IRQs 32-63 on riscv32 To: Samuel Holland Cc: Thomas Gleixner , Albert Ou , Palmer Dabbelt , Paul Walmsley , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 13, 2024 at 2:58=E2=80=AFAM Samuel Holland wrote: > > riscv_intc_custom_base is initialized to BITS_PER_LONG, so the second > check passes even though AIA provides 64 IRQs. Adjust the condition to > only check the custom IRQ range for IRQs outside the standard range, and > adjust the standard range when AIA is available. > > Fixes: bb7921cdea12 ("irqchip/riscv-intc: Add support for RISC-V AIA") > Fixes: e6bd9b966dc8 ("irqchip/riscv-intc: Fix low-level interrupt handler= setup for AIA") > Signed-off-by: Samuel Holland I missed adjusting riscv_intc_nr_irqs in commit e6bd9b966dc8. Thanks for catching. Reviewed-by: Anup Patel Regards, Anup > --- > > drivers/irqchip/irq-riscv-intc.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv= -intc.c > index f87aeab460eb..9e71c4428814 100644 > --- a/drivers/irqchip/irq-riscv-intc.c > +++ b/drivers/irqchip/irq-riscv-intc.c > @@ -149,8 +149,9 @@ static int riscv_intc_domain_alloc(struct irq_domain = *domain, > * Only allow hwirq for which we have corresponding standard or > * custom interrupt enable register. > */ > - if ((hwirq >=3D riscv_intc_nr_irqs && hwirq < riscv_intc_custom_b= ase) || > - (hwirq >=3D riscv_intc_custom_base + riscv_intc_custom_nr_irq= s)) > + if (hwirq >=3D riscv_intc_nr_irqs && > + (hwirq < riscv_intc_custom_base || > + hwirq >=3D riscv_intc_custom_base + riscv_intc_custom_nr_irq= s)) > return -EINVAL; > > for (i =3D 0; i < nr_irqs; i++) { > @@ -183,10 +184,12 @@ static int __init riscv_intc_init_common(struct fwn= ode_handle *fn, struct irq_ch > return -ENXIO; > } > > - if (riscv_isa_extension_available(NULL, SxAIA)) > + if (riscv_isa_extension_available(NULL, SxAIA)) { > + riscv_intc_nr_irqs =3D 64; > rc =3D set_handle_irq(&riscv_intc_aia_irq); > - else > + } else { > rc =3D set_handle_irq(&riscv_intc_irq); > + } > if (rc) { > pr_err("failed to set irq handler\n"); > return rc; > @@ -195,7 +198,7 @@ static int __init riscv_intc_init_common(struct fwnod= e_handle *fn, struct irq_ch > riscv_set_intc_hwnode_fn(riscv_intc_hwnode); > > pr_info("%d local interrupts mapped%s\n", > - riscv_isa_extension_available(NULL, SxAIA) ? 64 : riscv_i= ntc_nr_irqs, > + riscv_intc_nr_irqs, > riscv_isa_extension_available(NULL, SxAIA) ? " using AIA"= : ""); > if (riscv_intc_custom_nr_irqs) > pr_info("%d custom local interrupts mapped\n", riscv_intc= _custom_nr_irqs); > -- > 2.43.1 >