Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f66f03f authored by Sujit Reddy Thumma's avatar Sujit Reddy Thumma
Browse files

scsi: put runtime PM reference for well-known logical units



Some well-known logical units might not have scsi upper-layer
drivers. In such cases, the runtime PM reference count increased
during device enumeration will not be decreased, causing the
parent device (host) to always be on even during idle.

Change-Id: I458007425231e5e245cd39494c9fb42a8d4cb9cd
Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
parent cc14c8db
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -947,6 +947,13 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
		}
	}

	/*
	 * put runtime pm reference for well-known logical units,
	 * drivers are expected to _get_* again during probe.
	 */
	if (scsi_is_wlun(sdev->lun))
		scsi_autopm_put_device(sdev);

	return error;
}