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 2B9803A7F6E for ; Thu, 14 May 2026 04:14:48 +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=1778732089; cv=none; b=fwDee/gJgnVGK28tU9fUzpfwhjmij1mPPqm45tajzL023bF39bjN/MJhqjisV5hW5djDqJ3IC/zwJy6jbEcBye6FVaLlr07c6NeE0rK05QKluaPSUP8DIxMEHMq5toPBu7vUXbNpwA/Haisvpdo3Aq0SuAgepbgs7vuc2qVg0uA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778732089; c=relaxed/simple; bh=27+rBgkt8WT/AU+OiG/qN5+3Bu8xNkkxTQv65pxd4oE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ll938+v6mqLtal7DRdecLvUi50iZY2bFpBHXfNCyI1FgcEU1+Ry6uITNwK5smfIcPM0tI/T6sjmhzjgjO603IIgidM29sFfpwxNkt1FSOBzXMKQZMNlD9mIJmGPHmj3JAwoA3H1QKl3oud0c7xXIw8OgS8RmuBCCvdd63BKrTuI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hpYHAclo; 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="hpYHAclo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 313BEC2BCB7; Thu, 14 May 2026 04:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778732088; bh=27+rBgkt8WT/AU+OiG/qN5+3Bu8xNkkxTQv65pxd4oE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hpYHAcloJyeIlRtjpCxYZ2FbRCyjyCEp7gFQ6dhN2m8nJXL7eAKSsuozEZNm0HYUD tvDRfwVpnmNRfQW2tbccsJcj8/uDjSeyyqtaZASt04T+6uVV+nSxn1Jwx/S4tRUqsy aRhH12AZrpCjLmG5IEuaGvjCEptObDgMMhLtiHFRBS1GnI9FJ7rVFuRy8wdU/kYnwc /4IlOSkAmVhG0WnU5FUOmvp31WSsSpOxCaLmpZS30LydL+jMzPegZ4kxBgeDcsvR4R dukQLrWmietDsWoD3thbFIdQNtULdh889wRPP9hhhCuAuFSuTDtzInhLRepbku9teC D+Mq2KWzGESLQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Johan Hovold , Jingoo Han , Mark Brown , Sasha Levin Subject: [PATCH 6.18.y] spi: tegra20-sflash: fix controller deregistration Date: Thu, 14 May 2026 00:14:46 -0400 Message-ID: <20260514041446.4193882-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026051257-sprint-buddhist-5107@gregkh> References: <2026051257-sprint-buddhist-5107@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 d5c8ee20b8e5b..dc3fcab5faa95 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