nvme fixes for Linux 6.2

- flush initial scan_work for async probe (Keith Busch)
  - fix passthrough csi check (Keith Busch)
  - fix nvme-fc initialization order (Ross Lagerwall)
 -----BEGIN PGP SIGNATURE-----
 
 iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmPSuhULHGhjaEBsc3Qu
 ZGUACgkQD55TZVIEUYOw5xAApcohbAaJHrGLNIjYexxc87/EHe/kLKhB1nD+FwKQ
 HroQ1tMAExeWnb6/+/xpMy5qh467lplLEB7c2gtx63EyEPyp0m+gsaldDTyneZkO
 cUyb/pl+du+hCz6ADOOM/4ynx1BRTf3c6xcnoNaPuoWHqtgDPjXB3/5ixpj69TuO
 NHliDON4JyllgxQq6glhAMuD1a5QM1hYOqfp/npXQVF8in2/1gIGb7li0eUh1IfQ
 LZe4NT8D+Ms0chThiAo8JgqW9E+pKyK8opgzsyLQ+v3WvH4QiVfYHTOcndDZ2wzP
 OY5BAJg1pLoYopMRrF5fiMuphF/G1krMePV6i98jzWwR0Tm9T8+fc0ZYKZzpwE3w
 22xQgQI6EDNNZkp0cm2MEDYch6DdfmRA8MemHiTKaGPwuZzm9oKAsWnHHdcDyZ+Z
 bDlFdoU0OcaWuIekia8kfzqHWVwlZohiKgLR8KTxnrMsSC+ZK69t4+WbdWlvC+4H
 wEj1ga6gqX0Y/uyR0Rix2wS3fK2ZkLmeYy93PnN3Uw0SYow78Ge6W4+YNzLx4Ugr
 Uiaf0gLXtjIzEMo5+I49i1dfglnhH9/zuxCeB2AejBBiEdaxOk4lsj0eoQchwm8m
 gak0CcANuKN9SJ57GaZZ5iTrFfYNrHBE3cF775zCteK1EsuPF0lruqZm4Z2Yi4Im
 D2U=
 =WTvM
 -----END PGP SIGNATURE-----

Merge tag 'nvme-6.2-2023-01-26' of git://git.infradead.org/nvme into block-6.2

Pull NVMe fixes from Christoph:

"nvme fixes for Linux 6.2

 - flush initial scan_work for async probe (Keith Busch)
 - fix passthrough csi check (Keith Busch)
 - fix nvme-fc initialization order (Ross Lagerwall)"

* tag 'nvme-6.2-2023-01-26' of git://git.infradead.org/nvme:
  nvme: fix passthrough csi check
  nvme-pci: flush initial scan_work for async probe
  nvme-fc: fix initialization order
This commit is contained in:
Jens Axboe 2023-01-26 11:43:33 -07:00
commit db3ba974c2
3 changed files with 10 additions and 11 deletions

View file

@ -1093,7 +1093,7 @@ u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u8 opcode)
if (ns) {
if (ns->head->effects)
effects = le32_to_cpu(ns->head->effects->iocs[opcode]);
if (ns->head->ids.csi == NVME_CAP_CSS_NVM)
if (ns->head->ids.csi == NVME_CSI_NVM)
effects |= nvme_known_nvm_effects(opcode);
if (effects & ~(NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC))
dev_warn_once(ctrl->device,

View file

@ -3521,13 +3521,6 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
nvme_fc_init_queue(ctrl, 0);
ret = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set,
&nvme_fc_admin_mq_ops,
struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv,
ctrl->lport->ops->fcprqst_priv_sz));
if (ret)
goto out_free_queues;
/*
* Would have been nice to init io queues tag set as well.
* However, we require interaction from the controller
@ -3537,10 +3530,17 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_fc_ctrl_ops, 0);
if (ret)
goto out_cleanup_tagset;
goto out_free_queues;
/* at this point, teardown path changes to ref counting on nvme ctrl */
ret = nvme_alloc_admin_tag_set(&ctrl->ctrl, &ctrl->admin_tag_set,
&nvme_fc_admin_mq_ops,
struct_size((struct nvme_fcp_op_w_sgl *)NULL, priv,
ctrl->lport->ops->fcprqst_priv_sz));
if (ret)
goto fail_ctrl;
spin_lock_irqsave(&rport->lock, flags);
list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list);
spin_unlock_irqrestore(&rport->lock, flags);
@ -3592,8 +3592,6 @@ fail_ctrl:
return ERR_PTR(-EIO);
out_cleanup_tagset:
nvme_remove_admin_tag_set(&ctrl->ctrl);
out_free_queues:
kfree(ctrl->queues);
out_free_ida:

View file

@ -3102,6 +3102,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
nvme_start_ctrl(&dev->ctrl);
nvme_put_ctrl(&dev->ctrl);
flush_work(&dev->ctrl.scan_work);
return 0;
out_disable: