Page MenuHomeFreeBSD

ow_temp: drop the lock around a call that can sleep
ClosedPublic

Authored by avg on Oct 22 2019, 2:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 6, 1:45 AM
Unknown Object (File)
Feb 19 2024, 11:20 PM
Unknown Object (File)
Dec 20 2023, 12:43 AM
Unknown Object (File)
Nov 8 2023, 12:02 PM
Unknown Object (File)
Nov 7 2023, 5:26 PM
Unknown Object (File)
Nov 7 2023, 1:59 AM
Unknown Object (File)
Nov 6 2023, 9:51 AM
Unknown Object (File)
Oct 7 2023, 10:57 AM
Subscribers
None

Details

Summary

This is similar to what is done around other calls that lead to
own_command_wait() that can sleep.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27148
Build 25422: arc lint + arc unit

Event Timeline

I'd move the lock to after the if that might do a printf.
Otherwise, this is the right thing to do. We use temp_lock to protect sc->flags only, so this drop doesn't affect that.
In fact, we can go much further than this as noted.
The locking wasn't really attended to when I wrote this driver and I used old-school patterns.

sys/dev/ow/ow_temp.c
148

I'd move this down 2 lines.

151

I'd put the lock just before this while() statement.

159

We can move this lock up to before the for loop.

161

and then delete this line.

185

And pick up the lock just before calling msleep.

This revision is now accepted and ready to land.Oct 22 2019, 3:39 PM
This revision was automatically updated to reflect the committed changes.