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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 19 Apr 2022 09:40:51 +0200
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     cgel.zte@...il.com
Cc:     han.xu@....com, linux-mtd@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] mtd: nand: gpmi-nand: using pm_runtime_resume_and_get
 instead of pm_runtime_get_sync

Hello,

cgel.zte@...il.com wrote on Mon, 18 Apr 2022 10:55:49 +0000:

> From: Minghao Chi <chi.minghao@....com.cn>
> 
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code

Would you mind reducing a little bit the title of the commit? Othewise
fine by me.

> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
> ---
>  drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> index 44b14c9dc9a7..6e7477aef8a7 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> @@ -148,11 +148,9 @@ static int gpmi_init(struct gpmi_nand_data *this)
>  	struct resources *r = &this->resources;
>  	int ret;
>  
> -	ret = pm_runtime_get_sync(this->dev);
> -	if (ret < 0) {
> -		pm_runtime_put_noidle(this->dev);
> +	ret = pm_runtime_resume_and_get(this->dev);
> +	if (ret < 0)
>  		return ret;
> -	}
>  
>  	ret = gpmi_reset_block(r->gpmi_regs, false);
>  	if (ret)
> @@ -544,11 +542,9 @@ static int bch_set_geometry(struct gpmi_nand_data *this)
>  	if (ret)
>  		return ret;
>  
> -	ret = pm_runtime_get_sync(this->dev);
> -	if (ret < 0) {
> -		pm_runtime_put_autosuspend(this->dev);
> +	ret = pm_runtime_resume_and_get(this->dev);
> +	if (ret < 0)
>  		return ret;
> -	}
>  
>  	/*
>  	* Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this
> @@ -2286,11 +2282,9 @@ static int gpmi_nfc_exec_op(struct nand_chip *chip,
>  	for (i = 0; i < GPMI_MAX_TRANSFERS; i++)
>  		this->transfers[i].direction = DMA_NONE;
>  
> -	ret = pm_runtime_get_sync(this->dev);
> -	if (ret < 0) {
> -		pm_runtime_put_noidle(this->dev);
> +	ret = pm_runtime_resume_and_get(this->dev);
> +	if (ret < 0)
>  		return ret;
> -	}
>  
>  	/*
>  	 * This driver currently supports only one NAND chip. Plus, dies share


Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ