diff mbox series

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

Message ID 1597728047-39936-1-git-send-email-cang@codeaurora.org (mailing list archive)
State Superseded
Headers show
Series scsi: ufs: Remove an unpaired ufshcd_scsi_unblock_requests() in err_handler() | expand

Commit Message

Can Guo Aug. 18, 2020, 5:20 a.m. UTC
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.

Signed-off-by: Can Guo <cang@codeaurora.org>

Comments

Asutosh Das (asd) Aug. 18, 2020, 5:42 a.m. UTC | #1
On Mon, Aug 17 2020 at 22:21 -0700, Can Guo wrote:
>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.
>
>Signed-off-by: Can Guo <cang@codeaurora.org>
>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>

>diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>index 2b55c2e..b8441ad 100644
>--- a/drivers/scsi/ufs/ufshcd.c
>+++ b/drivers/scsi/ufs/ufshcd.c
>@@ -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.
>
hongwus@codeaurora.org Aug. 18, 2020, 9:29 a.m. UTC | #2
On 2020-08-18 13:42, Asutosh Das wrote:
> On Mon, Aug 17 2020 at 22:21 -0700, Can Guo wrote:
>> 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.
>> 
>> Signed-off-by: Can Guo <cang@codeaurora.org>
>> 
> Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
> 
>> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>> index 2b55c2e..b8441ad 100644
>> --- a/drivers/scsi/ufs/ufshcd.c
>> +++ b/drivers/scsi/ufs/ufshcd.c
>> @@ -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.
>> 

Reviewed-by: Hongwu Su<hongwus@codeaurora.org>
Bart Van Assche Aug. 18, 2020, 2:37 p.m. UTC | #3
On 2020-08-17 22:20, Can Guo wrote:
> 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.
> 
> Signed-off-by: Can Guo <cang@codeaurora.org>

Hi Can,

Please add a "Fixes:" tag.

Thanks,

Bart.
Avri Altman Aug. 20, 2020, 6:24 a.m. UTC | #4
> 
> 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
> 
> Signed-off-by: Can Guo <cang@codeaurora.org>
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 2b55c2e..b8441ad 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -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.
Can Guo Aug. 20, 2020, 6:35 a.m. UTC | #5
On 2020-08-20 14:24, Avri Altman wrote:
>> 
>> 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.

>> 
>> Signed-off-by: Can Guo <cang@codeaurora.org>
>> 
>> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>> index 2b55c2e..b8441ad 100644
>> --- a/drivers/scsi/ufs/ufshcd.c
>> +++ b/drivers/scsi/ufs/ufshcd.c
>> @@ -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.
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 2b55c2e..b8441ad 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -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);