Skip to content

Commit 8a21a16

Browse files
rfvirgilLucas Tanure
authored andcommitted
mfd: clsic: Don't block probe waiting for firmware download
The firmware download could take a while, it can also depend on other parts of the system that are not yet available. Waiting for completion can result in probe getting blocked for an extended period, and this is simply wasting time if the system is not in a state where the download could be done successfully anyway. Change the call from probe to be asynchronous. Change-Id: I31d57bdd2cfa9232ada271cae4b5977e5125291c Signed-off-by: Richard Fitzgerald <[email protected]>
1 parent f4d54b4 commit 8a21a16

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/mfd/clsic/clsic-core.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,11 @@ static int clsic_services_init(struct clsic *clsic)
338338
*/
339339
#define CLSIC_PM_COMPLETION_TIMEOUT (HZ * 100)
340340

341-
static void clsic_boot(struct clsic *clsic)
341+
static void clsic_boot_nowait(struct clsic *clsic)
342342
{
343343
unsigned int val;
344344

345+
cancel_work_sync(&clsic->maintenance_handler);
345346
reinit_completion(&clsic->pm_completion);
346347

347348
if (clsic->volatile_memory) {
@@ -357,6 +358,11 @@ static void clsic_boot(struct clsic *clsic)
357358

358359
/* Unmask the IRQ used for messaging */
359360
clsic_irq_messaging_enable(clsic);
361+
}
362+
363+
static void clsic_boot(struct clsic *clsic)
364+
{
365+
clsic_boot_nowait(clsic);
360366

361367
/*
362368
* Wait for the system to have fully initialised, including any
@@ -465,7 +471,12 @@ int clsic_dev_init(struct clsic *clsic)
465471
pm_runtime_set_active(clsic->dev);
466472
clsic_state_set(clsic, CLSIC_STATE_RESUMING,
467473
CLSIC_STATE_CHANGE_LOCKNOTHELD);
468-
clsic_boot(clsic);
474+
/*
475+
* The boot procedure can take a long time and depend on things
476+
* that aren't ready yet (mainly filesystem and firmware loader)
477+
* so don't block initial probe waiting for it to complete.
478+
*/
479+
clsic_boot_nowait(clsic);
469480

470481
}
471482
pm_runtime_enable(clsic->dev);

0 commit comments

Comments
 (0)