This is a note to let you know that I've just added the patch titled scsi: ufs: core: Simplify power management during async scan to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-ufs-core-simplify-power-management-during-async-scan.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From daf7795406bf307997366f694888bd317ae5b5fa Mon Sep 17 00:00:00 2001 From: Bart Van Assche <bvanassche@xxxxxxx> Date: Mon, 18 Dec 2023 14:52:14 -0800 Subject: scsi: ufs: core: Simplify power management during async scan From: Bart Van Assche <bvanassche@xxxxxxx> commit daf7795406bf307997366f694888bd317ae5b5fa upstream. ufshcd_init() calls pm_runtime_get_sync() before it calls async_schedule(). ufshcd_async_scan() calls pm_runtime_put_sync() directly or indirectly from ufshcd_add_lus(). Simplify ufshcd_async_scan() by always calling pm_runtime_put_sync() from ufshcd_async_scan(). Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> Link: https://lore.kernel.org/r/20231218225229.2542156-2-bvanassche@xxxxxxx Reviewed-by: Can Guo <quic_cang@xxxxxxxxxxx> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/ufs/core/ufshcd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8204,7 +8204,6 @@ static int ufshcd_add_lus(struct ufs_hba ufs_bsg_probe(hba); ufshpb_init(hba); scsi_scan_host(hba->host); - pm_runtime_put_sync(hba->dev); out: return ret; @@ -8331,15 +8330,15 @@ static void ufshcd_async_scan(void *data /* Probe and add UFS logical units */ ret = ufshcd_add_lus(hba); + out: + pm_runtime_put_sync(hba->dev); /* * If we failed to initialize the device or the device is not * present, turn off the power/clocks etc. */ - if (ret) { - pm_runtime_put_sync(hba->dev); + if (ret) ufshcd_hba_exit(hba); - } } static const struct attribute_group *ufshcd_driver_groups[] = { Patches currently in stable-queue which might be from bvanassche@xxxxxxx are queue-6.1/md-raid1-use-blk_opf_t-for-read-and-write-operations.patch queue-6.1/scsi-ufs-core-simplify-power-management-during-async-scan.patch queue-6.1/block-make-blk_def_max_sectors-unsigned.patch