From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 240DE606A32F for ; Fri, 4 Dec 2026 05:05:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=2H4QARSc; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=LfF7fDlJ; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=ZdREAGdZ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=9WAKaPgV3HstjC1wejBfvu9av6CFNEFlO5U7+itqUy8=; b=2H4QARScTCpCJG Xp4+xukbDXrEDJFEJXjLypNpX0s++KFSeEec8xgbqT7qaJtiIk43MfRceAh7yLxiCa/zqcz4TnlPi pb84ZCp6p+ULCgTHvN6SYp/WpbWmyhDX4aeYUQU6YywqvPzgh2dXulX8iVnvhKxFGUiUxsALqGyUM 3NVM4HQHbeuAbdFMtlFQy8wSplSrgrCv3LZnOLc+gpR9nXxZNbqT3CEQdKt7ooRfm+s6exFzo60tZ P5J17WGnD6H7A3f+arNZa4w7gGZgd18Fda9WscclyKQsSJwEWUdSgidWQWDqDvU8qhNqnMFSPPzf+ AVl/SyCBYeeK1CMzIDFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZLUF-0000000GgAo-2llt; Fri, 04 Dec 2026 05:05:35 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZLTj-0000000Gg71-2ZZM for linux-arm-kernel@bombadil.infradead.org; Fri, 04 Dec 2026 05:05:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description; bh=9WAKaPgV3HstjC1wejBfvu9av6CFNEFlO5U7+itqUy8=; b=LfF7fDlJWsB7RyHu2p9RjapEuy ACOnlsOeV9P6hPbeYmziDa4FdNawQMsXA/iBDOJFSoDbrWBtD/YkNnZJaUKqqsNjGEjb1yabEr/+u gdu9HtKNagRdxk/reZOMWbnXLST4TSQaA+LdXJVN2KOw5VqQp7bnNTizFsN32Qmz91Jt9yBC75rew jqx1zmZwl3Kxc0Uoog8emghGREF4zOF8N6Ycmmu6DCQCTOHhZP7dYzAbAgIFm1G1p38kIurT3V8kE UnJgB6xSFq7NtaBslfkAfjrRrqZijPfXLvDZCokzagh200hkemteP4NRksiZdMUIKss6BhnhgZvVb fSEjdJQA==; Received: from linux.microsoft.com ([13.77.154.182]) by desiato.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZLTg-0000000Dzgn-18sl for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2026 05:05:02 +0000 Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id D372A20B716A; Thu, 3 Dec 2026 21:04:54 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com D372A20B716A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1796360694; bh=9WAKaPgV3HstjC1wejBfvu9av6CFNEFlO5U7+itqUy8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZdREAGdZH09p/oAv4igI/PdvKwiyHHLRZMU1WL2IErrOIDytyadP8iB0HzKwGWnsJ qRJLChkIdtvQSX42+xaqFhNOjShmSzBJ+brr1NfWCjYnY0IiNpWepEdcQdg/fwAutK OVl7Fy1SB40w7p2Lt87hZm2uFg5joNMahQb7yBls= From: Prasanna Kumar T S M To: ptsm@linux.microsoft.com, jassisinghbrar@gmail.com, michal.simek@amd.com, tanmay.shah@amd.com, saeed.nowshadi@amd.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ssengar@linux.microsoft.com, tgopinath@linux.microsoft.com, srivatsa@csail.mit.edu, jay.buddhabhatti@amd.com, gregkh@linuxfoundation.org, radheys@amd.com Subject: [PATCH v3 2/5] mailbox: zynqmp-ipi: Fix SGI cleanup on request_percpu_irq() failure Date: Thu, 3 Dec 2026 21:04:50 -0800 Message-ID: <20261204050453.18005-3-ptsm@linux.microsoft.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20261204050453.18005-1-ptsm@linux.microsoft.com> References: <20261204050453.18005-1-ptsm@linux.microsoft.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-19.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_050500_620367_8C4287B3 X-CRM114-Status: GOOD ( 11.72 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" When xlnx_mbox_init_sgi() fails before or during request_percpu_irq(), zynqmp_ipi_probe() still invokes xlnx_mbox_cleanup_sgi() through zynqmp_ipi_free_mboxes(). This causes cleanup to run on an unmapped virq_sgi or dispose the IRQ mapping a second time. Clear virq_sgi after disposing the mapping on request_percpu_irq() failure and teardown IRQ in xlnx_mbox_cleanup_sgi() only when virq_sgi is valid. Fixes: 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI") Cc: stable@vger.kernel.org Signed-off-by: Prasanna Kumar T S M --- drivers/mailbox/zynqmp-ipi-mailbox.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index 179f361d04b3..b978f4e9f830 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -859,6 +859,7 @@ static int xlnx_mbox_init_sgi(struct platform_device *pdev, WARN_ON(ret); if (ret) { irq_dispose_mapping(pdata->virq_sgi); + pdata->virq_sgi = 0; return ret; } @@ -880,11 +881,13 @@ static void xlnx_mbox_cleanup_sgi(struct zynqmp_ipi_pdata *pdata) if (pdata->hp_state >= CPUHP_AP_ONLINE_DYN) cpuhp_remove_state(pdata->hp_state); - on_each_cpu(xlnx_disable_percpu_irq, NULL, 1); + if (pdata->virq_sgi) { + on_each_cpu(xlnx_disable_percpu_irq, NULL, 1); - irq_clear_status_flags(pdata->virq_sgi, IRQ_PER_CPU); - free_percpu_irq(pdata->virq_sgi, &per_cpu_pdata); - irq_dispose_mapping(pdata->virq_sgi); + irq_clear_status_flags(pdata->virq_sgi, IRQ_PER_CPU); + free_percpu_irq(pdata->virq_sgi, &per_cpu_pdata); + irq_dispose_mapping(pdata->virq_sgi); + } } /** -- 2.49.0