]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ptp: ocp: add shutdown callback
authorVadim Fedorenko <vadim.fedorenko@linux.dev>
Thu, 11 Jun 2026 19:03:33 +0000 (19:03 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 00:54:35 +0000 (17:54 -0700)
The shutdown callback was never implemented for this driver, but it's
needed because .remove() callback is never called during kexec/reboot
process. That leaves HW with some interrupts enabled and may cause
spurious interrupt while booting into a new kernel during with kexec.
If it happens that I2C interrupt fires during kexec, the whole I2C bus
is disabled leaving TimeCard with no devlink communication. The same
happens if timestampers were enabled, leaving the card without
timestamper interrupts until full reboot cycle.

Implement .shutdown() callback with the same function as remove
callback.

Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20260611190333.787132-1-vadim.fedorenko@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_ocp.c

index 735385539b9f88044cfabe4c881f89933b3e7219..c365babb3a3ed96a78488a935c1af961509ac8d6 100644 (file)
@@ -5189,6 +5189,7 @@ static struct pci_driver ptp_ocp_driver = {
        .id_table       = ptp_ocp_pcidev_id,
        .probe          = ptp_ocp_probe,
        .remove         = ptp_ocp_remove,
+       .shutdown       = ptp_ocp_remove,
 };
 
 static int