From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 1D6663D34AD; Tue, 16 Jun 2026 17:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781632319; cv=none; b=BMSz3VpehCLvJVoOkKOoTr6+NeaCWEI5ARt089Nxtr+AhqVeWBgBzEY0cgHJm9MGS+F+0+LXKFVbweMlmFZ79+4XVaJFlZ0bY3BlXQd6RzfnL8bTOXiqqKE5wgguiww3I6I8KNytrdTwlPIIbs6WlH4MRNTPS3CLk9pplaJGOIY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781632319; c=relaxed/simple; bh=w+m7mdvxR9e10PshZ/oYDBzR+kg7Uuea4IcA5W/Vi4o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PlUggI2UmAPdBT31c1VV1LLwcPfEWNw0Ep1lhNX+5CJUt6Ji0xVWBuc0Et0+rau3UYaITEYsuwhZVa9EHV736gtbrk2LXFqTwZATcCiZnP9YKszFvKeWc80sP6BymFeh2/mAz3lSszR4Btbr6CyQp86avVc/xN/TQYZsAaXwO9o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wMNG+aWQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wMNG+aWQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78EC51F000E9; Tue, 16 Jun 2026 17:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781632315; bh=oqV3RdWuZjsa8pYxbPAmreHyjrhj6uuhrRDqI/gci2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wMNG+aWQWINCdBCDNobEF0bzA2x08ZU6mu4K/g4CzRGSDKFlRt8NC2iJ+kWBXRerr UHoDA0KYH3IHpop8VIw1YKOb9xMm8JLR8x/tP/8CYRG+edX9R9IlQa+WlzINmRrpXI 8nDAuBUR4MVKIdWNbnhj+p3krn7npx18tnYKttzY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sebastian Andrzej Siewior , Johan Hovold , Mark Brown , Sasha Levin Subject: [PATCH 6.1 388/522] spi: ti-qspi: fix controller deregistration Date: Tue, 16 Jun 2026 20:28:55 +0530 Message-ID: <20260616145143.952912084@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145125.307082728@linuxfoundation.org> References: <20260616145125.307082728@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold [ Upstream commit 0c18a1bacbb1d8b8aa34d3d004a2cb8226c8b1ea ] Make sure to deregister the controller before disabling underlying resources like clocks during driver unbind. Note that the controller is suspended before disabling and releasing resources since commit 3ac066e2227c ("spi: spi-ti-qspi: Suspend the queue before removing the device") which avoids issues like unclocked accesses but prevents SPI device drivers from doing I/O during deregistration. Fixes: 3b3a80019ff1 ("spi: ti-qspi: one only one interrupt handler") Cc: stable@vger.kernel.org # 3.13 Cc: Sebastian Andrzej Siewior Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260410081757.503099-24-johan@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-ti-qspi.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -897,7 +897,7 @@ no_dma: qspi->mmap_enabled = false; qspi->current_cs = -1; - ret = devm_spi_register_controller(&pdev->dev, host); + ret = spi_register_controller(host); if (!ret) return 0; @@ -912,19 +912,17 @@ free_host: static void ti_qspi_remove(struct platform_device *pdev) { struct ti_qspi *qspi = platform_get_drvdata(pdev); - int rc; - rc = spi_controller_suspend(qspi->host); - if (rc) { - dev_alert(&pdev->dev, "spi_controller_suspend() failed (%pe)\n", - ERR_PTR(rc)); - return; - } + spi_controller_get(qspi->host); + + spi_unregister_controller(qspi->host); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); ti_qspi_dma_cleanup(qspi); + + spi_controller_put(qspi->host); } static const struct dev_pm_ops ti_qspi_pm_ops = {