Page MenuHomeFreeBSD

ppbus: Set the lock for pps interface, update to latest api
ClosedPublic

Authored by imp on Sep 1 2021, 4:32 AM.
Tags
None
Referenced Files
F81619521: D31763.id94507.diff
Fri, Apr 19, 2:09 AM
F81577049: D31763.id.diff
Thu, Apr 18, 9:24 AM
Unknown Object (File)
Tue, Apr 16, 6:22 AM
Unknown Object (File)
Feb 9 2024, 8:01 PM
Unknown Object (File)
Dec 25 2023, 12:28 PM
Unknown Object (File)
Dec 20 2023, 5:00 PM
Unknown Object (File)
Dec 20 2023, 2:04 AM
Unknown Object (File)
Nov 30 2023, 7:56 AM
Subscribers

Details

Summary

Since we take a lock when we enter the ioctl, we need to set driver_mtx
in the pps structure so it can be dropped while sleeping during a call
to timepps_fetch() with a non-zero timeout (PPS_CANWAIT feature).

Sponsored by: Netflix

Diff Detail

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

Event Timeline

imp requested review of this revision.Sep 1 2021, 4:32 AM
imp created this revision.
ian added inline comments.
sys/dev/ppbus/pps.c
148

The code here also needs to indicate it's aware of the new pps abi that allows sharing the driver's mutex by calling pps_init_abi() instead of pps_init(). The code inside the loop below also needs to look like this.

	sc->pps[0].ppscap = PPS_CAPTUREASSERT | PPS_ECHOASSERT;
	sc->sc_pps.driver_abi = PPS_ABI_VERSION;
	sc->sc_pps.driver_mtx = ppb_get_lock(ppbus);
	pps_init_abi(&sc->pps[0]);
sys/dev/ppbus/pps.c
148

Thanks Ian! I missed that detail last night. I'll respin.

imp retitled this revision from ppbus: Set the lock for pps interface to ppbus: Set the lock for pps interface, update to latest api.Sep 1 2021, 5:44 PM
imp edited the summary of this revision. (Show Details)

Update with Ian's patch that Criag tested.

sys/dev/ppbus/pps.c
148

Done and updated.

others have suggested diffs to me by enclosing them in triple backticks which doesn't steal the review.

imp marked an inline comment as done.Sep 1 2021, 5:46 PM

I would be a bit more wordy in the commit, something like;

Since we take a lock when we enter the ioctl, we need to set driver_mtx
in the pps structure so it can be dropped while sleeping during a call
to timepps_fetch() with a non-zero timeout (PPS_CANWAIT feature).

This revision is now accepted and ready to land.Sep 1 2021, 5:56 PM
In D31763#716893, @ian wrote:

I would be a bit more wordy in the commit, something like...

I like it.

This revision now requires review to proceed.Sep 1 2021, 6:27 PM
This revision is now accepted and ready to land.Sep 1 2021, 6:54 PM