public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: stable@vger.kernel.org, Saravana Kannan <saravanak@google.com>,
	stable <stable@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Yang Yingliang <yangyingliang@huawei.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	James Clark <james.clark@arm.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH 5.15.y] driver core: Release all resources during unbind before updating device links
Date: Fri, 24 Nov 2023 16:44:08 +0000	[thread overview]
Message-ID: <2023112401-willing-drove-581c@gregkh> (raw)
In-Reply-To: <20231123132835.486026-1-u.kleine-koenig@pengutronix.de>

On Thu, Nov 23, 2023 at 02:28:36PM +0100, Uwe Kleine-König wrote:
> From: Saravana Kannan <saravanak@google.com>
> 
> [ Upstream commit 2e84dc37920012b458e9458b19fc4ed33f81bc74 ]
> 
> 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 <stable@kernel.org>
> Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Closes: https://lore.kernel.org/all/20231014161721.f4iqyroddkcyoefo@pengutronix.de/
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Yang Yingliang <yangyingliang@huawei.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Matti Vaittinen <mazziesaccount@gmail.com>
> Cc: James Clark <james.clark@arm.com>
> Acked-by: "Rafael J. Wysocki" <rafael@kernel.org>
> Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Link: https://lore.kernel.org/r/20231018013851.3303928-1-saravanak@google.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> this needed some conflict resolution around commit
> 9ad307213fa4 ("driver core: Refactor multiple copies of device
> cleanup").
> 
> Best regards
> Uwe
> 
>  drivers/base/dd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> index ab0b2eb5fa07..0bd166ad6f13 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -1228,8 +1228,6 @@ static void __device_release_driver(struct device *dev, struct device *parent)
>  		else if (drv->remove)
>  			drv->remove(dev);
>  
> -		device_links_driver_cleanup(dev);
> -
>  		devres_release_all(dev);
>  		arch_teardown_dma_ops(dev);
>  		kfree(dev->dma_range_map);
> @@ -1241,6 +1239,8 @@ static void __device_release_driver(struct device *dev, struct device *parent)
>  		pm_runtime_reinit(dev);
>  		dev_pm_set_driver_flags(dev, 0);
>  
> +		device_links_driver_cleanup(dev);
> +
>  		klist_remove(&dev->p->knode_driver);
>  		device_pm_check_callbacks(dev);
>  		if (dev->bus)
> 
> base-commit: 2a910f4af54d11deaefdc445f895724371645a97

Thanks, I've queued this up now.

greg k-h

  reply	other threads:[~2023-11-24 16:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 12:00 FAILED: patch "[PATCH] driver core: Release all resources during unbind before" failed to apply to 5.15-stable tree gregkh
2023-11-23 13:28 ` [PATCH 5.15.y] driver core: Release all resources during unbind before updating device links Uwe Kleine-König
2023-11-24 16:44   ` Greg Kroah-Hartman [this message]
2023-12-04 17:42     ` Uwe Kleine-König
2023-12-05  2:48       ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2023112401-willing-drove-581c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=james.clark@arm.com \
    --cc=mazziesaccount@gmail.com \
    --cc=rafael@kernel.org \
    --cc=saravanak@google.com \
    --cc=stable@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox