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 0206A23E356; Tue, 12 May 2026 18:05:49 +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=1778609149; cv=none; b=Ir387CMi6ETfamwgkz7alX/yGfdObixg0YDtddAknKEauLkry+Ll8m9ptEuuViXxprl7Lh3EYgIVnUK56SrMWvC1XemZ7qgy16jdHD3eaowd6zl1QnMKJun0uk2gnuYp5wtP1VddhesprWUeYl1k/gdRb3aSrM+i0H7kSJyaFS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778609149; c=relaxed/simple; bh=j0nDdKJpeYuQdSpQ6iJbv3flwcplbOStduVXN8GssRU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YGUBJGgDYNnwHhr1nC0HXg7Wjj/t33kYgOuozVb+vHLB48DbX2Se68n/ItATpenGmqyTHq0BHSR8VPAVz+iYztct2uFgBMX8teI97fJ/4dgCkXsmCv5w9t3r1hVe7Q4QYuFDyJHgYYJBvL72bHJoy+WdFW7HYaEm68Ezi0iog5o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OezL16Oy; 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="OezL16Oy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D43AC2BCB0; Tue, 12 May 2026 18:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778609148; bh=j0nDdKJpeYuQdSpQ6iJbv3flwcplbOStduVXN8GssRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OezL16OyuwKODO+4AxdaoFxYuy30OIrDUc13bPPDKe/5k3oeO/bSKWiHpX+rkC7cj oZuct0F34ZiQqgPNSgchHITL0M+nLJ4Ycl7lO948t4oacqCcYPbf2EvvxFPhRrbtO+ 49y2WSGfVYaamN+6stlH/kXxyTG78+XFcNoZcPTU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Maxime Ripard , Johan Hovold , Mark Brown Subject: [PATCH 7.0 085/307] spi: sun6i: fix controller deregistration Date: Tue, 12 May 2026 19:38:00 +0200 Message-ID: <20260512173941.915619094@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173940.117428952@linuxfoundation.org> References: <20260512173940.117428952@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 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit d874a1c33aee0d88fb4ba2f8aeadaa9f1965209a upstream. Make sure to deregister the controller before disabling underlying resources like clocks during driver unbind. Fixes: 3558fe900e8a ("spi: sunxi: Add Allwinner A31 SPI controller driver") Cc: stable@vger.kernel.org # 3.15 Cc: Maxime Ripard Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260410081757.503099-20-johan@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-sun6i.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -742,7 +742,7 @@ static int sun6i_spi_probe(struct platfo pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); - ret = devm_spi_register_controller(&pdev->dev, host); + ret = spi_register_controller(host); if (ret) { dev_err(&pdev->dev, "cannot register SPI host\n"); goto err_pm_disable; @@ -768,12 +768,18 @@ static void sun6i_spi_remove(struct plat { struct spi_controller *host = platform_get_drvdata(pdev); + spi_controller_get(host); + + spi_unregister_controller(host); + pm_runtime_force_suspend(&pdev->dev); if (host->dma_tx) dma_release_channel(host->dma_tx); if (host->dma_rx) dma_release_channel(host->dma_rx); + + spi_controller_put(host); } static const struct sun6i_spi_cfg sun6i_a31_spi_cfg = {