Page MenuHomeFreeBSD

LinuxKPI: add read_poll_timeout()
ClosedPublic

Authored by bz on Jul 1 2021, 1:31 PM.

Details

Summary

Add a partial implementation of read_poll_timeout() which I did at
some point last year for rtw88.

MFC after: 10 days

Diff Detail

Repository
R10 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

bz requested review of this revision.Jul 1 2021, 1:31 PM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/iopoll.h
41

Should the code use a sleepable delay in case of non-atomic?

Ping. See my comment.

Sorry, if you need it urgently please feel free to improve/finish the code. I can test quickly if needed. Feel free to push to this review even.

Work on feedback from hselasky and try to finish the implementation
based on descriptions found. I probably should go back and see if the
reworked linux/delay.h functions are more suitable now?

Use usleep_range now so I don't have to deal with pause_sbt()
which probably also wanted the HARDCLOCK hint otherwise.

sys/compat/linuxkpi/common/include/linux/iopoll.h
41

_to -> (_to)

Missing parenthesis.

47

ditto: _us && _early_sleep need parenthesis.

68

ditto.

bz marked 4 inline comments as done.Jul 28 2021, 1:42 PM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/iopoll.h
66

Maybe name internal variables with "__" first?

This revision is now accepted and ready to land.Jul 28 2021, 2:26 PM

Prefix internal variables with __ even though it should not
make a difference given they are inside a block.

This revision now requires review to proceed.Jul 28 2021, 3:16 PM
This revision is now accepted and ready to land.Jul 28 2021, 3:35 PM
This revision was automatically updated to reflect the committed changes.