From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B1014F218; Thu, 12 Dec 2024 15:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734018573; cv=none; b=iMJ65SUchCTB5aMctJ24B8THCdxZwg8/pdLeKyd28+KQhldBpk7x0J+1zk/AD1KQcQo88w4MzXcplisPpdrRdnk1QZfYvsIOgNMOsSwPrKpp1jPXy0S7BEO7I5pE9SYK1fLS5fhLGeSvh1ZqI2i4NWXJ9/76FGTJbn0DkZBdFJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734018573; c=relaxed/simple; bh=glfjdQ2DKpSnLZn85NI2P0QPQiyW/TYM5XeSg42p3X8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lTcZLqOZcIxZKpD63iraMtHFLT5uTLdCjdnk+tsnVzx42BhtcWTJqGg+KAPQSk9rtfPA5bykB2r1Mj7h7uZUMFgb9F2YDjCpUf7sZzzhKStodX/bA3bGvKN5jeyb6t+ZAbcajca/Z1UCvrsQHVRj7zqKQ00RvV1w1HNfI1sy5jU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bR4uX0th; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bR4uX0th" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4B23C4CECE; Thu, 12 Dec 2024 15:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1734018573; bh=glfjdQ2DKpSnLZn85NI2P0QPQiyW/TYM5XeSg42p3X8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bR4uX0thf/OcgSpGywy1OyKZ+LLdECx/RrQrp1IC5aWYdhbweS2dHnMDQiFRRrNOC foxmpqMyD9DQXL+BzKfAk8HsG/wr72mJgW4GUu/212HGu+m4HdcjXXCVz3No3l/G2A qETbslsROui1jB3Owr1mK4FveZIbK5UeYhu5eClI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jarkko Nikula , Alexandre Belloni , Sasha Levin Subject: [PATCH 6.6 289/356] i3c: mipi-i3c-hci: Mask ring interrupts before ring stop request Date: Thu, 12 Dec 2024 16:00:08 +0100 Message-ID: <20241212144255.992360880@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241212144244.601729511@linuxfoundation.org> References: <20241212144244.601729511@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ 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 edc3a69bfe31f..bcc0c7d4131f2 100644 --- a/drivers/i3c/master/mipi-i3c-hci/dma.c +++ b/drivers/i3c/master/mipi-i3c-hci/dma.c @@ -174,10 +174,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