[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eea5e138-33cc-42c4-1c42-56d309847d82@gmail.com>
Date: Tue, 30 Jul 2019 12:41:20 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>,
Saravana Kannan <saravanak@...gle.com>,
Lukas Wunner <lukas@...ner.de>,
Jon Hunter <jonathanh@...dia.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH] driver core: Fix creation of device links with PM-runtime
flags
30.07.2019 12:28, Rafael J. Wysocki пишет:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> After commit 515db266a9da ("driver core: Remove device link creation
> limitation"), if PM-runtime flags are passed to device_link_add(), it
> will fail (returning NULL) due to an overly restrictive flags check
> introduced by that commit.
>
> Fix this issue by extending the check in question to cover the
> PM-runtime flags too.
>
> Fixes: 515db266a9da ("driver core: Remove device link creation limitation")
> Reported-by: Dmitry Osipenko <digetx@...il.com>
> Tested-by: Jon Hunter <jonathanh@...dia.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> drivers/base/core.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> Index: linux-pm/drivers/base/core.c
> ===================================================================
> --- linux-pm.orig/drivers/base/core.c
> +++ linux-pm/drivers/base/core.c
> @@ -213,6 +213,9 @@ void device_pm_move_to_tail(struct devic
> DL_FLAG_AUTOREMOVE_SUPPLIER | \
> DL_FLAG_AUTOPROBE_CONSUMER)
>
> +#define DL_ADD_VALID_FLAGS (DL_MANAGED_LINK_FLAGS | DL_FLAG_STATELESS | \
> + DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE)
> +
> /**
> * device_link_add - Create a link between two devices.
> * @consumer: Consumer end of the link.
> @@ -274,8 +277,7 @@ struct device_link *device_link_add(stru
> {
> struct device_link *link;
>
> - if (!consumer || !supplier ||
> - (flags & ~(DL_FLAG_STATELESS | DL_MANAGED_LINK_FLAGS)) ||
> + if (!consumer || !supplier || flags & ~DL_ADD_VALID_FLAGS ||
> (flags & DL_FLAG_STATELESS && flags & DL_MANAGED_LINK_FLAGS) ||
> (flags & DL_FLAG_AUTOPROBE_CONSUMER &&
> flags & (DL_FLAG_AUTOREMOVE_CONSUMER |
>
>
>
Thank you very much!
Tested-by: Dmitry Osipenko <digetx@...il.com>
Powered by blists - more mailing lists