From mboxrd@z Thu Jan 1 00:00:00 1970 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 14EFEE7716D for ; Thu, 5 Dec 2024 16:44:37 +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=C8Hh/ZxlghNFOdyWr2Qx40F7lfuy19FluYjn0mwGBNY=; b=1CnvqivbUzviIc qrTD896ZKLMN0FsYaqJ5YXmfYs/IDOxCTLTS2v/OhBbiC7I9ZMOSsdsj9qIMcpNT83fPB427zrxbY 2WHlaoG2q8jD0HqaNt/ywcFXMOKAV7FZ/r6VmVbwekd9eOMCdrNJaLXpzK2I3exDDlv3uVk9pnW92 Sv+kDPeDRyyR71vpah9XscCgSu1MCM1Mj+v5p0QCXOco4OH9h1/dEHhtPJxHB7d3hNMLYWt7znVK7 Qu7rI3J3oJOKA3/ACfaMQ4Hev/AWZWSQ0h9dR/8DuK2E+Bb+3tAhqVOyne0R+DN2I7g8rUBKC3/4+ CEfkxet5KcImLrZMCoTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJExw-0000000GnNJ-3UVG; Thu, 05 Dec 2024 16:44:36 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tIsuV-0000000DIuk-2YG3 for linux-i3c@lists.infradead.org; Wed, 04 Dec 2024 17:11:36 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 374D35C5649; Wed, 4 Dec 2024 17:10:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18BD4C4CECD; Wed, 4 Dec 2024 17:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733332294; bh=W/y8zXZkHB6ZxAKXAe+UMRSHimjoR/7RwfdqEpMrYMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YJFDG2YkiOjqwWF8hYSlozCkbw57pw18u5JZovElrkrtQ81J5vTCQX7tCrA7YWzoM kSNIqRLH6dMbpsTBfn/SLd0EMYsbeiaUnzd5u59YQGP2Qc0pa8UFyLk7Fu3m69GCtj 0zL6v2jykiHuKoBG6U3I5tb/sXrqfHBBi60rdGjEBzvHvZyERIGLbuRSWMQ2ZEtQZa wo1yrjwYVirb08BvGcJF2iC95mv67eFLhMBWt0Y/IoUELfUmFaWVToOsuLn/ww4mps JVxnpCP2k6kr2pOW+1n64uhKSyDICK75j0xflC9iDwYeAY18DZZssv3CDcvGUXGucW Ci61SMoXk8w4A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jarkko Nikula , Alexandre Belloni , Sasha Levin , linux-i3c@lists.infradead.org Subject: [PATCH AUTOSEL 6.12 03/15] i3c: mipi-i3c-hci: Mask ring interrupts before ring stop request Date: Wed, 4 Dec 2024 10:59:51 -0500 Message-ID: <20241204160010.2216008-3-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241204160010.2216008-1-sashal@kernel.org> References: <20241204160010.2216008-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241204_091135_695889_395974C3 X-CRM114-Status: GOOD ( 12.03 ) X-Mailman-Approved-At: Thu, 05 Dec 2024 08:44:11 -0800 X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org From: Jarkko Nikula [ Upstream commit 6ca2738174e4ee44edb2ab2d86ce74f015a0cc32 ] Bus cleanup path in DMA mode may trigger a RING_OP_STAT interrupt when the ring is being stopped. Depending on timing between ring stop request completion, interrupt handler removal and code execution this may lead to a NULL pointer dereference in hci_dma_irq_handler() if it gets to run after the io_data pointer is set to NULL in hci_dma_cleanup(). Prevent this my masking the ring interrupts before ring stop request. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20240920144432.62370-2-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/i3c/master/mipi-i3c-hci/dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master/mipi-i3c-hci/dma.c b/drivers/i3c/master/mipi-i3c-hci/dma.c index a918e96b21fdd..13adc58400942 100644 --- a/drivers/i3c/master/mipi-i3c-hci/dma.c +++ b/drivers/i3c/master/mipi-i3c-hci/dma.c @@ -159,10 +159,10 @@ static void hci_dma_cleanup(struct i3c_hci *hci) for (i = 0; i < rings->total; i++) { rh = &rings->headers[i]; + rh_reg_write(INTR_SIGNAL_ENABLE, 0); rh_reg_write(RING_CONTROL, 0); rh_reg_write(CR_SETUP, 0); rh_reg_write(IBI_SETUP, 0); - rh_reg_write(INTR_SIGNAL_ENABLE, 0); if (rh->xfer) dma_free_coherent(&hci->master.dev, -- 2.43.0 -- linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c