From patchwork Mon Apr 25 11:37:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12825614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB00FC433EF for ; Mon, 25 Apr 2022 11:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k9rY5TXEydicSNmr05sObusc8I0DlADCB8ysNP//7hA=; b=irBFD0Uy0By2hK C+tiEfsxeJLRpkGA9UKrZPPywFvlOc/TNr5bs08fY9oYfWsrX9EzHwr8o6TlN0EXVWjUSllP9Kp0V iwy+OE+LWDNVYDvfUHBRidPsJHOs+lmlGL8iX/zabdfeYtckixh+/FxKVU+lRWVpIATSJ5xoNLoJo GvK2IJc6mSYK4XS+YMgjiARNMgH+sZiztUftAzEE7syvC4rz4VA76VsPPEJ7jLeU/vKjfmv0PhCBu EZ5Edn23S2/oZ+7Oa6ZnthqwsbY0mvAbUNqsf7vbGotZBvQ+MCBeVLnlsL4cRD5zFq/RfU+iu63i7 L83N7Pqt/jtSaITWClQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nix2U-009JFT-L6; Mon, 25 Apr 2022 11:37:59 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nix2R-009JE7-27 for linux-arm-kernel@lists.infradead.org; Mon, 25 Apr 2022 11:37:56 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id E33E961244; Mon, 25 Apr 2022 11:37:53 +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_Roh=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220425_043755_268536_F8382B5F X-CRM114-Status: GOOD ( 15.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 +