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 AD2E72C85B; Fri, 24 Nov 2023 18:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="aV09pI6q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1039FC433C7; Fri, 24 Nov 2023 18:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700852229; bh=WAz8GX6E+RuREBjJ13IiI8IN/y1qnYQvbmiy6O2bmHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aV09pI6q34UfeLLDZ6Hk74VfC3v0EHZmCfklVUXI3x0oEmQmA7+Jac3OwOo4ITr9U vGgY8FNfY7Qr9flRjSvZbedJKIxkfqpW9m20RY8VCMiGjmplhwUu64ubXEhc2Gn02l kfsyvyGCi7HgMPMaSsE18NQiAkQQ8uGhE9uSDfy0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Saravana Kannan , Thierry Reding , Yang Yingliang , Andy Shevchenko , Mark Brown , Matti Vaittinen , James Clark , "Rafael J. Wysocki" Subject: [PATCH 6.1 247/372] driver core: Release all resources during unbind before updating device links Date: Fri, 24 Nov 2023 17:50:34 +0000 Message-ID: <20231124172018.762999806@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231124172010.413667921@linuxfoundation.org> References: <20231124172010.413667921@linuxfoundation.org> User-Agent: quilt/0.67 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Saravana Kannan commit 2e84dc37920012b458e9458b19fc4ed33f81bc74 upstream. This commit fixes a bug in commit 9ed9895370ae ("driver core: Functional dependencies tracking support") where the device link status was incorrectly updated in the driver unbind path before all the device's resources were released. Fixes: 9ed9895370ae ("driver core: Functional dependencies tracking support") Cc: stable Reported-by: Uwe Kleine-König Closes: https://lore.kernel.org/all/20231014161721.f4iqyroddkcyoefo@pengutronix.de/ Signed-off-by: Saravana Kannan Cc: Thierry Reding Cc: Yang Yingliang Cc: Andy Shevchenko Cc: Mark Brown Cc: Matti Vaittinen Cc: James Clark Acked-by: "Rafael J. Wysocki" Tested-by: Uwe Kleine-König Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231018013851.3303928-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -1262,8 +1262,8 @@ static void __device_release_driver(stru if (dev->bus && dev->bus->dma_cleanup) dev->bus->dma_cleanup(dev); - device_links_driver_cleanup(dev); device_unbind_cleanup(dev); + device_links_driver_cleanup(dev); klist_remove(&dev->p->knode_driver); device_pm_check_callbacks(dev);