Make cam_periph_runccb be safe to call when we can only do polling.
ClosedPublic

Authored by imp on Dec 6 2017, 1:25 AM.

Details

Summary

Make cam_periph_runccb() safe for calling when we have to poll. Update
to reflect that cam_periph_runccb() can be called from situations
where the kernel scheduler is stopped, replace the by hand calling of
xpt_polled_action() with it.

Sponsored by: Netflix

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.
imp created this revision.Dec 6 2017, 1:25 AM
cem added inline comments.Dec 6 2017, 2:28 AM
sys/cam/cam_periph.c
1212 ↗(On Diff #36277)

Maybe name it pollwait for consistency with ccbwait. To me poll alone implies checking once, rather than the timeout sleep-wait-retry loop xpt_poll implements.

sys/cam/cam_xpt.c
3249–3250 ↗(On Diff #36277)

inconsistent whitespace here

3252 ↗(On Diff #36277)

What's the point of passing a timeout argument if it is immediately overwritten?

3256 ↗(On Diff #36277)

style(9) nit: whitespace

3263 ↗(On Diff #36277)

extra whitespace here

3284 ↗(On Diff #36277)

inconsistent whitespace

imp updated this revision to Diff 36302.Dec 6 2017, 4:34 PM

fix review nits

imp marked 6 inline comments as done.Dec 6 2017, 4:38 PM
imp added inline comments.
sys/cam/cam_xpt.c
3249–3250 ↗(On Diff #36277)

the whitespace is now consistent, but phab is having fits with tabs.

3284 ↗(On Diff #36277)

It's now consistent, but again, phab is having rendering issues.

cem accepted this revision.Dec 6 2017, 5:31 PM
This revision is now accepted and ready to land.Dec 6 2017, 5:31 PM
This revision was automatically updated to reflect the committed changes.
imp marked 2 inline comments as done.