<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/ptp, branch v5.18.16</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.18.16</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.18.16'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-05-19T04:44:37Z</updated>
<entry>
<title>ptp: ocp: change sysfs attr group handling</title>
<updated>2022-05-19T04:44:37Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-05-17T21:46:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c2239294188fdbc3c58784a08d90edacd177bf9a'/>
<id>urn:sha1:c2239294188fdbc3c58784a08d90edacd177bf9a</id>
<content type='text'>
In the detach path, the driver calls sysfs_remove_group() for the
groups it believes has been registered.  However, if the group was
never previously registered, then this causes a splat.

Instead, compute the groups that should be registered in advance,
and then call sysfs_create_groups(), which registers them all at once.

Update the error handling appropriately.

Fixes: c205d53c4923 ("ptp: ocp: Add firmware capability bits for feature gating")
Reported-by: Zheyu Ma &lt;zheyuma97@gmail.com&gt;
Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/r/20220517214600.10606-1-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: have adjtime handle negative delta_ns correctly</title>
<updated>2022-05-16T20:07:46Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-05-13T22:52:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da2172a9bfec858ceeb0271b9d444378490398c8'/>
<id>urn:sha1:da2172a9bfec858ceeb0271b9d444378490398c8</id>
<content type='text'>
delta_ns is a s64, but it was being passed ptp_ocp_adjtime_coarse
as an u64.  Also, it turns out that timespec64_add_ns() only handles
positive values, so perform the math with set_normalized_timespec().

Fixes: 90f8f4c0e3ce ("ptp: ocp: Add ptp_ocp_adjtime_coarse for large adjustments")
Suggested-by: Vadim Fedorenko &lt;vfedorenko@novek.ru&gt;
Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Acked-by: Vadim Fedorenko &lt;vfedorenko@novek.ru&gt;
Link: https://lore.kernel.org/r/20220513225231.1412-1-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: Use DIV64_U64_ROUND_UP for rounding.</title>
<updated>2022-05-10T00:18:41Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-05-06T22:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4bd46bb037f8e1883dbe1fc9e79896b7f885db3f'/>
<id>urn:sha1:4bd46bb037f8e1883dbe1fc9e79896b7f885db3f</id>
<content type='text'>
The initial code used roundup() to round the starting time to
a multiple of a period.  This generated an error on 32-bit
systems, so was replaced with DIV_ROUND_UP_ULL().

However, this truncates to 32-bits on a 64-bit system.  Replace
with DIV64_U64_ROUND_UP() instead.

Fixes: b325af3cfab9 ("ptp: ocp: Add signal generators and update sysfs nodes")
Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/r/20220506223739.1930-2-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: handle error from nvmem_device_find</title>
<updated>2022-03-30T19:08:11Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-03-29T16:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8f0588e80e33273c2fa219da4622affab0cdd22f'/>
<id>urn:sha1:8f0588e80e33273c2fa219da4622affab0cdd22f</id>
<content type='text'>
nvmem_device_find returns a valid pointer or IS_ERR().
Handle this properly.

Fixes: 0cfcdd1ebcfe ("ptp: ocp: add nvmem interface for accessing eeprom")
Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/r/20220329160354.4035-1-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: use snprintf() in ptp_ocp_verify()</title>
<updated>2022-03-19T04:42:09Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2022-03-18T07:47:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5f497b889794161facc1522d86720b587d1c0b7'/>
<id>urn:sha1:d5f497b889794161facc1522d86720b587d1c0b7</id>
<content type='text'>
This code is fine, but it's easier to review if we use snprintf()
instead of sprintf().

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/r/20220318074723.GA6617@kili
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: Make debugfs variables the correct bitwidth</title>
<updated>2022-03-18T00:38:37Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-03-16T16:53:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2b341f7532d4f6c8b84206daad202a745962b844'/>
<id>urn:sha1:2b341f7532d4f6c8b84206daad202a745962b844</id>
<content type='text'>
An earlier patch mistakenly changed these variables from u32 to u16,
leading to unintended truncation.  Restore the original logic.

Fixes: a509a7c61e3b ("ptp: ocp: Add support for selectable SMA directions.")
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/r/20220316165347.599154-1-jonathan.lemon@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: Fix PTP_PF_* verification requests</title>
<updated>2022-03-17T09:35:47Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-03-15T19:46:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=05fc65f3f5e45e8194e16b8e43e92133ada06e26'/>
<id>urn:sha1:05fc65f3f5e45e8194e16b8e43e92133ada06e26</id>
<content type='text'>
Update and check functionality for pin configuration requests:

PTP_PF_NONE: requests "IN: None", disabling the pin.

  # testptp -d /dev/ptp3 -L3,0 -i1
  set pin function okay
  # cat sma4
  IN: None

PTP_PF_EXTTS: should configure external timestamps, but since the
timecard can steer inputs to multiple inputs as well as timestamps,
allow the request, but don't change configurations.

  # testptp -d /dev/ptp3 -L3,1 -i1
  set pin function okay

  (no functional or configuration change here yet)

PTP_PF_PEROUT: Channel 0 is the PHC, at 1PPS.  Channels 1-4 are
the programmable frequency generators.

  # fails because period is not 1PPS.
  # testptp -d /dev/ptp3 -L3,2 -i0  -p 500000000
  PTP_PEROUT_REQUEST: Invalid argument

  # testptp -d /dev/ptp3 -L3,2 -i0  -p 1000000000
  periodic output request okay
  # cat sma4
  OUT: PHC

  # testptp -d /dev/ptp3 -L3,2 -i1 -p 500000000 -w 200000000
  periodic output request okay
  # cat sma4
  OUT: GEN1
  # cat gen1/signal
  500000000 40 0 1 2022-03-10T23:55:26 TAI
  # cat gen1/running
  1

  # testptp -d /dev/ptp3 -L3,2 -i1 -p 0
  periodic output request okay
  # cat gen1/running
  0

Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Link: https://lore.kernel.org/r/20220315194626.1895-1-jonathan.lemon@gmail.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: Add 2 more timestampers</title>
<updated>2022-03-11T11:54:45Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-03-10T20:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0fa3ff7eb02ad9012f8f8c5477b185878e0a82af'/>
<id>urn:sha1:0fa3ff7eb02ad9012f8f8c5477b185878e0a82af</id>
<content type='text'>
The timecard now has 4 general purpose timestampers.

Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: Add 4 frequency counters</title>
<updated>2022-03-11T11:54:45Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-03-10T20:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2407f5d620172fb0f0321e5ebbbf4de99401a0bc'/>
<id>urn:sha1:2407f5d620172fb0f0321e5ebbbf4de99401a0bc</id>
<content type='text'>
Input signals can be steered to any of the frequency counters.
The counter measures the frequency over a number of seconds:

  echo 0 &gt; freq1/seconds  = turns off measurement
  echo 1 &gt; freq1/seconds  = sets period &amp; turns on measurment.

Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: Program the signal generators via PTP_CLK_REQ_PEROUT</title>
<updated>2022-03-11T11:54:45Z</updated>
<author>
<name>Jonathan Lemon</name>
<email>jonathan.lemon@gmail.com</email>
</author>
<published>2022-03-10T20:19:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1aa66a3a135a25bd8ce25165b4e550159a3dc849'/>
<id>urn:sha1:1aa66a3a135a25bd8ce25165b4e550159a3dc849</id>
<content type='text'>
The signal generators can be programmed either via the sysfs
file or through a PTP_CLK_REQ_PEROUT ioctl request.

Signed-off-by: Jonathan Lemon &lt;jonathan.lemon@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
