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 7896047A0C4; Tue, 16 Jun 2026 17:51:35 +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=1781632297; cv=none; b=uZF/8q+yIyAekJxD48uvTZwdJJF77M5aBXSHaoZOSAKL1+tEpiQsGhw8urFFjuraYKt1V/3RVX+IfADXiWhuEmCSGZEQjoNA6w+gJHueRSFicT4Zc6G4nrVgEzwOHmWvqqnY31PnvHsLS6asnckkKWx+cTsULwcV904z3Qqs1ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781632297; c=relaxed/simple; bh=j0S6oN6A5dnD0RpXtjgX1UCftwPiXRPJH2ZrLSb7/Ig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=isbrsQ9+4u+ZnAF2Vroz/bNOgXosaGmOQMtgHw7SbaNmpsfjWIxiZ7TKdlDsYrE6Hbs/jQ299ypAJhsNbvS7wlZlrVLVr6JMUBkyVCCmhxQWJol2zKwwJLpDhg1l0q66Gz/HEPziG5hjBrbjSgiaGEGAzEB2sfyTtDfdhyxfkI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Mo+81WI5; 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="Mo+81WI5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FC411F000E9; Tue, 16 Jun 2026 17:51:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781632295; bh=sCz9a1zZLZ15k6Ch5USsT8r1OziSBM/9I3wrUYozogk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Mo+81WI55o7+ywME9JhBj+pjM7o9WFE9XP/IcKtdqTwSrejzLLJ8T52huP5iXLjU+ mRegw/FhW9VIarrW9bLuRrvw5M2fC283VZUNhMkCaE3E8DqdecB9IzhpmGbzTugJc7 R7xIK1VM8y2Pfy5vIEyr1LUyI53//u5NABGxPNco= 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.1 384/522] spi: sun4i: fix controller deregistration Date: Tue, 16 Jun 2026 20:28:51 +0530 Message-ID: <20260616145143.747816395@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145125.307082728@linuxfoundation.org> References: <20260616145125.307082728@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.1-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[] = {