Re: [PATCH v4] pps: Add elapsed realtime timestamping

From: Rodolfo Giometti
Date: Fri Mar 17 2023 - 10:05:41 EST


On 17/03/23 10:51, Alex Komrakov wrote:
+     if (!(pps->info.mode & PPS_CAPTURECLEAR))
+             return 0;   Why are you not returning an error?
[AK] I used the style in this file sysfs.c.
 assert_show() and clear_show()  have the same condition.
When '& PPS_CAPTURECLEAR' -- 0 means no interrupt asserted  and it is not error
Probably Rodolfo can get more info why return 0

It's just as Alex said, if the PPS source has no PPS_CAPTUREASSERT or PPS_CAPTURECLEAR mode it should not print ASSERT and CLEAR info.

And why are these sysfs files even present if the mode is not set
properly?  Can the mode be set while the device is attached or is this
only defined at probe time?  If at probe time, just never create these
files.
[AK] we can understand mode is set when interrupts asserted and file assert_elapsed will be updated.

PPS source's "mode bits" can be set at runtime via PPS_SETPARAMS.

Ciao,

Rodolfo

--
GNU/Linux Solutions e-mail: giometti@xxxxxxxxxxxx
Linux Device Driver giometti@xxxxxxxx
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti