Thread (1 message) flat view 1 message, 1 author, 2d ago
HOTtoday

[PATCH AUTOSEL 6.18-5.15] ptp: ocp: add shutdown callback

From: Sasha Levin <sashal@kernel.org>
Date: 2026-08-31 13:38:26
Also in: linux-patches, lkml, stable
Subsystem: networking drivers, opencompute ptp clock driver, ptp hardware clock support, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vadim Fedorenko, Richard Cochran, Linus Torvalds

From: Vadim Fedorenko <vadim.fedorenko@linux.dev>

[ Upstream commit f6f955cbf9d4e02deebe54ca91c118b53be9ffe6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Connection lost, reconnecting to https://agentn.us.api5.cursor.sh
(attempt 1)...
Retry attempt 1...
The `ptp_ocp` driver dates back to commit `a7e1abad13f3f` (“ptp: Add
clock driver for the OpenCompute TimeCard”, Dec 2020) — the missing
`.shutdown` callback has been there since introduction.

**Backport verdict: YES** for this 6.18.44 tree.

On kexec/reboot, `.remove()` is never called; without `.shutdown`,
TimeCard interrupts stay enabled and can break I2C/devlink/timestamper
functionality until a full reboot. The fix is a one-line addition
(`.shutdown = ptp_ocp_remove`), matches common PCI driver practice, and
should apply cleanly here.

 drivers/ptp/ptp_ocp.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index a5c3632529862..a064923be9885 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -4866,6 +4866,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
-- 
2.53.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help