RFC: Make thunderbolt NHI driver work with kexec [RESEND]
Subsystems (2)
cover RFC: Make thunderbolt NHI driver work with kexec [RESEND]
While trying to use kexec on my desktop, which has Titan Ridge Thunderbolt add-on card, I noticed that after a kexec, system hangs for about a minute in the 'wating for udev devices to settle' phase of the boot.
I found out that if I unload the thunderbolt driver prior to the kexec, then it works just fine.
Looking at the code I see that the driver doeesn't implement .shutdown method, so this on-liner patch points it to the same method that is used on device removal.
I don't know if this is the right solution, but it does appear to work just fine with this patch.
What do you think?
Best regards,
Maxim Levitsky
Maxim Levitsky (1):
thunderbolt: add trivial .shutdown
drivers/thunderbolt/nhi.c | 1 + 1 file changed, 1 insertion(+)
Signature · 1 line
2.25.4
PATCH 1/1 thunderbolt: add trivial .shutdown
On my machine, a kexec with this driver loaded in the old kernel causes a very long delay on boot in the kexec'ed kernel, most likely due to unclean shutdown prior to that.
Unloading thunderbolt driver prior to kexec allows kexec to work as fast as regular kernel boot, as well as adding this .shutdown pointer.
Shutting a device prior to the shutdown completely is always a good idea IMHO to help with kexec,
and this one-liner patch implements it.
--- drivers/thunderbolt/nhi.c | 1 + 1 file changed, 1 insertion(+)
drivers/thunderbolt/nhi.c +1 -0
@@ -1285,6 +1285,7 @@ static struct pci_driver nhi_driver = { .id_table = nhi_ids, .probe = nhi_probe, .remove = nhi_remove, + .shutdown = nhi_remove, .driver.pm = &nhi_pm_ops, };
Signature · 1 line
2.25.4
Mika Westerberg
AppliedRe: [PATCH 1/1] thunderbolt: add trivial .shutdown
Quoted 21 lines · Maxim Levitsky
On my machine, a kexec with this driver loaded in the old kernel causes a very long delay on boot in the kexec'ed kernel, most likely due to unclean shutdown prior to that.
Unloading thunderbolt driver prior to kexec allows kexec to work as fast as regular kernel boot, as well as adding this .shutdown pointer.
Shutting a device prior to the shutdown completely is always a good idea IMHO to help with kexec,
and this one-liner patch implements it.Signed-off-by Maxim Levitsky <[email protected]>--- drivers/thunderbolt/nhi.c | 1 + 1 file changed, 1 insertion(+)drivers/thunderbolt/nhi.c +0
-0
drivers/thunderbolt/nhi.c static struct pci_driver nhi_driver = { · line 1288
Quoted 4 lines
drivers/thunderbolt/nhi.c +1
-0@@ -1285,6 +1285,7 @@ static struct pci_driver nhi_driver = { .id_table = nhi_ids, .probe = nhi_probe, .remove = nhi_remove, + .shutdown = nhi_remove,
I guess nhi_remove() does a bit more work than strictly required for .shutdown but we can deal with that later if needed.
Applied to thunderbolt.git/next, thanks!