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 DE6AE3EDE4E; Tue, 12 May 2026 17:56:19 +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=1778608579; cv=none; b=Lx1hUgXETvuGwZp0N/hhYcUog2BJR5x10Sck/nkA/DIublnwBKSVjajqZl6It97Szx/fEC0E7WETmJ8dmNT0YGhu7OXi3Ak4+hV/0hlj/hWrTXz5slSKKDB6ALN3wpqBrO3BBK1Cb/4zW9I9wSvtVRuWBiXp6iaF6qdmJtxkTM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778608579; c=relaxed/simple; bh=P9TWLgKuAs65NEQ1FmRde6tZkwRSaVTzJqMzhMVdi00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t48rdm5lw1CE3ZFj/Pf0oNOhS4QeEXtIgB1eMdHKI0N64n/tnnUlod9Nn2+EOhVloa3y/n0N+GM857kOiyL8HZ7n1QgTGSo9Hg1q4wuOVZPb0wV8UKcn6uZQs4GdRgtj+bFozC5xt6ZazWGM3QgcUY2L8X0NF6GYx1mGKxP1V9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HcjyHcp4; 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="HcjyHcp4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C48EC2BCB0; Tue, 12 May 2026 17:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778608579; bh=P9TWLgKuAs65NEQ1FmRde6tZkwRSaVTzJqMzhMVdi00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HcjyHcp4mdnhbvvx3wIXFaUibfmjZN6qjLAPNTUr3AQO8Ll2OJFm8r6D6F+5M6IhZ XAOxhEgiiA/ZgxI3ExUdti+FhVYAsFyuA1a83oAuA1Xpwkdw+MR59XkiUenAGnPkwL zdDk8+dIQo2KuzW8d9hekr03f82DlxHpfJp+Ucs0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Masayuki Ohtake , Johan Hovold , Mark Brown Subject: [PATCH 6.18 135/270] spi: topcliff-pch: fix controller deregistration Date: Tue, 12 May 2026 19:38:56 +0200 Message-ID: <20260512173941.294050688@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173938.452574370@linuxfoundation.org> References: <20260512173938.452574370@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold commit 5d6f477d6fc0767c57c5e1e6f55a1662820eef87 upstream. Make sure to deregister the controller before disabling and releasing underlying resources like interrupts and DMA during driver unbind. Fixes: e8b17b5b3f30 ("spi/topcliff: Add topcliff platform controller hub (PCH) spi bus driver") Cc: stable@vger.kernel.org # 2.6.37 Cc: Masayuki Ohtake Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260414134319.978196-8-johan@kernel.org Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-topcliff-pch.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -1406,6 +1406,10 @@ static void pch_spi_pd_remove(struct pla dev_dbg(&plat_dev->dev, "%s:[ch%d] irq=%d\n", __func__, plat_dev->id, board_dat->pdev->irq); + spi_controller_get(data->host); + + spi_unregister_controller(data->host); + if (use_dma) pch_free_dma_buf(board_dat, data); @@ -1433,7 +1437,8 @@ static void pch_spi_pd_remove(struct pla } pci_iounmap(board_dat->pdev, data->io_remap_addr); - spi_unregister_controller(data->host); + + spi_controller_put(data->host); } #ifdef CONFIG_PM static int pch_spi_pd_suspend(struct platform_device *pd_dev,