Skip to content

Commit 76fe871

Browse files
committed
cxl/pci: Remove unnecessary device reference management in sanitize work
Given that any particular put_device() could be the final put of the device, the fact that there are usages of cxlds->dev after put_device(cxlds->dev) is a red flag. Drop the reference counting since the device is pinned by being registered and will not be unregistered without triggering the driver + workqueue to shutdown. Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 6465e26 commit 76fe871

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/cxl/pci.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ static void cxl_mbox_sanitize_work(struct work_struct *work)
152152
mutex_lock(&mds->mbox_mutex);
153153
if (cxl_mbox_background_complete(cxlds)) {
154154
mds->security.poll_tmo_secs = 0;
155-
put_device(cxlds->dev);
156-
157155
if (mds->security.sanitize_node)
158156
sysfs_notify_dirent(mds->security.sanitize_node);
159157

@@ -296,9 +294,6 @@ static int __cxl_pci_mbox_send_cmd(struct cxl_memdev_state *mds,
296294
*/
297295
if (mbox_cmd->opcode == CXL_MBOX_OP_SANITIZE) {
298296
if (mds->security.poll) {
299-
/* hold the device throughout */
300-
get_device(cxlds->dev);
301-
302297
/* give first timeout a second */
303298
timeout = 1;
304299
mds->security.poll_tmo_secs = timeout;

0 commit comments

Comments
 (0)