All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: linux-mtd@lists.infradead.org
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	stable@vger.kernel.org, Marek Vasut <marek.vasut@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow
Date: Mon, 31 Jul 2017 14:06:15 +0200	[thread overview]
Message-ID: <2615235.I2bcY56GkF@ada> (raw)
In-Reply-To: <1501489887-7372-1-git-send-email-boris.brezillon@free-electrons.com>

Hello,

Reviewed-by: Alexander Dahl <ada@thorsis.com>
Tested-by: Alexander Dahl <ada@thorsis.com>

Greets
Alex

Am Montag, 31. Juli 2017, 10:31:27 schrieb Boris Brezillon:
> All timings in nand_sdr_timings are expressed in picoseconds but some
> of them may not fit in an u32.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: 204e7ecd47e2 ("mtd: nand: Add a few more timings to
> nand_sdr_timings") Reported-by: Alexander Dahl <ada@thorsis.com>
> Cc: <stable@vger.kernel.org>
> ---
>  drivers/mtd/nand/nand_timings.c | 6 +++---
>  include/linux/mtd/nand.h        | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_timings.c
> b/drivers/mtd/nand/nand_timings.c index f06312df3669..7e36d7d13c26
> 100644
> --- a/drivers/mtd/nand/nand_timings.c
> +++ b/drivers/mtd/nand/nand_timings.c
> @@ -311,9 +311,9 @@ int onfi_init_data_interface(struct nand_chip
> *chip, struct nand_sdr_timings *timings = &iface->timings.sdr;
> 
>  		/* microseconds -> picoseconds */
> -		timings->tPROG_max = 1000000UL * le16_to_cpu(params->t_prog);
> -		timings->tBERS_max = 1000000UL * le16_to_cpu(params->t_bers);
> -		timings->tR_max = 1000000UL * le16_to_cpu(params->t_r);
> +		timings->tPROG_max = 1000000ULL * le16_to_cpu(params->t_prog);
> +		timings->tBERS_max = 1000000ULL * le16_to_cpu(params->t_bers);
> +		timings->tR_max = 1000000ULL * le16_to_cpu(params->t_r);
> 
>  		/* nanoseconds -> picoseconds */
>  		timings->tCCS_min = 1000UL * le16_to_cpu(params->t_ccs);
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 892148c448cc..5216d2eb2289 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -681,10 +681,10 @@ struct nand_buffers {
>   * @tWW_min: WP# transition to WE# low
>   */
>  struct nand_sdr_timings {
> -	u32 tBERS_max;
> +	u64 tBERS_max;
>  	u32 tCCS_min;
> -	u32 tPROG_max;
> -	u32 tR_max;
> +	u64 tPROG_max;
> +	u64 tR_max;
>  	u32 tALH_min;
>  	u32 tADL_min;
>  	u32 tALS_min;

-- 
------------------------------------------------------------------------
Thorsis Technologies GmbH                     Tel.: +49-391-544 563-3036
Oststraße 18                                  Fax.: +49-391-544 563-9099
39114 Magdeburg                                  http://www.thorsis.com/

Sitz der Gesellschaft: Magdeburg
Amtsgericht Stendal HRB 110339
Geschäftsführer: Dipl.-Ing. Thorsten Szczepanski
------------------------------------------------------------------------

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Dahl <ada@thorsis.com>
To: linux-mtd@lists.infradead.org
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
	Richard Weinberger <richard@nod.at>,
	stable@vger.kernel.org, Marek Vasut <marek.vasut@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow
Date: Mon, 31 Jul 2017 14:06:15 +0200	[thread overview]
Message-ID: <2615235.I2bcY56GkF@ada> (raw)
In-Reply-To: <1501489887-7372-1-git-send-email-boris.brezillon@free-electrons.com>

Hello,

Reviewed-by: Alexander Dahl <ada@thorsis.com>
Tested-by: Alexander Dahl <ada@thorsis.com>

Greets
Alex

Am Montag, 31. Juli 2017, 10:31:27 schrieb Boris Brezillon:
> All timings in nand_sdr_timings are expressed in picoseconds but some
> of them may not fit in an u32.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Fixes: 204e7ecd47e2 ("mtd: nand: Add a few more timings to
> nand_sdr_timings") Reported-by: Alexander Dahl <ada@thorsis.com>
> Cc: <stable@vger.kernel.org>
> ---
>  drivers/mtd/nand/nand_timings.c | 6 +++---
>  include/linux/mtd/nand.h        | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_timings.c
> b/drivers/mtd/nand/nand_timings.c index f06312df3669..7e36d7d13c26
> 100644
> --- a/drivers/mtd/nand/nand_timings.c
> +++ b/drivers/mtd/nand/nand_timings.c
> @@ -311,9 +311,9 @@ int onfi_init_data_interface(struct nand_chip
> *chip, struct nand_sdr_timings *timings = &iface->timings.sdr;
> 
>  		/* microseconds -> picoseconds */
> -		timings->tPROG_max = 1000000UL * le16_to_cpu(params->t_prog);
> -		timings->tBERS_max = 1000000UL * le16_to_cpu(params->t_bers);
> -		timings->tR_max = 1000000UL * le16_to_cpu(params->t_r);
> +		timings->tPROG_max = 1000000ULL * le16_to_cpu(params->t_prog);
> +		timings->tBERS_max = 1000000ULL * le16_to_cpu(params->t_bers);
> +		timings->tR_max = 1000000ULL * le16_to_cpu(params->t_r);
> 
>  		/* nanoseconds -> picoseconds */
>  		timings->tCCS_min = 1000UL * le16_to_cpu(params->t_ccs);
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 892148c448cc..5216d2eb2289 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -681,10 +681,10 @@ struct nand_buffers {
>   * @tWW_min: WP# transition to WE# low
>   */
>  struct nand_sdr_timings {
> -	u32 tBERS_max;
> +	u64 tBERS_max;
>  	u32 tCCS_min;
> -	u32 tPROG_max;
> -	u32 tR_max;
> +	u64 tPROG_max;
> +	u64 tR_max;
>  	u32 tALH_min;
>  	u32 tADL_min;
>  	u32 tALS_min;

-- 
------------------------------------------------------------------------
Thorsis Technologies GmbH                     Tel.: +49-391-544 563-3036
Oststra�e 18                                  Fax.: +49-391-544 563-9099
39114 Magdeburg                                  http://www.thorsis.com/

Sitz der Gesellschaft: Magdeburg
Amtsgericht Stendal HRB 110339
Gesch�ftsf�hrer: Dipl.-Ing. Thorsten Szczepanski
------------------------------------------------------------------------

  reply	other threads:[~2017-07-31 12:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31  8:31 [PATCH] mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow Boris Brezillon
2017-07-31 12:06 ` Alexander Dahl [this message]
2017-07-31 12:06   ` Alexander Dahl
2017-07-31 16:28 ` Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2615235.I2bcY56GkF@ada \
    --to=ada@thorsis.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.