Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3345971ioa; Tue, 26 Apr 2022 01:43:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlbBz+UJeVWRgvvxyGdw+QpD1xr+eEQ6yfis+OVoPuWwA9m+pT8HLLj43mXEuoUlbvcEab X-Received: by 2002:a17:906:4794:b0:6f3:7569:77fd with SMTP id cw20-20020a170906479400b006f3756977fdmr13813538ejc.266.1650962590987; Tue, 26 Apr 2022 01:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650962590; cv=none; d=google.com; s=arc-20160816; b=DzqMAn+GMMGvWTHueaH3ee6NdD4KMHgf91GdJoMs8HJjtgyT5ccH5SWDgxN8JJmtek +nF9x/pXWjcySigUSObrPjPLcxBNWmK1ENQGsdwq6sekKbkQ30lCzSfKWuLkeOYqU6Yo QgINOS1HqBJtfqw18AFNda/0ELtcftGk1TsmfHwsusiyO2TyufCI3tKWY3IX6PCw990q xtzmYUHS1u6c/R/tNRGDCVp9ln4KTLeAtuYpWvR5qZZJJ95Q6n+0zsrB+3C4cSgEFJap oce6dQa/zbtSqXllJlwq72z1451y33xYGYUgKy9fYiJvxcBhK73O7aeEb+ge8FdfDfG6 y0nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=znozslGjo3s8rSRIbO67vnBfYVSE3m/71+93AYT0A2M=; b=s7KNkYnKp4RMArWG+mK4HQ0HUw0hCyWieUiO9Q/NQVbm8Yq8p6FUTU/0gBXT7FfBbS BQWsNhOMibxyQbfn5ov60j/sYxJtvdSDuG5w0ABXKzwcDoNvqFasNPR9AMfA9rLL/Foz bU3+nIKCyRuNiyDQKXPuK/amJQRWohzr7GqLjooKgpO9BmWrCVXZfszyjR/tTwcCRne5 dN69gqYW0X1XZBJr2IrwJjR7EEcxsQroUgxMs0dTa2Y4p1V65pl0Gb7nKjFjAOSo7R3u g5gSmhj+tLg5UaNz/Ck6ear1xw58HMNWNc1KKf1UnHT9nj2wNXJ1kViXKOc/wLUDY/GE wGgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vn0VqbbQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj4-20020a170906b04400b006df76385ddesi14353869ejb.638.2022.04.26.01.42.46; Tue, 26 Apr 2022 01:43:10 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vn0VqbbQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238117AbiDYLlN (ORCPT + 99 others); Mon, 25 Apr 2022 07:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233145AbiDYLk7 (ORCPT ); Mon, 25 Apr 2022 07:40:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8952611A for ; Mon, 25 Apr 2022 04:37:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 94A08B815FA for ; Mon, 25 Apr 2022 11:37:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D2CAC385A4; Mon, 25 Apr 2022 11:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650886673; bh=oqcziTyHbgjccGI9JX/gmEGkDXbZaGKaCKgkgdQx71I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vn0VqbbQK6rr7q29cSfjgqHcJ77SnH1CCKo/lhC2H36LWEDEpEm14NHMLomloSMiV tTxt7yxXlgZNNL24WJFRkT/7/AzkhPL/dH8qNsVllCE3JYuVR/Jn7FHGUlLb1UFXXR SMo+eglUeiT8JpsdL6jqhpO8xIiWk27fcZZxcOkyOSyMJ8Q64J9t+X5yRK0wvlY3A3 Napgz9q9AMC3iNwTO1NxsLSDa9COFoBK4qC7qxKae/kHHLQzEpSoVha69Hf4prIRSu q4km1oxjwd9rNmwvVpU/ASxsF3/l8yyz7DQBcv8r4k2Nd8FkiVzxYrMNpIhxMWYhaI RJl/d9weBlqBw== Received: by pali.im (Postfix) id CB2494A44; Mon, 25 Apr 2022 13:37:50 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Gleixner , Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] irqchip/armada-370-xp: Do not allow mapping IRQ 0 and 1 Date: Mon, 25 Apr 2022 13:37:06 +0200 Message-Id: <20220425113706.29310-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220425113706.29310-1-pali@kernel.org> References: <20220425113706.29310-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 IRQs 0 and 1 cannot be mapped, they are handled internally by this driver and this driver does not call generic_handle_domain_irq() for these IRQs. So do not allow mapping these IRQs and correctly propagate error from the .irq_map callback. Signed-off-by: Pali Rohár Cc: stable@vger.kernel.org --- drivers/irqchip/irq-armada-370-xp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 1120084cba09..ebd76ea1c69b 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -546,6 +546,10 @@ static struct irq_chip armada_370_xp_irq_chip = { static int armada_370_xp_mpic_irq_map(struct irq_domain *h, unsigned int virq, irq_hw_number_t hw) { + /* IRQs 0 and 1 cannot be mapped, they are handled internally */ + if (hw <= 1) + return -EINVAL; + armada_370_xp_irq_mask(irq_get_irq_data(virq)); if (!is_percpu_irq(hw)) writel(hw, per_cpu_int_base + -- 2.20.1