Skip to contentSkip to conversation

scsi: ufs: Remove an unpaired ufshcd_scsi_unblock_requests() in err_handler()

PATCH Superseded Can Guo 5 participants 6 messages Aug 18, 2020 – Aug 20, 2020 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Can Guo

author
#0 lore raw

PATCH 1/1 scsi: ufs: Remove an unpaired ufshcd_scsi_unblock_requests() in err_handler()

Commit 5586dd8ea250a ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") moves the ufshcd_scsi_block_requests() inside err_handler(), but forgets to remove the ufshcd_scsi_unblock_requests() in the early return path. Correct the coding mistake.

drivers/scsi/ufs/ufshcd.c +0 -1
index 2b55c2e..b8441ad 100644
@@ -5670,7 +5670,6 @@ static void ufshcd_err_handler(struct work_struct *work)
 		if (hba->ufshcd_state != UFSHCD_STATE_ERROR)
 			hba->ufshcd_state = UFSHCD_STATE_OPERATIONAL;
 		spin_unlock_irqrestore(hba->host->host_lock, flags);
-		ufshcd_scsi_unblock_requests(hba);
 		return;
 	}
 	ufshcd_set_eh_in_progress(hba);
Signature · 1 line
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Can Guo

Commit 5586dd8ea250a ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") moves the ufshcd_scsi_block_requests() inside err_handler(), but forgets to remove the ufshcd_scsi_unblock_requests() in the early return path. Correct the coding mistake.

Quoted 15 lines
drivers/scsi/ufs/ufshcd.c +0 -1
index 2b55c2e..b8441ad 100644
@@ -5670,7 +5670,6 @@ static void ufshcd_err_handler(struct work_struct *work)
 		if (hba->ufshcd_state != UFSHCD_STATE_ERROR)
 			hba->ufshcd_state = UFSHCD_STATE_OPERATIONAL;
 		spin_unlock_irqrestore(hba->host->host_lock, flags);
-		ufshcd_scsi_unblock_requests(hba);
 		return;
 	}
 	ufshcd_set_eh_in_progress(hba);
Signature · 1 line
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Reviewed-by
#2 lore raw
Quoted 10 lines · Asutosh Das
Quoted 7 lines · Can Guo

Commit 5586dd8ea250a ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") moves the ufshcd_scsi_block_requests() inside err_handler(), but forgets to remove the ufshcd_scsi_unblock_requests() in the early return path. Correct the coding mistake.

Quoted 16 lines
Quoted 13 lines
drivers/scsi/ufs/ufshcd.c +0 -1
index 2b55c2e..b8441ad 100644
@@ -5670,7 +5670,6 @@ static void ufshcd_err_handler(struct 
 work_struct *work)
 		if (hba->ufshcd_state != UFSHCD_STATE_ERROR)
 			hba->ufshcd_state = UFSHCD_STATE_OPERATIONAL;
 		spin_unlock_irqrestore(hba->host->host_lock, flags);
-		ufshcd_scsi_unblock_requests(hba);
 		return;
 	}
	ufshcd_set_eh_in_progress(hba);
Quoted 3 lines

-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.

#3 lore raw
In reply to Can Guo
Quoted 6 lines · Can Guo

Commit 5586dd8ea250a ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") moves the ufshcd_scsi_block_requests() inside err_handler(), but forgets to remove the ufshcd_scsi_unblock_requests() in the early return path. Correct the coding mistake.

Hi Can,

Please add a "Fixes:" tag.

Thanks,

Bart.

#4 lore raw
In reply to Can Guo
Quoted 6 lines

Commit 5586dd8ea250a ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") moves the ufshcd_scsi_block_requests() inside err_handler(), but forgets to remove the ufshcd_scsi_unblock_requests() in the early return path. Correct the coding mistake.

"fixes" tag please, for those who don't read the commit message. Thanks,
Avri

Quoted 19 lines
drivers/scsi/ufs/ufshcd.c +0 -1
index 2b55c2e..b8441ad 100644
@@ -5670,7 +5670,6 @@ static void ufshcd_err_handler(struct work_struct
 *work)
                if (hba->ufshcd_state != UFSHCD_STATE_ERROR)
                        hba->ufshcd_state = UFSHCD_STATE_OPERATIONAL;
                spin_unlock_irqrestore(hba->host->host_lock, flags);
-               ufshcd_scsi_unblock_requests(hba);
                return;
        }
        ufshcd_set_eh_in_progress(hba);

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.

author
#5 lore raw
Quoted 9 lines · Avri Altman
Quoted 5 lines

Commit 5586dd8ea250a ("scsi: ufs: Fix a race condition between error handler and runtime PM ops") moves the ufshcd_scsi_block_requests() inside err_handler(), but forgets to remove the ufshcd_scsi_unblock_requests() in the early return path. Correct the coding mistake.

"fixes" tag please, for those who don't read the commit message. Thanks,
Avri

Already added one in the V2 of it.

Thanks,

Can Guo.

Quoted 20 lines
Quoted 20 lines
drivers/scsi/ufs/ufshcd.c +0 -0
index 2b55c2e..b8441ad 100644
@@ -5670,7 +5670,6 @@ static void ufshcd_err_handler(struct 

work_struct
*work)

                if (hba->ufshcd_state != UFSHCD_STATE_ERROR)
                        hba->ufshcd_state = UFSHCD_STATE_OPERATIONAL;
                spin_unlock_irqrestore(hba->host->host_lock, flags);
-               ufshcd_scsi_unblock_requests(hba);
                return;
        }
        ufshcd_set_eh_in_progress(hba);

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.