Skip to content

Commit 60ae9b8

Browse files
committed
Merge: [RHEL10.0 P2] ptp: stable backport from upstream
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/179 JIRA: https://issues.redhat.com/browse/RHEL-74024 * 9c5649c ptp_pch: Replace deprecated PCI functions * 98337d7 ptp: Add error handling for adjfine callback in ptp_clock_adjtime Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-01-15 08:44 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: Hangbin Liu <haliu@redhat.com> Approved-by: Jiri Benc <jbenc@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents d331674 + c120c5f commit 60ae9b8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

drivers/ptp/ptp_clock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct __kernel_timex *tx)
150150
if (ppb > ops->max_adj || ppb < -ops->max_adj)
151151
return -ERANGE;
152152
err = ops->adjfine(ops, tx->freq);
153-
ptp->dialed_frequency = tx->freq;
153+
if (!err)
154+
ptp->dialed_frequency = tx->freq;
154155
} else if (tx->modes & ADJ_OFFSET) {
155156
if (ops->adjphase) {
156157
s32 max_phase_adj = ops->getmaxphase(ops);

drivers/ptp/ptp_pch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,14 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
462462
return ret;
463463
}
464464

465-
ret = pcim_iomap_regions(pdev, BIT(IO_MEM_BAR), "1588_regs");
465+
/* get the virtual address to the 1588 registers */
466+
chip->regs = pcim_iomap_region(pdev, IO_MEM_BAR, KBUILD_MODNAME);
467+
ret = PTR_ERR_OR_ZERO(chip->regs);
466468
if (ret) {
467469
dev_err(&pdev->dev, "could not locate IO memory address\n");
468470
return ret;
469471
}
470472

471-
/* get the virtual address to the 1588 registers */
472-
chip->regs = pcim_iomap_table(pdev)[IO_MEM_BAR];
473473
chip->caps = ptp_pch_caps;
474474
chip->ptp_clock = ptp_clock_register(&chip->caps, &pdev->dev);
475475
if (IS_ERR(chip->ptp_clock))

0 commit comments

Comments
 (0)