Skip to contentSkip to conversation

ptp: ocp: add shutdown callback

PATCH Applied Vadim Fedorenko 2 participants 2 messages Jun 11 – Jun 13

Subsystems (4)
lore
Share & tools
lore

Vadim Fedorenko

author maintainer
#0 lore raw

PATCH 1/1 ptp: ocp: add shutdown callback

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.

---
 drivers/ptp/ptp_ocp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ptp/ptp_ocp.c +1 -0
index beacc2ffb166..3465cb7f3311 100644
@@ -5171,6 +5171,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
Signature · 1 line
2.47.3
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 11 Jun 2026 19:03:33 +0000 you wrote:

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.

[...]

Here is the summary with links:
- [net-next] ptp: ocp: add shutdown callback

    https://git.kernel.org/netdev/net-next/c/f6f955cbf9d4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html