Page MenuHomeFreeBSD

Use polling for SSU command during shutdown
Needs RevisionPublic

Authored by slm on Jun 1 2017, 7:39 PM.



Previously, the mps(4) driver used interrupts to check for SSU command completion. But if there is a panic during shutdown, interrupts stop and the system can hang if SSUs have not completed. Instead use polling to check if SSU commands have completed.

If this review is OK, I'll add it to the mpr(4) driver as well.

Test Plan

Harry Schmalzbauer <> has tested this in stable/11 with success.

Diff Detail

Lint Skipped
Unit Tests Skipped

Event Timeline

slm created this revision.Jun 1 2017, 7:39 PM
ken requested changes to this revision.Jun 2 2017, 3:36 PM

Well, the question is whether you only need to poll when we've paniced, or whether it's okay to poll on shutdown regardless. I don't know the answer right now. Are there other places that only do polling on shutdown?

As for the polling code, there are a couple of problems that Harry's testing revealed, so we'll need to fix those.


xpt_polled_action() does not cause the done routine to get called. Or at least it shouldn't. You'll need to do the cleanup (free the CCB and path) that has been going on in mpssas_stop_unit_done().

Also, according to Harald Schmalzbauer, this panics on shutdown. It looks like you probably need to acquire the device mutex before xpt_polled_action() and release it afterwards.

Take a look at how dadump() from the da(4) driver interacts with xpt_polled_action().

This revision now requires changes to proceed.Jun 2 2017, 3:36 PM
slm added a comment.Jun 2 2017, 4:59 PM

Yes, I saw Harry's emails. So, I'll need to do some of my own testing here to make sure things work at shutdown without a panic. I also saw that the lock changes did not work for Harry, so I'll need to look into that some more.