Page MenuHomeFreeBSD

Fix mps deadlock when handling panic
ClosedPublic

Authored by smh on Oct 24 2017, 2:46 PM.

Details

Summary

During shutdown mps waits for its SSU requests to complete however when performing a reboot after handling a panic the scheduler is stopped so getmicrotime which is used here can non-functional.

Switch to using the same method as shutdown_panic to ensure we actually complete.

In addition reduce the timeout when RB_NOSYNC is set in howto as we expect this to fail.

Test Plan

Confirm a machine with an mps controller with used devices completes the reboot process when a panic is triggered with:
debug.kdb.panic=1

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

smh created this revision.Oct 24 2017, 2:46 PM
manu accepted this revision.Oct 24 2017, 2:49 PM

Tested By: manu

Thanks,

This revision is now accepted and ready to land.Oct 24 2017, 2:49 PM
manu added a comment.Nov 13 2017, 8:55 AM

ping timeout from scottl ?
Should we commit that and if scottl doesn't like something rework it later ?

slm requested changes to this revision.Nov 13 2017, 4:56 PM
slm added inline comments.
sys/dev/mps/mps_sas_lsi.c
128 ↗(On Diff #34289)

Can you add the name of the parameter too ('howto'), just to be consistent with the other prototypes.

1253 ↗(On Diff #34289)

I'm not seeing how this gets the 'howto' parameter sent into the function. I guess I'm just missing it. Can you explain?

sys/dev/mps/mpsvar.h
749 ↗(On Diff #34289)

Name of variable here too, for consistency with other prototypes.

This revision now requires changes to proceed.Nov 13 2017, 4:56 PM
slm added a comment.Nov 13 2017, 5:00 PM

Also, if this works for mps it should go into mpr as well.

smh updated this revision to Diff 40297.Mar 14 2018, 9:03 PM

Added howto param name to prototypes.

smh marked 3 inline comments as done.Mar 14 2018, 9:04 PM
smh added inline comments.
sys/dev/mps/mps_sas_lsi.c
1253 ↗(On Diff #34289)

kern_reboot triggers this with by calling all registered handlers with a howto parameter

EVENTHANDLER_INVOKE(shutdown_final, howto);

smh marked an inline comment as done.Mar 14 2018, 9:06 PM

Sorry guys this dropped off my radar, only just spotted your updates when reviewing other changes.

I've updated based on feedback and answered the last outstanding question, so hopefully we can get this in soon.

slm accepted this revision.Mar 14 2018, 9:08 PM
This revision is now accepted and ready to land.Mar 14 2018, 9:08 PM
This revision was automatically updated to reflect the committed changes.