Skip to content

Commit e034295

Browse files
committed
Merge: ptp: stable backport for 10.1 phase 1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/616 JIRA: https://issues.redhat.com/browse/RHEL-84646 * fd53aa4 ptp: Ensure info->enable callback is always set * 19ae40f ptp: Properly handle compat ioctls Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> Signed-off-by: Hangbin Liu <haliu@redhat.com> --- <small>Created 2025-03-24 07:07 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://gitlab.com/cki-project/kernel-workflow/-/issues/new?issue%5Btitle%5D=backporter%20webhook%20issue)</small> Approved-by: Jiri Benc <jbenc@redhat.com> Approved-by: Marcelo Ricardo Leitner <mleitner@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Approved-by: Xin Long <lxin@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 0d4a06c + 7ed64f6 commit e034295

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/ptp/ptp_chardev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
* Copyright (C) 2010 OMICRON electronics GmbH
66
*/
7+
#include <linux/compat.h>
78
#include <linux/module.h>
89
#include <linux/posix-clock.h>
910
#include <linux/poll.h>
@@ -176,6 +177,9 @@ long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
176177
struct timespec64 ts;
177178
int enable, err = 0;
178179

180+
if (in_compat_syscall() && cmd != PTP_ENABLE_PPS && cmd != PTP_ENABLE_PPS2)
181+
arg = (unsigned long)compat_ptr(arg);
182+
179183
tsevq = pccontext->private_clkdata;
180184

181185
switch (cmd) {

drivers/ptp/ptp_clock.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ static int ptp_getcycles64(struct ptp_clock_info *info, struct timespec64 *ts)
217217
return info->gettime64(info, ts);
218218
}
219219

220+
static int ptp_enable(struct ptp_clock_info *ptp, struct ptp_clock_request *request, int on)
221+
{
222+
return -EOPNOTSUPP;
223+
}
224+
220225
static void ptp_aux_kworker(struct kthread_work *work)
221226
{
222227
struct ptp_clock *ptp = container_of(work, struct ptp_clock,
@@ -294,6 +299,9 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
294299
ptp->info->getcrosscycles = ptp->info->getcrosststamp;
295300
}
296301

302+
if (!ptp->info->enable)
303+
ptp->info->enable = ptp_enable;
304+
297305
if (ptp->info->do_aux_work) {
298306
kthread_init_delayed_work(&ptp->aux_work, ptp_aux_kworker);
299307
ptp->kworker = kthread_create_worker(0, "ptp%d", ptp->index);

0 commit comments

Comments
 (0)