Re: [PATCH v8 10/12] pps: generators: Add PPS Generator TIO Driver
From: Andy Shevchenko
Date: Mon May 13 2024 - 07:20:30 EST
On Mon, May 13, 2024 at 02:18:49PM +0300, Andy Shevchenko wrote:
> On Mon, May 13, 2024 at 04:08:11PM +0530, lakshmi.sowjanya.d@xxxxxxxxx wrote:
> > + pps_tio_disable(tio);
>
> This...
> > + tio->enabled = false;
>
> ...and this should go together, which makes me look at the enabled flag over
> the code and it seems there are a few places where you missed to sync it with
> the reality.
>
> I would think of something like this:
>
> pps_tio_direction_output() ==> true
> pps_tio_disable(tio) ==> false
>
> where "==> X" means assignment of enabled flag.
>
> And perhaps this:
>
> tio->enabled = pps_generate_next_pulse(tio, expires + SAFE_TIME_NS);
> if (!tio->enabled)
> ...
>
> But the above is just thinking out loudly, you may find the better approach(es).
You might need to introduce pps_tio_enable() counterpart, in such case it would
be more natural to have enabled be assigned accordingly.
--
With Best Regards,
Andy Shevchenko