Page MenuHomeFreeBSD

Use polling for SSU command during shutdown
Needs RevisionPublic

Authored by slm on Jun 1 2017, 7:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 15, 1:58 AM
Unknown Object (File)
Jan 13 2024, 9:23 AM
Unknown Object (File)
Dec 20 2023, 1:24 AM
Unknown Object (File)
Nov 21 2023, 6:45 PM
Unknown Object (File)
Nov 20 2023, 8:02 AM
Unknown Object (File)
Nov 9 2023, 5:58 PM
Unknown Object (File)
Nov 9 2023, 5:58 PM
Unknown Object (File)
Oct 17 2023, 6:58 PM
Subscribers
None

Details

Reviewers
scottl
ken
Summary

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 <freebsd@omnilan.de> has tested this in stable/11 with success.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

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.

sys/dev/mps/mps_sas_lsi.c
1175

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

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.