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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 24 Dec 2019 07:46:21 -0800
From:   Bart Van Assche <bvanassche@....org>
To:     Stanley Chu <stanley.chu@...iatek.com>, linux-scsi@...r.kernel.org,
        martin.petersen@...cle.com, avri.altman@....com,
        alim.akhtar@...sung.com, pedrom.sousa@...opsys.com,
        jejb@...ux.ibm.com, matthias.bgg@...il.com
Cc:     beanhuo@...ron.com, cang@...eaurora.org,
        linux-mediatek@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kuohong.wang@...iatek.com, peter.wang@...iatek.com,
        chun-hung.wu@...iatek.com, andy.teng@...iatek.com
Subject: Re: [PATCH v1 1/2] scsi: ufs: unify scsi_block_requests usage

On 2019-12-24 05:01, Stanley Chu wrote:
> Currently UFS driver has ufshcd_scsi_block_requests() with
> reference counter mechanism to avoid possible racing of blocking and
> unblocking requests flow. Unify all users in UFS driver to use the
> same function.
> 
> Signed-off-by: Stanley Chu <stanley.chu@...iatek.com>
> ---
>  drivers/scsi/ufs/ufshcd.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ed02a70..b6b9665 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -5177,7 +5177,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
>  	hba = container_of(work, struct ufs_hba, eeh_work);
>  
>  	pm_runtime_get_sync(hba->dev);
> -	scsi_block_requests(hba->host);
> +	ufshcd_scsi_block_requests(hba);
>  	err = ufshcd_get_ee_status(hba, &status);
>  	if (err) {
>  		dev_err(hba->dev, "%s: failed to get exception status %d\n",
> @@ -5191,7 +5191,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
>  		ufshcd_bkops_exception_event_handler(hba);
>  
>  out:
> -	scsi_unblock_requests(hba->host);
> +	ufshcd_scsi_unblock_requests(hba);
>  	pm_runtime_put_sync(hba->dev);
>  	return;
>  }

Hi Stanley,

>From the SCSI core:

void scsi_block_requests(struct Scsi_Host *shost)
{
	shost->host_self_blocked = 1;
}

In other words, neither scsi_block_requests() nor
ufshcd_scsi_block_requests() wait for ongoing ufshcd_queuecommand()
calls to finish. Is it required to wait for these calls to finish before
exceptions are handled? If not, can the scsi_block_requests() and
scsi_unblock_requests() calls be left out? If it is required to wait for
ongoing ufshcd_queuecommand() calls to finish then I think the
scsi_block_requests() and scsi_unblock_requests() will have to be
changed into something else.

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ