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, 29 Jan 2013 22:00:14 +0100
From:	Florian Fainelli <ffainelli@...ebox.fr>
To:	Huang Shijie <b32955@...escale.com>
Cc:	dwmw2@...radead.org, dedekind1@...il.com,
	matthieu.castet@...rot.com, linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mtd: fix the wrong timeo for panic_nand_wait()

Hello Huang,

Le mardi 22 janvier 2013 02:30:30, Huang Shijie a écrit :
> In nand_wait(), the timeo for panic_nand_wait() is assigned with
> wrong value(jiffies + some delay). The timeo should be set like the
> panic_nand_write() does.
> 
> This patch fixes it, and also uses the msecs_to_jiffies() to make the
> code more readable.

You are not exactly explaining what is the issue with the current code, and 
how you are fixing it. If someone needs to backport this patch for whatever 
reason, it must be clear as to what it fixes.

> 
> Signed-off-by: Huang Shijie <b32955@...escale.com>
> ---
> fix the compiler error in version 1, and add some commits.
> 
> ---
>  drivers/mtd/nand/nand_base.c |    8 ++------
>  1 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 8323ac9..a8c1fb4 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -825,13 +825,8 @@ static void panic_nand_wait(struct mtd_info *mtd,
> struct nand_chip *chip, static int nand_wait(struct mtd_info *mtd, struct
> nand_chip *chip) {
> 
> -	unsigned long timeo = jiffies;
>  	int status, state = chip->state;
> -
> -	if (state == FL_ERASING)
> -		timeo += (HZ * 400) / 1000;
> -	else
> -		timeo += (HZ * 20) / 1000;
> +	unsigned long timeo = (state == FL_ERASING ? 400 : 20);
> 
>  	led_trigger_event(nand_led_trigger, LED_FULL);
> 
> @@ -849,6 +844,7 @@ static int nand_wait(struct mtd_info *mtd, struct
> nand_chip *chip) if (in_interrupt() || oops_in_progress)
>  		panic_nand_wait(mtd, chip, timeo);
>  	else {
> +		timeo = jiffies + msecs_to_jiffies(timeo);
>  		while (time_before(jiffies, timeo)) {
>  			if (chip->dev_ready) {
>  				if (chip->dev_ready(mtd))

-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ