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 7B9BC35E529 for ; Thu, 14 May 2026 04:36:28 +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=1778733388; cv=none; b=h6Eq1WU632C6sJ1vqx3oopm84Tc3lbljhFW/hjyJoyIkp0qyxeFnhbSXv0DZqf5W8F/lACTlsnrJBXegmwnGxOuWM9BAq9XzjvXXcMrZwdYDSwIHx+MU4Kp4zGUb+l2RKJ6BjfAweDOM+8iettrH8eagoeyUsnro3cWABF6vSw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778733388; c=relaxed/simple; bh=7Df2qqU76sKKkaeRScD4hr+YCJmQ/IMxh/3+LYlaXak=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EzP2bTvxaRIcnoQAJb6yv7I3zCJBgQx2iYDjgE57nw9Ky/J5eovxIrmYLat0ILXvzcztpKZu7hJfK+oSqmet1Z03bcMtQyM5KI7i4DPUKrwTOECnh3xanoUiANi6cxnRv2dgpKWoheQXPFPZLuLYLyvrqPBXfkpBjEA0MoWok34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o8G/XDpn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="o8G/XDpn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DCA9C2BCB7; Thu, 14 May 2026 04:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778733388; bh=7Df2qqU76sKKkaeRScD4hr+YCJmQ/IMxh/3+LYlaXak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o8G/XDpnbOK9pyxnztF9lso5/6HoRO1CnLVkjmFSdgO4B9RdHCr6d772Ofdffivg1 we+m6i8fR77+Hucy1sxATQGdcLFM9gShKBFACw6cXHr2Evo+I8i9sWu/zEuu4+ldQz AGePUwTtdah/5oWi6mEv0Y1HQpfwIoEHBl298KFzNHPGEL9PFpcTXspgSlV05LK9VW DPvXQlXcdg/rr7kAG89UfjIE2Y5FDUq4y1BvElny+GbRhenUxaqEb4xRS7zU3+BzHu nkwgI/nb0lwzwrQNwWBVnxmK2J/+pge+gPtBhOz64pRPvtIOE5r7p/PeYA3FA4iMd2 w9+cp1meg7gtw== From: Sasha Levin To: stable@vger.kernel.org Cc: Johan Hovold , Jingoo Han , Mark Brown , Sasha Levin Subject: [PATCH 6.12.y] spi: tegra20-sflash: fix controller deregistration Date: Thu, 14 May 2026 00:36:25 -0400 Message-ID: <20260514043625.10766-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051257-afflicted-freebase-128a@gregkh> References: <2026051257-afflicted-freebase-128a@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johan Hovold [ Upstream commit ad7310e983327f939dd6c4e801eab13238992572 ] Make sure to deregister the controller before disabling underlying resources like clocks during driver unbind. Fixes: f12f7318c44a ("spi: tegra20-sflash: use devm_spi_register_master()") Cc: stable@vger.kernel.org # 3.13 Cc: Jingoo Han Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260410081757.503099-23-johan@kernel.org Signed-off-by: Mark Brown [ kept the redundant `host->dev.of_node = pdev->dev.of_node;` line above the registration call ] Signed-off-by: Sasha Levin --- drivers/spi/spi-tegra20-sflash.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c index 9f6b9f89be5b8..95d74b383931d 100644 --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -506,7 +506,7 @@ static int tegra_sflash_probe(struct platform_device *pdev) pm_runtime_put(&pdev->dev); host->dev.of_node = pdev->dev.of_node; - ret = devm_spi_register_controller(&pdev->dev, host); + ret = spi_register_controller(host); if (ret < 0) { dev_err(&pdev->dev, "can not register to host err %d\n", ret); goto exit_pm_disable; @@ -529,11 +529,17 @@ static void tegra_sflash_remove(struct platform_device *pdev) struct spi_controller *host = platform_get_drvdata(pdev); struct tegra_sflash_data *tsd = spi_controller_get_devdata(host); + spi_controller_get(host); + + spi_unregister_controller(host); + free_irq(tsd->irq, tsd); pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) tegra_sflash_runtime_suspend(&pdev->dev); + + spi_controller_put(host); } #ifdef CONFIG_PM_SLEEP -- 2.53.0