lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4bedb8bf-241f-03d8-9f84-1e070ab4c3d8@acm.org>
Date:   Wed, 18 Jan 2023 13:59:36 -0800
From:   Bart Van Assche <bvanassche@....org>
To:     Mason Zhang <mason.zhang@...iatek.com>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Avri Altman <avri.altman@....com>,
        "James E . J . Bottomley" <jejb@...ux.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Bean Huo <beanhuo@...ron.com>,
        Stanley Chu <stanley.chu@...iatek.com>,
        Jinyoung Choi <j-young.choi@...sung.com>
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org,
        Peter Wang <peter.wang@...iatek.com>,
        Peng Zhou <peng.zhou@...iatek.com>, wsd_upstream@...iatek.com
Subject: Re: [PATCH v4 1/1] scsi: ufs: core: fix device management cmd timeout
 flow

On 12/15/22 19:25, Mason Zhang wrote:
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index b1f59a5fe632..fa86ce80f350 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -3008,6 +3008,22 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
>   		} else {
>   			dev_err(hba->dev, "%s: failed to clear tag %d\n",
>   				__func__, lrbp->task_tag);
> +
> +			spin_lock_irqsave(&hba->outstanding_lock, flags);
> +			pending = test_bit(lrbp->task_tag,
> +					   &hba->outstanding_reqs);
> +			if (pending)
> +				hba->dev_cmd.complete = NULL;
> +			spin_unlock_irqrestore(&hba->outstanding_lock, flags);
> +
> +			if (!pending) {
> +				/*
> +				 * The completion handler ran while we tried to
> +				 * clear the command.
> +				 */
> +				time_left = 1;
> +				goto retry;
> +			}
>   		}
>   	}

Reviewed-by: Bart Van Assche <bvanassche@....org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ