<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/ptp/ptp_clock.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-03-11T23:03:15Z</updated>
<entry>
<title>ptp: Move from simple ida to xarray</title>
<updated>2024-03-11T23:03:15Z</updated>
<author>
<name>Kory Maincent</name>
<email>kory.maincent@bootlin.com</email>
</author>
<published>2024-03-11T14:47:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f095fefacdd35b4ea97dc6d88d054f2749a73d07'/>
<id>urn:sha1:f095fefacdd35b4ea97dc6d88d054f2749a73d07</id>
<content type='text'>
Move from simple ida to xarray for storing and loading the ptp_clock
pointer. This prepares support for future hardware timestamp selection by
being able to link the ptp clock index to its pointer.

Signed-off-by: Kory Maincent &lt;kory.maincent@bootlin.com&gt;
Reviewed-by: Przemek Kitszel &lt;przemyslaw.kitszel@intel.com&gt;
Link: https://lore.kernel.org/r/20240311144730.1239594-1-kory.maincent@bootlin.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: make ptp_class constant</title>
<updated>2024-03-11T20:42:09Z</updated>
<author>
<name>Ricardo B. Marliere</name>
<email>ricardo@marliere.net</email>
</author>
<published>2024-03-05T20:11:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c057eddcb45ac13db487fa413f75611c69aad600'/>
<id>urn:sha1:c057eddcb45ac13db487fa413f75611c69aad600</id>
<content type='text'>
Since commit 43a7206b0963 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the ptp_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Suggested-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ricardo B. Marliere &lt;ricardo@marliere.net&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://lore.kernel.org/r/20240305-ptp-v1-1-ed253eb33c20@marliere.net
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: introduce PTP_CLOCK_EXTOFF event for the measured external offset</title>
<updated>2024-01-29T13:00:23Z</updated>
<author>
<name>Min Li</name>
<email>min.li.xe@renesas.com</email>
</author>
<published>2024-01-24T18:49:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ea1cc3ee34a5f3144f6c2cdc07c19c914ccb9526'/>
<id>urn:sha1:ea1cc3ee34a5f3144f6c2cdc07c19c914ccb9526</id>
<content type='text'>
This change is for the PHC devices that can measure the phase offset
between PHC signal and the external signal, such as the 1PPS signal of
GNSS. Reporting PTP_CLOCK_EXTOFF to user space will be piggy-backed to
the existing ptp_extts_event so that application such as ts2phc can
poll the external offset the same way as extts. Hence, ts2phc can use
the offset to achieve the alignment between PHC and the external signal
by the help of either SW or HW filters.

Signed-off-by: Min Li &lt;min.li.xe@renesas.com&gt;
Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ptp: annotate data-race around q-&gt;head and q-&gt;tail</title>
<updated>2023-11-14T04:51:37Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2023-11-09T17:48:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=73bde5a3294853947252cd9092a3517c7cb0cd2d'/>
<id>urn:sha1:73bde5a3294853947252cd9092a3517c7cb0cd2d</id>
<content type='text'>
As I was working on a syzbot report, I found that KCSAN would
probably complain that reading q-&gt;head or q-&gt;tail without
barriers could lead to invalid results.

Add corresponding READ_ONCE() and WRITE_ONCE() to avoid
load-store tearing.

Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Link: https://lore.kernel.org/r/20231109174859.3995880-1-edumazet@google.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: fix corrupted list in ptp_open</title>
<updated>2023-11-09T02:47:07Z</updated>
<author>
<name>Edward Adam Davis</name>
<email>eadavis@qq.com</email>
</author>
<published>2023-11-07T08:00:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1bea2c3e6df8caf45d18384abfb707f47e9ff993'/>
<id>urn:sha1:1bea2c3e6df8caf45d18384abfb707f47e9ff993</id>
<content type='text'>
There is no lock protection when writing ptp-&gt;tsevqs in ptp_open() and
ptp_release(), which can cause data corruption, use spin lock to avoid this
issue.

Moreover, ptp_release() should not be used to release the queue in ptp_read(),
and it should be deleted altogether.

Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Reported-and-tested-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com
Fixes: 8f5de6fb2453 ("ptp: support multiple timestamp event readers")
Signed-off-by: Edward Adam Davis &lt;eadavis@qq.com&gt;
Link: https://lore.kernel.org/r/tencent_CD19564FFE8DA8A5918DFE92325D92DD8107@qq.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: prevent string overflow</title>
<updated>2023-10-19T22:51:52Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@linaro.org</email>
</author>
<published>2023-10-18T14:20:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=75a384ceda93df0ec2436f0188e58f166a609c49'/>
<id>urn:sha1:75a384ceda93df0ec2436f0188e58f166a609c49</id>
<content type='text'>
The ida_alloc_max() function can return up to INT_MAX so this buffer is
not large enough.  Also use snprintf() for extra safety.

Fixes: 403376ddb422 ("ptp: add debugfs interface to see applied channel masks")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Przemek Kitszel &lt;przemyslaw.kitszel@intel.com&gt;
Link: https://lore.kernel.org/r/d4b1a995-a0cb-4125-aa1d-5fd5044aba1d@moroto.mountain
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: add debugfs interface to see applied channel masks</title>
<updated>2023-10-15T19:07:52Z</updated>
<author>
<name>Xabier Marquiegui</name>
<email>reibax@gmail.com</email>
</author>
<published>2023-10-11T22:39:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=403376ddb4221be9db5326ae334773807df71ffe'/>
<id>urn:sha1:403376ddb4221be9db5326ae334773807df71ffe</id>
<content type='text'>
Use debugfs to be able to view channel mask applied to every timestamp
event queue.

Every time the device is opened, a new entry is created in
`$DEBUGFS_MOUNTPOINT/ptpN/$INSTANCE_ADDRESS/mask`.

The mask value can be viewed grouped in 32bit decimal values using cat,
or converted to hexadecimal with the included `ptpchmaskfmt.sh` script.
32 bit values are listed from least significant to most significant.

Signed-off-by: Xabier Marquiegui &lt;reibax@gmail.com&gt;
Suggested-by: Vinicius Costa Gomes &lt;vinicius.gomes@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ptp: support event queue reader channel masks</title>
<updated>2023-10-15T19:07:52Z</updated>
<author>
<name>Xabier Marquiegui</name>
<email>reibax@gmail.com</email>
</author>
<published>2023-10-11T22:39:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c5a445b1e9347b14752b01f1a304bd7a2f260acc'/>
<id>urn:sha1:c5a445b1e9347b14752b01f1a304bd7a2f260acc</id>
<content type='text'>
On systems with multiple timestamp event channels, some readers might
want to receive only a subset of those channels.

Add the necessary modifications to support timestamp event channel
filtering, including two IOCTL operations:

- Clear all channels
- Enable one channel

The mask modification operations will be applied exclusively on the
event queue assigned to the file descriptor used on the IOCTL operation,
so the typical procedure to have a reader receiving only a subset of the
enabled channels would be:

- Open device file
- ioctl: clear all channels
- ioctl: enable one channel
- start reading

Calling the enable one channel ioctl more than once will result in
multiple enabled channels.

Signed-off-by: Xabier Marquiegui &lt;reibax@gmail.com&gt;
Suggested-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Suggested-by: Vinicius Costa Gomes &lt;vinicius.gomes@intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ptp: support multiple timestamp event readers</title>
<updated>2023-10-15T19:07:52Z</updated>
<author>
<name>Xabier Marquiegui</name>
<email>reibax@gmail.com</email>
</author>
<published>2023-10-11T22:39:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8f5de6fb245326704f37d91780b9a10253a8a100'/>
<id>urn:sha1:8f5de6fb245326704f37d91780b9a10253a8a100</id>
<content type='text'>
Use linked lists to create one event queue per open file. This enables
simultaneous readers for timestamp event queues.

Signed-off-by: Xabier Marquiegui &lt;reibax@gmail.com&gt;
Suggested-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ptp: Replace timestamp event queue with linked list</title>
<updated>2023-10-15T19:07:52Z</updated>
<author>
<name>Xabier Marquiegui</name>
<email>reibax@gmail.com</email>
</author>
<published>2023-10-11T22:39:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d26ab5a35ad9920940a9e07665130d501b2ae1a3'/>
<id>urn:sha1:d26ab5a35ad9920940a9e07665130d501b2ae1a3</id>
<content type='text'>
Introduce linked lists to access the timestamp event queue.

Signed-off-by: Xabier Marquiegui &lt;reibax@gmail.com&gt;
Suggested-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
