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 725233E0097; Fri, 15 May 2026 16:24:00 +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=1778862240; cv=none; b=EGrgh+1vsCX6O15n+a9QnQwNR5VmbhsihlWyH8LTqYEoc527sK7mEqsXsoziy8moIYVjgBmkr0+hFEOw91RQrhfasHVwCoLBMREbN1Cc2iG5Johv7eNDkuF7qph4B6XsGd0i8Zt1UQ2qMawC1Vx0kI/yOl368qxGb6acWrPtiPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778862240; c=relaxed/simple; bh=TpwP6YlLe/0DZiKp4yjxNGeoVwGXB00N0G8I6DlHsS0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uCfAe/CgOaQ88TbuWHdEDseobOAtu/nksLk1yYgz5d8ZA+lU5khEWmOod/viq5Ub8Lkv2Vv60g/LMJJWf4ARY5SHfKck89Kh/d3pD/KnpbZnN7T+oEAxDNGWuIimqPqszuKWXrI/9/kPG+fiz9rJy9BFnTMJHPFNDrx39wOsYM8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EK5A+m3k; 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="EK5A+m3k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC991C2BCB0; Fri, 15 May 2026 16:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778862240; bh=TpwP6YlLe/0DZiKp4yjxNGeoVwGXB00N0G8I6DlHsS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EK5A+m3kae6y8L7NeVsgD+hTgQ3yRc8Ryfm1oCaV2/YX9D1k5QY08owC0bPzh4fHl ryKe75KmQkcHU1IvPKBDK9qw7s7aiDeJziiPdY7QCCcWlzosDYZRWR+tfNgCX3vnIE qMFjKRYwrhzClSHMVTABJ/oi793MamGiAMIOWKZA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Keiji Hayashibara , Johan Hovold , Mark Brown , Sasha Levin Subject: [PATCH 6.18 163/188] spi: uniphier: fix controller deregistration Date: Fri, 15 May 2026 17:49:40 +0200 Message-ID: <20260515154700.866643879@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: 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 [ Upstream commit 0245435f777264ac45945ed2f325dd095a41d1af ] Make sure to deregister the controller before releasing underlying resources like DMA during driver unbind. Note that clocks were also disabled before the recent commit fdca270f8f87 ("spi: uniphier: Simplify clock handling with devm_clk_get_enabled()"). Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC") Cc: stable@vger.kernel.org # 4.19 Cc: Keiji Hayashibara Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260410081757.503099-25-johan@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-uniphier.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-uniphier.c +++ b/drivers/spi/spi-uniphier.c @@ -747,7 +747,7 @@ static int uniphier_spi_probe(struct pla host->max_dma_len = min(dma_tx_burst, dma_rx_burst); - ret = devm_spi_register_controller(&pdev->dev, host); + ret = spi_register_controller(host); if (ret) goto out_release_dma; @@ -772,10 +772,16 @@ static void uniphier_spi_remove(struct p { struct spi_controller *host = platform_get_drvdata(pdev); + spi_controller_get(host); + + spi_unregister_controller(host); + if (host->dma_tx) dma_release_channel(host->dma_tx); if (host->dma_rx) dma_release_channel(host->dma_rx); + + spi_controller_put(host); } static const struct of_device_id uniphier_spi_match[] = {