Re: [Intel-wired-lan] [PATCH v2] idpf: disable PCIe PTM on probe failure and removal
Mina Almasry via Intel-wired-lan <[email protected]> Wed, 15 Jul 2026 11:08:24 -0700
| Newsgroups | org.osuosl.intel-wired-lan,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <CAHS8izN635zULNXH1UOejjjG7ZygwPD7EuN1Z2LXAw5qUFAfaA@mail.gmail.com> |
On Wed, Jul 15, 2026 at 12:44 AM Myeonghun Pak <[email protected]> wrote: > > idpf_probe() enables PCIe Precision Time Measurement with > pci_enable_ptm(pdev, NULL), which programs the PTM control bits and sets > pdev->ptm_enabled when the bus/controller supports it. > > If a later probe step fails, the error path releases the allocated > workqueues and adapter memory without disabling PTM. The remove path has > the same imbalance when a successfully probed device is detached. In > both cases, the PCI core's software PTM state and the device's PTM control > bits remain set with no bound driver. > > Add pci_disable_ptm() to the common probe unwind after the PTM enable and > to idpf_remove(). pci_disable_ptm() is a no-op when PTM was not enabled, > so the non-fatal pci_enable_ptm() failure remains safe. > pcim_enable_device() only arranges for pci_disable_device() and does not > undo the PTM enable. > > Fixes: 8d5e12c5921c ("idpf: add initial PTP support") > Co-developed-by: Ijae Kim <[email protected]> > Signed-off-by: Ijae Kim <[email protected]> > Signed-off-by: Myeonghun Pak <[email protected]> Reviewed-by: Mina Almasry <[email protected]> -- Thanks, Mina