Skip to contentSkip to conversation

scsi: ufshcd: fix missing destroy_workqueue() on error in ufshcd_init

PATCH In review Qinglang Miao 2 participants 3 messages Nov 9, 2020 – Nov 10, 2020 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufshcd: fix missing destroy_workqueue() on error in ufshcd_init

Add the missing destroy_workqueue() before return from ufshcd_init in the error handling case. It seems that exit_gating is an appropriate place.

Fixes 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths")
---
 drivers/scsi/ufs/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/ufs/ufshcd.c +1 -0
index b8f573a02713..9eaa0eaca374 100644
@@ -9206,6 +9206,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 exit_gating:
 	ufshcd_exit_clk_scaling(hba);
 	ufshcd_exit_clk_gating(hba);
+	destroy_workqueue(hba->eh_wq);
 out_disable:
 	hba->is_irq_enabled = false;
 	ufshcd_hba_exit(hba);
Signature · 1 line
2.23.0
#1 lore raw
Quoted 17 lines

Add the missing destroy_workqueue() before return from ufshcd_init in the error handling case. It seems that exit_gating is an appropriate place.

Fixes 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other

error recovery paths")

---
 drivers/scsi/ufs/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/ufs/ufshcd.c +0 -0
index b8f573a02713..9eaa0eaca374 100644

drivers/scsi/ufs/ufshcd.c int ufshcd_init(struct ufs_hba *hba, void __iomem · line 9210

Quoted 5 lines
drivers/scsi/ufs/ufshcd.c +1 -0
@@ -9206,6 +9206,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem
 *mmio_base, unsigned int irq)
 exit_gating:
        ufshcd_exit_clk_scaling(hba);
        ufshcd_exit_clk_gating(hba);
+       destroy_workqueue(hba->eh_wq);

Maybe also in ufshcd_remove?

#2 lore raw
Quoted 12 lines · Avri Altman
Quoted 12 lines

Add the missing destroy_workqueue() before return from ufshcd_init in the error handling case. It seems that exit_gating is an appropriate place.

Fixes 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other

error recovery paths")

---
  drivers/scsi/ufs/ufshcd.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/scsi/ufs/ufshcd.c int ufshcd_init(struct ufs_hba *hba, void __iomem · line 9210

Quoted 10 lines
drivers/scsi/ufs/ufshcd.c +1 -0
index b8f573a02713..9eaa0eaca374 100644
@@ -9206,6 +9206,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem
 *mmio_base, unsigned int irq)
  exit_gating:
         ufshcd_exit_clk_scaling(hba);
         ufshcd_exit_clk_gating(hba);
+       destroy_workqueue(hba->eh_wq);

Maybe also in ufshcd_remove?
.

You're right Avri, thanks!

I'm gonna send a v2 on this patch to cover ufshcd_remove.

Quoted 1 line