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 21D9F3E7BDE; Fri, 15 May 2026 16:24:03 +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=1778862243; cv=none; b=niTh75HtLGk0fPtoYsNzQdU4ZbKSeJ5nQUsdowD/WE0kh3X7pAO+zNLI5FwynI0WkdrMinFab/WTJ+w+ppcY3FhE5gbOhogyGrUwwEOphjxOAOiWn2Wv+Y880lUWnT4JTyddHwIRPqawCslzva1jZ7Vw9I/UFdU5VNlgc6bGr6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778862243; c=relaxed/simple; bh=p1IqVW/mJwsLkZX2s0uhVkksFiqsPa/p8rbGQURJup0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VptgyrIG5mrHntN+MZ5LsF6llYI5xaIm7TyEk8zF2ZB0QuqvCAbyycm7Jhzwpxbl1f8wcHUucweXq0YDUjOMO+BHrvK/PTFf07aQFxzNyoPA5/M+66Tg4af7niYoNVkbpTK/SgezMtE98cUL/Ue14nPRO1lrBg72Yx42cLsRSvw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dDWcLNDe; 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="dDWcLNDe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2540C2BCC9; Fri, 15 May 2026 16:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778862243; bh=p1IqVW/mJwsLkZX2s0uhVkksFiqsPa/p8rbGQURJup0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dDWcLNDe04EAUbnYYQWOxIkUObdhOmdAZW4yIIgcU5grC267qDxfb9ztuF7vwyvwT Xx8wGPuiBhZuIXts1iXSIHCFaEf8SJrI7XMLw8iBBBI43gC0b/8MKNHDhxROQRkiVJ wSPRF9SCNElWKLjbDk7qZk/Jc+Ibly/HFylXgrjw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jingoo Han , Johan Hovold , Mark Brown , Sasha Levin Subject: [PATCH 6.18 164/188] spi: tegra20-sflash: fix controller deregistration Date: Fri, 15 May 2026 17:49:41 +0200 Message-ID: <20260515154700.889642450@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154657.309489048@linuxfoundation.org> References: <20260515154657.309489048@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org 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 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 Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-tegra20-sflash.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -506,7 +506,7 @@ static int tegra_sflash_probe(struct pla 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 p 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