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 B31664BCAD9; Fri, 15 May 2026 16:16:02 +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=1778861762; cv=none; b=TfKHUm5OWc9eTnjM3pV4+2cISLRbjzEnF5qLyIMnwDIueEx+8qWMgCj7Q1PAqS8ahfUXhHpc7eSsJ8UVNWUjNyxo1wPKtwl7QiKnlaSu6OB4uU+N+J/b5YjY2lcogx+06b+wnOru+ESnYwwvkUoyUc6AUr0k92+3WzH/zNZcpSE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861762; c=relaxed/simple; bh=TJyDG1OIWqifD9naWXdvyQjlJw5vaLqv41YEctncu8E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bBc+OKtsWSPP27LprCtvwKPxkRJkGEStw4bThVUDDU2npMW2aF/yKdy/L50+smPe98hlseDMLvJm1bmlABBTxKd1mOcR0n9rbkcuFz4avur5kN8JbYa/18Vj5Jop0fdNg3v7HtB5A/OqTpmIh6RkC0gXCpV07ZRGt7AbK5hXV8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=U85NrnEQ; 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="U85NrnEQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18746C2BCB0; Fri, 15 May 2026 16:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778861762; bh=TJyDG1OIWqifD9naWXdvyQjlJw5vaLqv41YEctncu8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U85NrnEQqGn9XU/ZEIU3a1m5FqkdP0BvqxxXh/1imEAnW+C+jaFZFJellrFWVo6IG laqc1fES31ez+4EKiAuH4SUfBqjM4o4J33P10ZcD1R4tHTjOisL8VPggZPvu4tksw/ jHHoybgrrElulIrjj61kJ8Bse/qBvVy40EeZ2B6c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Maxime Ripard , Johan Hovold , Mark Brown , Sasha Levin Subject: [PATCH 6.6 426/474] spi: sun4i: fix controller deregistration Date: Fri, 15 May 2026 17:48:55 +0200 Message-ID: <20260515154724.284735871@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold [ Upstream commit 42108a2f03e0fdeabe9d02d085bdb058baa1189f ] Make sure to deregister the controller before disabling underlying resources like clocks during driver unbind. Fixes: b5f6517948cc ("spi: sunxi: Add Allwinner A10 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-19-johan@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-sun4i.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -503,7 +503,7 @@ static int sun4i_spi_probe(struct platfo pm_runtime_enable(&pdev->dev); pm_runtime_idle(&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; @@ -521,7 +521,15 @@ err_free_host: static void sun4i_spi_remove(struct platform_device *pdev) { + struct spi_controller *host = platform_get_drvdata(pdev); + + spi_controller_get(host); + + spi_unregister_controller(host); + pm_runtime_force_suspend(&pdev->dev); + + spi_controller_put(host); } static const struct of_device_id sun4i_spi_match[] = {