mbox series

[RFC,net-next,0/2] devlink: Acquire device lock during reload

Message ID 20230619125015.1541143-1-idosch@nvidia.com (mailing list archive)
Headers show
Series devlink: Acquire device lock during reload | expand

Message

Ido Schimmel June 19, 2023, 12:50 p.m. UTC
These two patches change devlink to acquire the device lock during
reload. This is needed by device drivers that need to invoke a PCI reset
via PCI core during devlink reload, as PCI core requires the device lock
to be held. See detailed explanation in the second patch.

As a preparation for this change, devlink needs to hold a reference on
the underlying device since reload can be invoked asynchronously as part
of netns dismantle. Unfortunately, this change results in a crash which
I'm not sure how to solve. Detailed description and reproducer are
provided in the first patch.

Ido Schimmel (2):
  devlink: Hold a reference on parent device
  devlink: Acquire device lock during reload

 net/devlink/core.c          |  7 +++++--
 net/devlink/dev.c           |  8 ++++++++
 net/devlink/devl_internal.h | 19 ++++++++++++++++++-
 net/devlink/health.c        |  3 ++-
 net/devlink/leftover.c      |  4 +++-
 net/devlink/netlink.c       | 18 ++++++++++++------
 6 files changed, 48 insertions(+), 11 deletions(-)