From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 AD47E44B69C; Tue, 16 Jun 2026 15:51:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781625106; cv=none; b=EAT8Iao1rTTgSHDM9HMe7xNe0d1CAwdGpxJxA4OF2YPaaUGEUxsVzP0U6p32EbkIxV707kUA8DVCLZnnQBcr59eZ+q1BS9/JYAuNQTeYr2nM/+lrPXCSvRXIT/1Y2kPuGweOs3Rvd35BfLKDngTnoU7EMu8wIeeDQIxM0r24ndY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781625106; c=relaxed/simple; bh=PjsUU9yFt/v44RaoIKrUBqLH5053gSyYrfUuB4M+p78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jCT8BYM5a8sISWRf9RfAIrSJMQtAcGXnfpSWERka7g2JeqPYRn/NIoU11ijckiE6ZbGj/L94GDTq+qECTSnnWUPUnN4cCiq89nvvIiB0RHyV0LRx1AK7reRG1C8mp/oze5nCNTrtcD/EWnUu0vyBUSoXS0mkmsUqzdenNakmFnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xA3u+P8w; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xA3u+P8w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9599E1F000E9; Tue, 16 Jun 2026 15:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781625105; bh=SgHZ0HLzkMkFWb0YaAFU0f74KPSHFAt66Bh1B64SVVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xA3u+P8wzjEuhnYRbaPjHnZFT27/cvSGJO+JuQFPRcynSGlqaSD7EMd/5WoaP/T8t jRGaGelOIGVp0qg9jS+cbxs//OdhjRklWIWtP89AIvB6LQp5CFTfDNWfMR40reoYHu z0nHAfkfYc1Pmdpens7n+euz/u1LEuudOcZQjLyA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dhruva Gole , Johan Hovold , Mark Brown , Robert Garcia , Sasha Levin Subject: [PATCH 6.18 077/325] spi: cadence-quadspi: fix unclocked access on unbind Date: Tue, 16 Jun 2026 20:27:53 +0530 Message-ID: <20260616145101.567574567@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145057.827196531@linuxfoundation.org> References: <20260616145057.827196531@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold [ Upstream commit 233db2cb14db8b1935dda52a6affd97276462b82 ] Make sure that the controller is runtime resumed before disabling it during driver unbind to avoid an unclocked register access. This issue was flagged by Sashiko when reviewing a controller deregistration fix. Fixes: 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") Cc: stable@vger.kernel.org # 6.7 Cc: Dhruva Gole Link: https://sashiko.dev/#/patchset/20260414134319.978196-1-johan%40kernel.org?part=2 Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260421125354.1534871-4-johan@kernel.org Signed-off-by: Mark Brown [ Context adaptation performed. ] Signed-off-by: Robert Garcia Signed-off-by: Sasha Levin --- drivers/spi/spi-cadence-quadspi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index d61bc678b6f83b..0a32e28eefd515 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -2055,7 +2055,6 @@ static void cqspi_remove(struct platform_device *pdev) cqspi_wait_idle(cqspi); spi_unregister_controller(cqspi->host); - cqspi_controller_enable(cqspi, 0); if (cqspi->rx_chan) dma_release_channel(cqspi->rx_chan); @@ -2063,8 +2062,10 @@ static void cqspi_remove(struct platform_device *pdev) if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) ret = pm_runtime_get_sync(&pdev->dev); - if (ret >= 0) + if (ret >= 0) { + cqspi_controller_enable(cqspi, 0); clk_disable(cqspi->clk); + } if (cqspi->is_jh7110) cqspi_jh7110_disable_clk(pdev, cqspi); -- 2.53.0