diff mbox series

[2/4] scsi: ufs: Make ufshcd_poll() complain about unsupported arguments

Message ID 20240412000246.1167600-3-bvanassche@acm.org
State Superseded
Headers show
Series Fix a rare crash in the UFS driver | expand

Commit Message

Bart Van Assche April 12, 2024, 12:02 a.m. UTC
The ufshcd_poll() implementation does not support queue_num ==
UFSHCD_POLL_FROM_INTERRUPT_CONTEXT in MCQ mode. Hence complain
if queue_num == UFSHCD_POLL_FROM_INTERRUPT_CONTEXT in MCQ mode.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Avri Altman April 12, 2024, 8:55 a.m. UTC | #1
> The ufshcd_poll() implementation does not support queue_num ==
> UFSHCD_POLL_FROM_INTERRUPT_CONTEXT in MCQ mode. Hence complain
> if queue_num == UFSHCD_POLL_FROM_INTERRUPT_CONTEXT in MCQ mode.
> 

Fixes tag - is it ed975065c31c ?

Thanks,
Avri

> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/ufs/core/ufshcd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 62c8575f2c67..66198eee51b0 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -5617,6 +5617,7 @@ static int ufshcd_poll(struct Scsi_Host *shost,
> unsigned int queue_num)
>         struct ufs_hw_queue *hwq;
> 
>         if (is_mcq_enabled(hba)) {
> +               WARN_ON_ONCE(queue_num ==
> UFSHCD_POLL_FROM_INTERRUPT_CONTEXT);
>                 hwq = &hba->uhq[queue_num];
> 
>                 return ufshcd_mcq_poll_cqe_lock(hba, hwq);
Bart Van Assche April 12, 2024, 4:31 p.m. UTC | #2
On 4/12/24 01:55, Avri Altman wrote:
>> The ufshcd_poll() implementation does not support queue_num ==
>> UFSHCD_POLL_FROM_INTERRUPT_CONTEXT in MCQ mode. Hence complain
>> if queue_num == UFSHCD_POLL_FROM_INTERRUPT_CONTEXT in MCQ mode.
> 
> Fixes tag - is it ed975065c31c ?

Isn't the Fixes tag for patches that fix a shortcoming? This patch does
not change the behavior of the UFS driver so I don't see it as a fix.

Thanks,

Bart.
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 62c8575f2c67..66198eee51b0 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5617,6 +5617,7 @@  static int ufshcd_poll(struct Scsi_Host *shost, unsigned int queue_num)
 	struct ufs_hw_queue *hwq;
 
 	if (is_mcq_enabled(hba)) {
+		WARN_ON_ONCE(queue_num == UFSHCD_POLL_FROM_INTERRUPT_CONTEXT);
 		hwq = &hba->uhq[queue_num];
 
 		return ufshcd_mcq_poll_cqe_lock(hba, hwq);