linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Saravana Kannan <saravanak@google.com>,
	Lukas Wunner <lukas@wunner.de>, Jon Hunter <jonathanh@nvidia.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Dmitry Osipenko <digetx@gmail.com>
Subject: Re: [PATCH] driver core: Fix creation of device links with PM-runtime flags
Date: Tue, 30 Jul 2019 11:56:41 +0200	[thread overview]
Message-ID: <2e1d36f6-338b-e0a1-fbcd-1ea082159bda@samsung.com> (raw)
In-Reply-To: <7674989.cD04D8YV3U@kreacher>

Hi,

On 2019-07-30 11:28, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.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@gmail.com>
> Tested-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

The merged commit also has my 'tested' tags, but I did my tests on v1, 
which worked fine. The offending check has been added in v2 while 
keeping the tags. Thanks for spotting this and fixing the issue, due to 
holidays time, I didn't manage to test v2 before it got merged.

> ---
>   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 |
>
>
>
>
>
Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


      parent reply	other threads:[~2019-07-30  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190730092907epcas2p486e986eff88d4b52f707b8cde71fb879@epcas2p4.samsung.com>
2019-07-30  9:28 ` [PATCH] driver core: Fix creation of device links with PM-runtime flags Rafael J. Wysocki
2019-07-30  9:41   ` Dmitry Osipenko
2019-07-30  9:56   ` Marek Szyprowski [this message]

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=2e1d36f6-338b-e0a1-fbcd-1ea082159bda@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=digetx@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=rjw@rjwysocki.net \
    --cc=saravanak@google.com \
    --cc=ulf.hansson@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).