From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Saravana Kannan <saravanak@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] driver core: Fix handling of fw_devlink=permissive
Date: Tue, 31 Mar 2020 07:43:28 +0200 [thread overview]
Message-ID: <781eefdc-c926-7566-5305-bb9633e6fac0@samsung.com> (raw)
In-Reply-To: <20200331022832.209618-1-saravanak@google.com>
Hi,
On 2020-03-31 04:28, Saravana Kannan wrote:
> When commit 8375e74f2bca ("driver core: Add fw_devlink kernel
> commandline option") added fw_devlink, it didn't implement "permissive"
> mode correctly.
>
> That commit got the device links flags correct to make sure unprobed
> suppliers don't block the probing of a consumer. However, if a consumer
> is waiting for mandatory suppliers to register, that could still block a
> consumer from probing.
>
> This commit fixes that by making sure in permissive mode, all suppliers
> to a consumer are treated as a optional suppliers. So, even if a
> consumer is waiting for suppliers to register and link itself (using the
> DL_FLAG_SYNC_STATE_ONLY flag) to the supplier, the consumer is never
> blocked from probing.
>
> Fixes: 8375e74f2bca ("driver core: Add fw_devlink kernel commandline option")
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> ---
> Hi Marek,
>
> If you pull in this patch and then add back in my patch that created the
> boot problem for you, can you see if that fixes the boot issue for you?
Indeed, this fixes booting on my Raspberry Pi3/4 boards with linux
next-20200327. Thanks! :)
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>
> Thanks,
> Saravana
>
> drivers/base/core.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 5e3cc1651c78..1be26a7f0866 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -2370,6 +2370,11 @@ u32 fw_devlink_get_flags(void)
> return fw_devlink_flags;
> }
>
> +static bool fw_devlink_is_permissive(void)
> +{
> + return fw_devlink_flags == DL_FLAG_SYNC_STATE_ONLY;
> +}
> +
> /**
> * device_add - add device to device hierarchy.
> * @dev: device.
> @@ -2524,7 +2529,7 @@ int device_add(struct device *dev)
> if (fw_devlink_flags && is_fwnode_dev &&
> fwnode_has_op(dev->fwnode, add_links)) {
> fw_ret = fwnode_call_int_op(dev->fwnode, add_links, dev);
> - if (fw_ret == -ENODEV)
> + if (fw_ret == -ENODEV && !fw_devlink_is_permissive())
> device_link_wait_for_mandatory_supplier(dev);
> else if (fw_ret)
> device_link_wait_for_optional_supplier(dev);
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2020-03-31 5:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-21 21:03 [RFC PATCH v1] driver core: Set fw_devlink to "permissive" behavior by default Saravana Kannan
[not found] ` <CGME20200327102554eucas1p1f848633a39f8e158472506b84877f98c@eucas1p1.samsung.com>
2020-03-27 10:25 ` Marek Szyprowski
2020-03-27 11:30 ` Greg Kroah-Hartman
2020-03-27 15:21 ` Greg Kroah-Hartman
2020-03-27 18:30 ` Saravana Kannan
2020-03-30 6:20 ` Marek Szyprowski
2020-03-30 18:41 ` Saravana Kannan
2020-03-31 2:28 ` [PATCH v1] driver core: Fix handling of fw_devlink=permissive Saravana Kannan
2020-03-31 5:43 ` Marek Szyprowski [this message]
2020-03-31 6:18 ` Saravana Kannan
2020-03-31 7:07 ` Marek Szyprowski
2020-03-31 7:29 ` Greg Kroah-Hartman
2020-04-16 18:25 ` Saravana Kannan
2020-04-28 15:52 ` Greg Kroah-Hartman
2020-04-28 18:27 ` Saravana Kannan
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=781eefdc-c926-7566-5305-bb9633e6fac0@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=saravanak@google.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
all inboxes | Powered by JetHome®