[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DU0PR04MB94175300872F36E5DF2826DF88709@DU0PR04MB9417.eurprd04.prod.outlook.com>
Date: Tue, 23 Aug 2022 09:02:19 +0000
From: Peng Fan <peng.fan@....com>
To: Saravana Kannan <saravanak@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Kevin Hilman <khilman@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
CC: Luca Weiss <luca.weiss@...rphone.com>,
Doug Anderson <dianders@...omium.org>,
Colin Foster <colin.foster@...advantage.com>,
Tony Lindgren <tony@...mide.com>,
Alexander Stein <alexander.stein@...tq-group.com>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Jean-Philippe Brucker <jpb@...nel.org>,
"kernel-team@...roid.com" <kernel-team@...roid.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH v2 1/4] Revert "driver core: Delete
driver_deferred_probe_check_state()"
> Subject: [PATCH v2 1/4] Revert "driver core: Delete
> driver_deferred_probe_check_state()"
>
> This reverts commit 9cbffc7a59561be950ecc675d19a3d2b45202b2b.
>
> There are a few more issues to fix that have been reported in the thread for
> the original series [1]. We'll need to fix those before this will work.
> So, revert it for now.
>
> [1] -
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Flkml%2F20220601070707.3946847-1-
> saravanak%40google.com%2F&data=05%7C01%7Cpeng.fan%40nxp.co
> m%7Ce9205a2ec9c049d2a68408da82307410%7C686ea1d3bc2b4c6fa92cd99
> c5c301635%7C0%7C0%7C637965441862478527%7CUnknown%7CTWFpbGZs
> b3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M
> n0%3D%7C3000%7C%7C%7C&sdata=tGjnNEQ6BwaNrxug9ceThYOlj0a3
> Gmds8qpwNcHf%2FH8%3D&reserved=0
>
> Fixes: 9cbffc7a5956 ("driver core: Delete
> driver_deferred_probe_check_state()")
> Reviewed-by: Tony Lindgren <tony@...mide.com>
> Tested-by: Tony Lindgren <tony@...mide.com>
> Signed-off-by: Saravana Kannan <saravanak@...gle.com>
Tested-by: Peng Fan <peng.fan@....com>
> ---
> drivers/base/dd.c | 30 ++++++++++++++++++++++++++++++
> include/linux/device/driver.h | 1 +
> 2 files changed, 31 insertions(+)
>
> diff --git a/drivers/base/dd.c b/drivers/base/dd.c index
> 70f79fc71539..a8916d1bfdcb 100644
> --- a/drivers/base/dd.c
> +++ b/drivers/base/dd.c
> @@ -274,12 +274,42 @@ static int __init
> deferred_probe_timeout_setup(char *str) }
> __setup("deferred_probe_timeout=", deferred_probe_timeout_setup);
>
> +/**
> + * driver_deferred_probe_check_state() - Check deferred probe state
> + * @dev: device to check
> + *
> + * Return:
> + * * -ENODEV if initcalls have completed and modules are disabled.
> + * * -ETIMEDOUT if the deferred probe timeout was set and has expired
> + * and modules are enabled.
> + * * -EPROBE_DEFER in other cases.
> + *
> + * Drivers or subsystems can opt-in to calling this function instead of
> +directly
> + * returning -EPROBE_DEFER.
> + */
> +int driver_deferred_probe_check_state(struct device *dev) {
> + if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) {
> + dev_warn(dev, "ignoring dependency for device, assuming
> no driver\n");
> + return -ENODEV;
> + }
> +
> + if (!driver_deferred_probe_timeout && initcalls_done) {
> + dev_warn(dev, "deferred probe timeout, ignoring
> dependency\n");
> + return -ETIMEDOUT;
> + }
> +
> + return -EPROBE_DEFER;
> +}
> +EXPORT_SYMBOL_GPL(driver_deferred_probe_check_state);
> +
> static void deferred_probe_timeout_work_func(struct work_struct *work)
> {
> struct device_private *p;
>
> fw_devlink_drivers_done();
>
> + driver_deferred_probe_timeout = 0;
> driver_deferred_probe_trigger();
> flush_work(&deferred_probe_work);
>
> diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
> index 7acaabde5396..2114d65b862f 100644
> --- a/include/linux/device/driver.h
> +++ b/include/linux/device/driver.h
> @@ -242,6 +242,7 @@ driver_find_device_by_acpi_dev(struct
> device_driver *drv, const void *adev)
>
> extern int driver_deferred_probe_timeout; void
> driver_deferred_probe_add(struct device *dev);
> +int driver_deferred_probe_check_state(struct device *dev);
> void driver_init(void);
>
> /**
> --
> 2.37.1.595.g718a3a8f04-goog
Powered by blists - more mailing lists