<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/ptp, branch v6.1.124</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.124</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.124'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-12-19T17:08:53+00:00</updated>
<entry>
<title>ptp: kvm: x86: Return EOPNOTSUPP instead of ENODEV from kvm_arch_ptp_init()</title>
<updated>2024-12-19T17:08:53+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-12-03T17:09:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9724cb1881995ea70f0ed3c77490c58421afa5ad'/>
<id>urn:sha1:9724cb1881995ea70f0ed3c77490c58421afa5ad</id>
<content type='text'>
[ Upstream commit 5e7aa97c7acf171275ac02a8bb018c31b8918d13 ]

The caller, ptp_kvm_init(), emits a warning if kvm_arch_ptp_init() exits
with any error which is not EOPNOTSUPP:

	"fail to initialize ptp_kvm"

Replace ENODEV with EOPNOTSUPP to avoid this spurious warning,
aligning with the ARM implementation.

Fixes: a86ed2cfa13c ("ptp: Don't print an error if ptp_kvm is not supported")
Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Link: https://patch.msgid.link/20241203-kvm_ptp-eopnotsuppp-v2-1-d1d060f27aa6@weissschuh.net
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: kvm: Use decrypted memory in confidential guest on x86</title>
<updated>2024-12-19T17:08:53+00:00</updated>
<author>
<name>Jeremi Piotrowski</name>
<email>jpiotrowski@linux.microsoft.com</email>
</author>
<published>2023-03-08T15:05:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ea817f40dbb78dc8fe0b073b2d069eb721e32aa'/>
<id>urn:sha1:5ea817f40dbb78dc8fe0b073b2d069eb721e32aa</id>
<content type='text'>
[ Upstream commit 6365ba64b4dbe8b59ddaeaa724b281f3787715d5 ]

KVM_HC_CLOCK_PAIRING currently fails inside SEV-SNP guests because the
guest passes an address to static data to the host. In confidential
computing the host can't access arbitrary guest memory so handling the
hypercall runs into an "rmpfault". To make the hypercall work, the guest
needs to explicitly mark the memory as decrypted. Do that in
kvm_arch_ptp_init(), but retain the previous behavior for
non-confidential guests to save us from having to allocate memory.

Add a new arch-specific function (kvm_arch_ptp_exit()) to free the
allocation and mark the memory as encrypted again.

Signed-off-by: Jeremi Piotrowski &lt;jpiotrowski@linux.microsoft.com&gt;
Link: https://lore.kernel.org/r/20230308150531.477741-1-jpiotrowski@linux.microsoft.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Stable-dep-of: 5e7aa97c7acf ("ptp: kvm: x86: Return EOPNOTSUPP instead of ENODEV from kvm_arch_ptp_init()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: Add error handling for adjfine callback in ptp_clock_adjtime</title>
<updated>2024-12-14T18:54:21+00:00</updated>
<author>
<name>Ajay Kaher</name>
<email>ajay.kaher@broadcom.com</email>
</author>
<published>2024-11-25T10:59:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=085980b68b035411c1f535ce34d53fbf1091e537'/>
<id>urn:sha1:085980b68b035411c1f535ce34d53fbf1091e537</id>
<content type='text'>
[ Upstream commit 98337d7c87577ded71114f6976edb70a163e27bc ]

ptp_clock_adjtime sets ptp-&gt;dialed_frequency even when adjfine
callback returns an error. This causes subsequent reads to return
an incorrect value.

Fix this by adding error check before ptp-&gt;dialed_frequency is set.

Fixes: 39a8cbd9ca05 ("ptp: remember the adjusted frequency")
Signed-off-by: Ajay Kaher &lt;ajay.kaher@broadcom.com&gt;
Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Link: https://patch.msgid.link/20241125105954.1509971-1-ajay.kaher@broadcom.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: convert remaining drivers to adjfine interface</title>
<updated>2024-12-14T18:54:21+00:00</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.e.keller@intel.com</email>
</author>
<published>2022-11-09T23:09:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4db84fc352d6a2e311fd59841f57e2f667d91942'/>
<id>urn:sha1:4db84fc352d6a2e311fd59841f57e2f667d91942</id>
<content type='text'>
[ Upstream commit e2bd9c76c89fbe25df351fc5902cbbcca6a7d372 ]

Convert all remaining drivers that still use .adjfreq to the newer .adjfine
implementation. These drivers are not straightforward, as they use
non-standard methods of programming their hardware. They are all converted
to use scaled_ppm_to_ppb to get the parts per billion value that their
logic depends on.

Signed-off-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Cc: Ariel Elior &lt;aelior@marvell.com&gt;
Cc: Sudarsana Kalluru &lt;skalluru@marvell.com&gt;
Cc: Manish Chopra &lt;manishc@marvell.com&gt;
Cc: Derek Chickles &lt;dchickles@marvell.com&gt;
Cc: Satanand Burla &lt;sburla@marvell.com&gt;
Cc: Felix Manlunas &lt;fmanlunas@marvell.com&gt;
Cc: Raju Rangoju &lt;rajur@chelsio.com&gt;
Cc: Joakim Zhang &lt;qiangqing.zhang@nxp.com&gt;
Cc: Edward Cree &lt;ecree.xilinx@gmail.com&gt;
Cc: Martin Habets &lt;habetsm.xilinx@gmail.com&gt;
Cc: Richard Cochran &lt;richardcochran@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Stable-dep-of: 98337d7c8757 ("ptp: Add error handling for adjfine callback in ptp_clock_adjtime")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: fix integer overflow in max_vclocks_store</title>
<updated>2024-06-27T11:46:19+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@linaro.org</email>
</author>
<published>2024-06-17T09:34:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d50d62d5e6ee6aa03c00bddb91745d0b632d3b0f'/>
<id>urn:sha1:d50d62d5e6ee6aa03c00bddb91745d0b632d3b0f</id>
<content type='text'>
[ Upstream commit 81d23d2a24012e448f651e007fac2cfd20a45ce0 ]

On 32bit systems, the "4 * max" multiply can overflow.  Use kcalloc()
to do the allocation to prevent this.

Fixes: 44c494c8e30e ("ptp: track available ptp vclocks information")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Wojciech Drewek &lt;wojciech.drewek@intel.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Reviewed-by: Heng Qi &lt;hengqi@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/ee8110ed-6619-4bd7-9024-28c1f2ac24f4@moroto.mountain
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: Fix error message on failed pin verification</title>
<updated>2024-06-21T12:35:35+00:00</updated>
<author>
<name>Karol Kolacinski</name>
<email>karol.kolacinski@intel.com</email>
</author>
<published>2024-06-04T12:05:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=952557eb6eac3286b82441c036ee4e65917913b7'/>
<id>urn:sha1:952557eb6eac3286b82441c036ee4e65917913b7</id>
<content type='text'>
[ Upstream commit 323a359f9b077f382f4483023d096a4d316fd135 ]

On failed verification of PTP clock pin, error message prints channel
number instead of pin index after "pin", which is incorrect.

Fix error message by adding channel number to the message and printing
pin number instead of channel number.

Fixes: 6092315dfdec ("ptp: introduce programmable pins.")
Signed-off-by: Karol Kolacinski &lt;karol.kolacinski@intel.com&gt;
Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Link: https://lore.kernel.org/r/20240604120555.16643-1-karol.kolacinski@intel.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: annotate data-race around q-&gt;head and q-&gt;tail</title>
<updated>2023-11-28T17:07:05+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2023-11-09T17:48:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f84846731b937bcb82ac998cc7e2e62325d0ecf9'/>
<id>urn:sha1:f84846731b937bcb82ac998cc7e2e62325d0ecf9</id>
<content type='text'>
[ Upstream commit 73bde5a3294853947252cd9092a3517c7cb0cd2d ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: ocp: Fix error handling in ptp_ocp_device_init</title>
<updated>2023-10-10T20:00:42+00:00</updated>
<author>
<name>Dinghao Liu</name>
<email>dinghao.liu@zju.edu.cn</email>
</author>
<published>2023-09-22T09:40:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a91ec7cfd0e242d7d7537206985541e58aa8bf4'/>
<id>urn:sha1:6a91ec7cfd0e242d7d7537206985541e58aa8bf4</id>
<content type='text'>
[ Upstream commit caa0578c1d487d39e4bb947a1b4965417053b409 ]

When device_add() fails, ptp_ocp_dev_release() will be called
after put_device(). Therefore, it seems that the
ptp_ocp_dev_release() before put_device() is redundant.

Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.")
Signed-off-by: Dinghao Liu &lt;dinghao.liu@zju.edu.cn&gt;
Reviewed-by: Vadim Feodrenko &lt;vadim.fedorenko@linux.dev&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp_qoriq: fix memory leak in probe()</title>
<updated>2023-04-06T10:10:44+00:00</updated>
<author>
<name>SongJingyi</name>
<email>u201912584@hust.edu.cn</email>
</author>
<published>2023-03-24T03:14:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=43b4331ce0cd88ccba425e0702ba35c1a52daccf'/>
<id>urn:sha1:43b4331ce0cd88ccba425e0702ba35c1a52daccf</id>
<content type='text'>
[ Upstream commit f33642224e38d7e0d59336e10e7b4e370b1c4506 ]

Smatch complains that:
drivers/ptp/ptp_qoriq.c ptp_qoriq_probe()
warn: 'base' from ioremap() not released.

Fix this by revising the parameter from 'ptp_qoriq-&gt;base' to 'base'.
This is only a bug if ptp_qoriq_init() returns on the
first -ENODEV error path.
For other error paths ptp_qoriq-&gt;base and base are the same.
And this change makes the code more readable.

Fixes: 7f4399ba405b ("ptp_qoriq: fix NULL access if ptp dt node missing")
Signed-off-by: SongJingyi &lt;u201912584@hust.edu.cn&gt;
Reviewed-by: Dan Carpenter &lt;error27@gmail.com&gt;
Reviewed-by: Dongliang Mu &lt;dzm91@hust.edu.cn&gt;
Link: https://lore.kernel.org/r/20230324031406.1895159-1-u201912584@hust.edu.cn
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ptp: vclock: use mutex to fix "sleep on atomic" bug</title>
<updated>2023-03-11T12:55:25+00:00</updated>
<author>
<name>Íñigo Huguet</name>
<email>ihuguet@redhat.com</email>
</author>
<published>2023-02-21T13:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f94becae90b04b2d1580548d8cd70653eb8dfb17'/>
<id>urn:sha1:f94becae90b04b2d1580548d8cd70653eb8dfb17</id>
<content type='text'>
[ Upstream commit 67d93ffc0f3c47094750bde6d62e7c5765dc47a6 ]

vclocks were using spinlocks to protect access to its timecounter and
cyclecounter. Access to timecounter/cyclecounter is backed by the same
driver callbacks that are used for non-virtual PHCs, but the usage of
the spinlock imposes a new limitation that didn't exist previously: now
they're called in atomic context so they mustn't sleep.

Some drivers like sfc or ice may sleep on these callbacks, causing
errors like "BUG: scheduling while atomic: ptp5/25223/0x00000002"

Fix it replacing the vclock's spinlock by a mutex. It fix the mentioned
bug and it doesn't introduce longer delays.

I've tested synchronizing various different combinations of clocks:
- vclock-&gt;sysclock
- sysclock-&gt;vclock
- vclock-&gt;vclock
- hardware PHC in different NIC -&gt; vclock
- created 4 vclocks and launch 4 parallel phc2sys processes with
  lockdep enabled

In all cases, comparing the delays reported by phc2sys, they are in the
same range of values than before applying the patch.

Link: https://lore.kernel.org/netdev/69d0ff33-bd32-6aa5-d36c-fbdc3c01337c@redhat.com/
Fixes: 5d43f951b1ac ("ptp: add ptp virtual clock driver framework")
Reported-by: Yalin Li &lt;yalli@redhat.com&gt;
Suggested-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Tested-by: Miroslav Lichvar &lt;mlichvar@redhat.com&gt;
Signed-off-by: Íñigo Huguet &lt;ihuguet@redhat.com&gt;
Acked-by: Richard Cochran &lt;richardcochran@gmail.com&gt;
Link: https://lore.kernel.org/r/20230221130616.21837-1-ihuguet@redhat.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
