Shut down devices asynchronously, ensuring that each device is shut down
before its parents.
This can dramatically reduce system shutdown/reboot time on systems that
have devices that take many seconds to shut down, such as some NVMe drives.
On one system tested, the shutdown time went from 11 minutes without this
patch to 55 seconds with the patch.
Signed-off-by: Stuart Hayes <stuart.w.hayes@xxxxxxxxx>
---
v1->v2: rewritten using kernel async code (suggested by Lukas Wunner)
---
drivers/base/base.h | 2 +
drivers/base/core.c | 135 ++++++++++++++++++++++++------------------
include/linux/async.h | 6 ++
3 files changed, 87 insertions(+), 56 deletions(-)