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: <3bb0f5ad-2cea-2509-a9e1-d8ed159bd875@acm.org>
Date:   Tue, 18 Jan 2022 16:45:41 -0800
From:   Bart Van Assche <bvanassche@....org>
To:     Kiwoong Kim <kwmad.kim@...sung.com>, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org, alim.akhtar@...sung.com,
        avri.altman@....com, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, beanhuo@...ron.com,
        cang@...eaurora.org, adrian.hunter@...el.com, sc.suh@...sung.com,
        hy50.seo@...sung.com, sh425.lee@...sung.com,
        bhoon95.kim@...sung.com, vkumar.1997@...sung.com
Subject: Re: [PATCH v1] scsi: ufs: use an generic error code in
 ufshcd_set_dev_pwr_mode

On 1/17/22 02:29, Kiwoong Kim wrote:
> The return value of ufshcd_set_dev_pwr_mode is given to
> device pm core. However, the function currently returns a result
> in scsi command and the device pm core doesn't understand it.
> It might lead to unexpected behaviors of user land. I found
> the return value led to platform reset in Android.
> 
> This patch is to use an generic code for SSU failures.
> 
> Signed-off-by: Kiwoong Kim <kwmad.kim@...sung.com>
> ---
>   drivers/scsi/ufs/ufshcd.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 1049e41..a60816c 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -8669,6 +8669,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
>   			    pwr_mode, ret);
>   		if (ret > 0 && scsi_sense_valid(&sshdr))
>   			scsi_print_sense_hdr(sdp, NULL, &sshdr);
> +		ret = -EIO;
>   	}
>   
>   	if (!ret)

Shouldn't "ret = -EIO" only be executed if ret > 0? Additionally, please 
update the documentation of ufshcd_set_dev_pwr_mode(). I'm referring to 
the following comment: "Returns non-zero if failed to set the requested 
power mode".

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ