Skip to content

Commit 30c0879

Browse files
committed
Merge: Revert "nvme_core: scan namespaces asynchronously"
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/699 # Merge Request Required Information JIRA: https://issues.redhat.com/browse/RHEL-85845 Upstream Status: RHEL-only Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> ## Summary of Changes ## Approved Development Ticket(s) All submissions to CentOS Stream must reference a ticket in [Red Hat Jira](https://issues.redhat.com/). <details><summary>Click for formatting instructions</summary> Please follow the CentOS Stream [contribution documentation](https://docs.centos.org/en-US/stream-contrib/quickstart/) for how to file this ticket and have it approved. List tickets each on their own line of this description using the format "Resolves: RHEL-76229", "Related: RHEL-76229" or "Reverts: RHEL-76229", as appropriate. </details> Approved-by: John Meneghini <jmeneghi@redhat.com> Approved-by: Chris Leech <cleech@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 0c92bc6 + a1776db commit 30c0879

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Copyright (c) 2011-2014, Intel Corporation.
55
*/
66

7-
#include <linux/async.h>
87
#include <linux/blkdev.h>
98
#include <linux/blk-mq.h>
109
#include <linux/blk-integrity.h>
@@ -4097,35 +4096,6 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
40974096
}
40984097
}
40994098

4100-
/**
4101-
* struct async_scan_info - keeps track of controller & NSIDs to scan
4102-
* @ctrl: Controller on which namespaces are being scanned
4103-
* @next_nsid: Index of next NSID to scan in ns_list
4104-
* @ns_list: Pointer to list of NSIDs to scan
4105-
*
4106-
* Note: There is a single async_scan_info structure shared by all instances
4107-
* of nvme_scan_ns_async() scanning a given controller, so the atomic
4108-
* operations on next_nsid are critical to ensure each instance scans a unique
4109-
* NSID.
4110-
*/
4111-
struct async_scan_info {
4112-
struct nvme_ctrl *ctrl;
4113-
atomic_t next_nsid;
4114-
__le32 *ns_list;
4115-
};
4116-
4117-
static void nvme_scan_ns_async(void *data, async_cookie_t cookie)
4118-
{
4119-
struct async_scan_info *scan_info = data;
4120-
int idx;
4121-
u32 nsid;
4122-
4123-
idx = (u32)atomic_fetch_inc(&scan_info->next_nsid);
4124-
nsid = le32_to_cpu(scan_info->ns_list[idx]);
4125-
4126-
nvme_scan_ns(scan_info->ctrl, nsid);
4127-
}
4128-
41294099
static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl,
41304100
unsigned nsid)
41314101
{
@@ -4152,15 +4122,11 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl)
41524122
__le32 *ns_list;
41534123
u32 prev = 0;
41544124
int ret = 0, i;
4155-
ASYNC_DOMAIN(domain);
4156-
struct async_scan_info scan_info;
41574125

41584126
ns_list = kzalloc(NVME_IDENTIFY_DATA_SIZE, GFP_KERNEL);
41594127
if (!ns_list)
41604128
return -ENOMEM;
41614129

4162-
scan_info.ctrl = ctrl;
4163-
scan_info.ns_list = ns_list;
41644130
for (;;) {
41654131
struct nvme_command cmd = {
41664132
.identify.opcode = nvme_admin_identify,
@@ -4176,23 +4142,19 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl)
41764142
goto free;
41774143
}
41784144

4179-
atomic_set(&scan_info.next_nsid, 0);
41804145
for (i = 0; i < nr_entries; i++) {
41814146
u32 nsid = le32_to_cpu(ns_list[i]);
41824147

41834148
if (!nsid) /* end of the list? */
41844149
goto out;
4185-
async_schedule_domain(nvme_scan_ns_async, &scan_info,
4186-
&domain);
4150+
nvme_scan_ns(ctrl, nsid);
41874151
while (++prev < nsid)
41884152
nvme_ns_remove_by_nsid(ctrl, prev);
41894153
}
4190-
async_synchronize_full_domain(&domain);
41914154
}
41924155
out:
41934156
nvme_remove_invalid_namespaces(ctrl, prev);
41944157
free:
4195-
async_synchronize_full_domain(&domain);
41964158
kfree(ns_list);
41974159
return ret;
41984160
}

0 commit comments

Comments
 (0)