Skip to content

PCI: driver function reset notification

Keith Busch linux-pci 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 4 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2PCI: call pci reset callback to pci_driver on FLRdrivers/pci/pci.c+6 -00 replies
2/2NVMe: Implement pci reset callbackdrivers/block/nvme-core.c include/linux/nvme.h+35 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCHv2 0/2] PCI: driver function reset notification

Here's version 2 of this patch with a driver implementing the intended use as an example.

The NVMe stuff requires using the maintainer's tree to get the newly added nvme reset handling code. Willy's repo is located here:

git.infradead.org/users/willy/linux-nvme.git

v1->v2:

As suggested, I'm reusing the slot_reset error handler instead of defining a new one for function_reset.

I moved invoking the callback further up the this call stack. The test case I use resets the device via sysfs, and the pci device's command register is cleared at the previous point, so the callback couldn't actually do anything useful other than schedule something to handle it after pci_dev_restore is called. The previous location would break other driver slot_reset implementations and make my nvme implementation a little more complicated.

Actually ... I'm a little concered to be using slot_reset instead of defining a new callback for FLR. From looking at other device drivers, I'm not sure they would expect to have their slot_reset invoked in this situation.

Keith Busch (2):
PCI: call pci reset callback to pci_driver on FLR
NVMe: Implement pci reset callback

 drivers/block/nvme-core.c |   36 ++++++++++++++++++++++++++++++++++--
 drivers/pci/pci.c         |    6 ++++++
 include/linux/nvme.h      |    1 +
 3 files changed, 41 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.10.4