nvme fixes for Linux 5.15:
- fix the abort command id (Keith Busch) - nvme: fix per-namespace chardev deletion (Adam Manzanares) -----BEGIN PGP SIGNATURE----- iQI/BAABCgApFiEEgdbnc3r/njty3Iq9D55TZVIEUYMFAmFoKrwLHGhjaEBsc3Qu ZGUACgkQD55TZVIEUYOCGw//fXeDv+hBmuhfmMX5ac889bAT9iWQcg86jb/2UBEF KmtFJI6vQO7J4amCImSEoYD55WZ85ZZo+i+Q61abLep493MXINnrm/ZkNtVp0kbT h+pokfxbwo4IKPOCmWqVhXxspaIQL++J6TDMvAzuv4S4YAxeD/W+4bXshMu8E4aD XZZo2uj1EVYDeHY1rasCElMAw4DZDdaIL7Zn11qqQJDWK+XwP3YJ773/rXoG3i/j Kq0jtB/wWRc3VrherMXtEOz1Eu1MVOhUhr6YF2vitv+qBzmJKMResO1bVP619vqQ MoEGZmqUfUxLY4CcWbtV4iIIBK+H3ySaEoHeNLu31aiucRcAWCLIwHLvwrc2cSpP BozCuA03iRyGtcLDftfQfD3jyzeB8qmIrOaXd/blBlPAuQXzilF/WyB+IzRXorYs kxtwdWLTbh3nWMQrEG9gh6Fx02Hbf+dNdXb/GN0NFDJDD6BfPyAut38lMxdRKMAz 9q4HfPTszyP78sU54N6qULVDVTJZ8F7sjY90OueZCBT3VjwsyCd7eO4sti1Avu4Y KmWxKfKQyGCmlls0oIrCFm7A0tjHFJhCdoNN0w3DmpMy6GN0cBE3aI3WAb1MAWan Qp6eI9DXuHwsLW8fqLv9+lWP3BI59qj2ClSy3OBGqAWiW1ifyq4cPUOR80vh22c2 EHA= =eQZ/ -----END PGP SIGNATURE----- Merge tag 'nvme-5.15-2021-10-14' of git://git.infradead.org/nvme into block-5.15 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.15: - fix the abort command id (Keith Busch) - nvme: fix per-namespace chardev deletion (Adam Manzanares)" * tag 'nvme-5.15-2021-10-14' of git://git.infradead.org/nvme: nvme: fix per-namespace chardev deletion nvme-pci: Fix abort command id
This commit is contained in:
commit
baa0ab2ba2
|
@ -3550,10 +3550,15 @@ static int __nvme_check_ids(struct nvme_subsystem *subsys,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void nvme_cdev_rel(struct device *dev)
|
||||
{
|
||||
ida_simple_remove(&nvme_ns_chr_minor_ida, MINOR(dev->devt));
|
||||
}
|
||||
|
||||
void nvme_cdev_del(struct cdev *cdev, struct device *cdev_device)
|
||||
{
|
||||
cdev_device_del(cdev, cdev_device);
|
||||
ida_simple_remove(&nvme_ns_chr_minor_ida, MINOR(cdev_device->devt));
|
||||
put_device(cdev_device);
|
||||
}
|
||||
|
||||
int nvme_cdev_add(struct cdev *cdev, struct device *cdev_device,
|
||||
|
@ -3566,14 +3571,14 @@ int nvme_cdev_add(struct cdev *cdev, struct device *cdev_device,
|
|||
return minor;
|
||||
cdev_device->devt = MKDEV(MAJOR(nvme_ns_chr_devt), minor);
|
||||
cdev_device->class = nvme_ns_chr_class;
|
||||
cdev_device->release = nvme_cdev_rel;
|
||||
device_initialize(cdev_device);
|
||||
cdev_init(cdev, fops);
|
||||
cdev->owner = owner;
|
||||
ret = cdev_device_add(cdev, cdev_device);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
put_device(cdev_device);
|
||||
ida_simple_remove(&nvme_ns_chr_minor_ida, minor);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3605,11 +3610,9 @@ static int nvme_add_ns_cdev(struct nvme_ns *ns)
|
|||
ns->ctrl->instance, ns->head->instance);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = nvme_cdev_add(&ns->cdev, &ns->cdev_device, &nvme_ns_chr_fops,
|
||||
ns->ctrl->ops->module);
|
||||
if (ret)
|
||||
kfree_const(ns->cdev_device.kobj.name);
|
||||
return ret;
|
||||
|
||||
return nvme_cdev_add(&ns->cdev, &ns->cdev_device, &nvme_ns_chr_fops,
|
||||
ns->ctrl->ops->module);
|
||||
}
|
||||
|
||||
static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
|
||||
|
|
|
@ -431,8 +431,6 @@ static int nvme_add_ns_head_cdev(struct nvme_ns_head *head)
|
|||
return ret;
|
||||
ret = nvme_cdev_add(&head->cdev, &head->cdev_device,
|
||||
&nvme_ns_head_chr_fops, THIS_MODULE);
|
||||
if (ret)
|
||||
kfree_const(head->cdev_device.kobj.name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -1330,7 +1330,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
|
|||
iod->aborted = 1;
|
||||
|
||||
cmd.abort.opcode = nvme_admin_abort_cmd;
|
||||
cmd.abort.cid = req->tag;
|
||||
cmd.abort.cid = nvme_cid(req);
|
||||
cmd.abort.sqid = cpu_to_le16(nvmeq->qid);
|
||||
|
||||
dev_warn(nvmeq->dev->ctrl.device,
|
||||
|
|
Loading…
Reference in New Issue