]> www.infradead.org Git - users/dwmw2/vmclock.git/log
users/dwmw2/vmclock.git
4 months agoKill vmclock_remove compat hack master
David Woodhouse [Sat, 3 May 2025 04:00:20 +0000 (21:00 -0700)]
Kill vmclock_remove compat hack

It's cleaned up through devres anyway now so there's no need for
compat with the old .remove method.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
4 months agoptp: vmclock: Remove goto-based cleanup logic
Thomas Weißschuh [Fri, 7 Feb 2025 09:39:06 +0000 (10:39 +0100)]
ptp: vmclock: Remove goto-based cleanup logic

vmclock_probe() uses an "out:" label to return from the function on
error. This indicates that some cleanup operation is necessary.
However the label does not do anything as all resources are managed
through devres, making the code slightly harder to read.

Remove the label and just return directly.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit b4c1fde5ced93d9f4ad89e2c940d3fd56ad82288)

4 months agoptp: vmclock: Clean up miscdev and ptp clock through devres
Thomas Weißschuh [Fri, 7 Feb 2025 09:39:05 +0000 (10:39 +0100)]
ptp: vmclock: Clean up miscdev and ptp clock through devres

Most resources owned by the vmclock device are managed through devres.
Only the miscdev and ptp clock are managed manually.
This makes the code slightly harder to understand than necessary.

Switch them over to devres and remove the now unnecessary drvdata.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 9a884c3800b207bac36e27be4ec7277c78a84568)

4 months agoptp: vmclock: Don't unregister misc device if it was not registered
Thomas Weißschuh [Fri, 7 Feb 2025 09:39:04 +0000 (10:39 +0100)]
ptp: vmclock: Don't unregister misc device if it was not registered

vmclock_remove() tries to detect the successful registration of the misc
device based on the value of its minor value.
However that check is incorrect if the misc device registration was not
attempted in the first place.

Always initialize the minor number, so the check works properly.

Fixes: 205032724226 ("ptp: Add support for the AMZNC10C 'vmclock' device")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 39e926c3a21b25af6cae479fbb752f193240ce03)

4 months agoptp: vmclock: Set driver data before its usage
Thomas Weißschuh [Fri, 7 Feb 2025 09:39:03 +0000 (10:39 +0100)]
ptp: vmclock: Set driver data before its usage

If vmclock_ptp_register() fails during probing, vmclock_remove() is
called to clean up the ptp clock and misc device.
It uses dev_get_drvdata() to access the vmclock state.
However the driver data is not yet set at this point.

Assign the driver data earlier.

Fixes: 205032724226 ("ptp: Add support for the AMZNC10C 'vmclock' device")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit f7d07cd4f77d77f366c8ffbb8ba8b61f614e5fce)

4 months agoptp: vmclock: Add .owner to vmclock_miscdev_fops
David Woodhouse [Fri, 7 Feb 2025 09:39:02 +0000 (10:39 +0100)]
ptp: vmclock: Add .owner to vmclock_miscdev_fops

Without the .owner field, the module can be unloaded while /dev/vmclock0
is open, leading to an oops.

Fixes: 205032724226 ("ptp: Add support for the AMZNC10C 'vmclock' device")
Cc: stable@vger.kernel.org
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 7b07b040257c1b658ef3eca86e4b6ae02d65069c)

4 months agoClean up remove() compat
David Woodhouse [Tue, 29 Apr 2025 16:56:08 +0000 (09:56 -0700)]
Clean up remove() compat

4 months agoUpdate to v7 posting
David Woodhouse [Tue, 29 Apr 2025 16:50:02 +0000 (09:50 -0700)]
Update to v7 posting

4 months agoUpdate to v6 posting
David Woodhouse [Tue, 29 Apr 2025 16:49:36 +0000 (09:49 -0700)]
Update to v6 posting

4 months agoUpdate to v5 posting
David Woodhouse [Tue, 29 Apr 2025 16:48:56 +0000 (09:48 -0700)]
Update to v5 posting

4 months agoUpdate to v4 posting
David Woodhouse [Tue, 29 Apr 2025 16:48:28 +0000 (09:48 -0700)]
Update to v4 posting

13 months agoUpdate to non-RFC v3 posting
David Woodhouse [Mon, 29 Jul 2024 14:02:45 +0000 (14:02 +0000)]
Update to non-RFC v3 posting

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
13 months agonanoseconds
David Woodhouse [Wed, 24 Jul 2024 16:42:23 +0000 (17:42 +0100)]
nanoseconds

13 months agoupdate leap values
David Woodhouse [Wed, 24 Jul 2024 11:43:20 +0000 (12:43 +0100)]
update leap values

14 months agoUpdate from master tree
David Woodhouse [Fri, 12 Jul 2024 14:59:11 +0000 (15:59 +0100)]
Update from master tree

14 months agofix unload bug
fedora Cloud User [Mon, 8 Jul 2024 12:24:22 +0000 (12:24 +0000)]
fix unload bug

14 months agoUpdate to struct v3
David Woodhouse [Mon, 8 Jul 2024 06:56:14 +0000 (06:56 +0000)]
Update to struct v3

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
14 months agoUpdate from upstream driver (struct closer to virtio-rtc)
David Woodhouse [Mon, 1 Jul 2024 13:34:12 +0000 (13:34 +0000)]
Update from upstream driver (struct closer to virtio-rtc)

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
14 months agoBuild for AL
David Woodhouse [Fri, 28 Jun 2024 13:54:48 +0000 (14:54 +0100)]
Build for AL

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
14 months agoAdd Makefile
David Woodhouse [Fri, 28 Jun 2024 13:45:17 +0000 (14:45 +0100)]
Add Makefile

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
14 months agoImport vmclock Linux code from commit 6635b8ca76c6 (2024-06-28)
David Woodhouse [Fri, 28 Jun 2024 13:44:35 +0000 (14:44 +0100)]
Import vmclock Linux code from commit 6635b8ca76c6 (2024-06-28)

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>