nvme fixes for Linux 6.7

- Revert a commit with improper sleep context (Keith)
  - Fix async event handling sleep context (Maurizio)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE3Fbyvv+648XNRdHTPe3zGtjzRgkFAmWErcoACgkQPe3zGtjz
 RglIchAAy/XX+4IdJkA6jhr8r9gNjVMQRkAeoTwIPFqV81ixELqjgc1DfKO58YrM
 2U2Rt4jfrLSzJSQF0DKYSSDa16ztlWd6i1y9Zyl9sxv0UvUm+zv4VzNzNkFMHqEl
 s5IiyPeBQUVqHvWtkNF9p+I24J3yzYtQ/5cWqBFRgCWVX73AwqgnP6Qmsa5tDue+
 eG+0PTZg2uyq64rZtX6m3UVsERat96iU3x4sXLCNkWyKlbMjZGNCumKZCbBkty4N
 coFF6PNv5Sw9M7ywYa5Bjc20qP/9FqMRtkaT6DPMi3nl0QiIRs7QLMdEukpho2Q/
 pNpgs0KsG4TxXIx0QDXzirXRDE0+ShmHd6JYDqOcA9omGtsy+h2QY4zhILXHd7Sc
 0tchIY4XVxzULObDnJU8FQYt/QXH9VWN97RWCqayv/Iynjv7PNStGZOkInpQeA6K
 Gm25q9LDCWA0pfb0hQcUiT/CMAgRwg6ze9m23FBAUvsf2gIogIlw6RdpEUCPZ51t
 bVUHvCv8p36RSw/NLE0vW4GWafMlKJgabZFjH2RNu6jya2Rz0/eW/rnoqV5vQkR0
 4ZFVdDbD6ATXcDu+Ig02RVFjCifnYNJXtDH3En2eLRo6/nGXAEz4zva4rSNAFGLN
 GP1qu5kEEUST6zMz4yWQxbDrZ3q2wFM448ZI6XLx+UN6L3SQF2c=
 =Q6dO
 -----END PGP SIGNATURE-----

Merge tag 'nvme-6.7-2023-12-21' of git://git.infradead.org/nvme into block-6.7

Pull NVMe fixes from Keith:

"nvme fixes for Linux 6.7

 - Revert a commit with improper sleep context (Keith)
 - Fix async event handling sleep context (Maurizio)"

* tag 'nvme-6.7-2023-12-21' of git://git.infradead.org/nvme:
  nvme-pci: fix sleeping function called from interrupt context
  Revert "nvme-fc: fix race between error recovery and creating association"
This commit is contained in:
Jens Axboe 2023-12-21 14:32:35 -07:00
commit 13d822bf1c
2 changed files with 7 additions and 17 deletions

View File

@ -4137,6 +4137,8 @@ static void nvme_fw_act_work(struct work_struct *work)
struct nvme_ctrl, fw_act_work); struct nvme_ctrl, fw_act_work);
unsigned long fw_act_timeout; unsigned long fw_act_timeout;
nvme_auth_stop(ctrl);
if (ctrl->mtfa) if (ctrl->mtfa)
fw_act_timeout = jiffies + fw_act_timeout = jiffies +
msecs_to_jiffies(ctrl->mtfa * 100); msecs_to_jiffies(ctrl->mtfa * 100);
@ -4192,7 +4194,6 @@ static bool nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
* firmware activation. * firmware activation.
*/ */
if (nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING)) { if (nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING)) {
nvme_auth_stop(ctrl);
requeue = false; requeue = false;
queue_work(nvme_wq, &ctrl->fw_act_work); queue_work(nvme_wq, &ctrl->fw_act_work);
} }

View File

@ -2548,24 +2548,17 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg)
* the controller. Abort any ios on the association and let the * the controller. Abort any ios on the association and let the
* create_association error path resolve things. * create_association error path resolve things.
*/ */
enum nvme_ctrl_state state; if (ctrl->ctrl.state == NVME_CTRL_CONNECTING) {
unsigned long flags;
spin_lock_irqsave(&ctrl->lock, flags);
state = ctrl->ctrl.state;
if (state == NVME_CTRL_CONNECTING) {
set_bit(ASSOC_FAILED, &ctrl->flags);
spin_unlock_irqrestore(&ctrl->lock, flags);
__nvme_fc_abort_outstanding_ios(ctrl, true); __nvme_fc_abort_outstanding_ios(ctrl, true);
set_bit(ASSOC_FAILED, &ctrl->flags);
dev_warn(ctrl->ctrl.device, dev_warn(ctrl->ctrl.device,
"NVME-FC{%d}: transport error during (re)connect\n", "NVME-FC{%d}: transport error during (re)connect\n",
ctrl->cnum); ctrl->cnum);
return; return;
} }
spin_unlock_irqrestore(&ctrl->lock, flags);
/* Otherwise, only proceed if in LIVE state - e.g. on first error */ /* Otherwise, only proceed if in LIVE state - e.g. on first error */
if (state != NVME_CTRL_LIVE) if (ctrl->ctrl.state != NVME_CTRL_LIVE)
return; return;
dev_warn(ctrl->ctrl.device, dev_warn(ctrl->ctrl.device,
@ -3180,16 +3173,12 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
else else
ret = nvme_fc_recreate_io_queues(ctrl); ret = nvme_fc_recreate_io_queues(ctrl);
} }
spin_lock_irqsave(&ctrl->lock, flags);
if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags)) if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags))
ret = -EIO; ret = -EIO;
if (ret) { if (ret)
spin_unlock_irqrestore(&ctrl->lock, flags);
goto out_term_aen_ops; goto out_term_aen_ops;
}
changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
spin_unlock_irqrestore(&ctrl->lock, flags);
ctrl->ctrl.nr_reconnects = 0; ctrl->ctrl.nr_reconnects = 0;