On 2026-07-16 14:22:19+03:00, saeed bishara wrote:
> On Tue, Jul 14, 2026 at 5:06 AM Arthur Kiyanovski <[email protected]> wrote:
>
> > + n_samples = data->request.num_samples;
> > + sts.clockid = data->request.clock_id;
> > + kfree(data);
> > + data = kzalloc(struct_size(data, timestamps, n_samples),
> > GFP_KERNEL);
> > + if (!data)
> > + return -ENOMEM;
>
> any idea why you free then allocate back?
>
> > --- a/include/linux/ptp_clock_kernel.h
> > +++ b/include/linux/ptp_clock_kernel.h
> > @@ -123,11 +123,34 @@ struct ptp_system_timestamp {
> > * reading the lowest bits of the PHC timestamp and the
> > second
> > * reading immediately follows that.
> > *
> > + * @gettimexattrs64: Reads the current time from the hardware clock and
> > + * optionally also the system clock with additional
> > clock
> > + * attributes.
> > + * parameter ts: Holds the PHC timestamp.
> > + * parameter sts: If not NULL, it holds a pair of
> > + * timestamps from the system clock. The first reading
> > is
> > + * made right before reading the lowest bits of the PHC
> > + * timestamp and the second reading immediately follows
> > that.
>
> The descriptions for ts and sts here are identical to gettimex64.
> Instead of duplicating this text, could we just refer back to the
> gettimex64 documentation?
Thanks. Both addressed in v5: ptp_sys_offset_{extended,precise}_attrs()
now copy the request header onto the stack and allocate the result
buffer once (no free + re-alloc), and the gettimexattrs64 /
getcrosststampattrs kernel-doc now references the base callbacks
instead of duplicating the text.