Skip to contentSkip to conversation

FAILED: patch "[PATCH] driver core: Release all resources during unbind before" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message Nov 23, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 2e84dc37920012b458e9458b19fc4ed33f81bc74
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023112333-splurge-headpiece-79fb@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..

Possible dependencies:

2e84dc379200 ("driver core: Release all resources during unbind before updating device links") 25f3bcfc54bc ("driver core: Add dma_cleanup callback in bus_type")
9ad307213fa4 ("driver core: Refactor multiple copies of device cleanup") d8f7a5484f21 ("driver core: Free DMA range map when device is released") 885e50253bfd ("driver core: Move driver_sysfs_remove() after driver_sysfs_add()") 4d1014c1816c ("drivers core: Fix oops when driver probe fails")
45ddcb42949f ("driver core: Don't return EPROBE_DEFER to userspace during sysfs bind") ef6dcbdd8eb2 ("driver core: Flow the return code from ->probe() through to sysfs bind") e1499647c69c ("driver core: Better distinguish probe errors in really_probe") 204db60c8357 ("driver core: Pull required checks into driver_probe_device()") 2c3dc6432f33 ("driver core: make driver_probe_device() static")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 2e84dc37920012b458e9458b19fc4ed33f81bc74 Mon Sep 17 00:00:00 2001
From: Saravana Kannan <[email protected]>
Date: Tue, 17 Oct 2023 18:38:50 -0700
Subject: [PATCH] driver core: Release all resources during unbind before
updating device links
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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.

drivers/base/dd.c +1 -1
index a528cec24264..0c3725c3eefa 100644
@@ -1274,8 +1274,8 @@ static void __device_release_driver(struct device *dev, struct device *parent)
 		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);