* Patch "mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow" has been added to the 4.12-stable tree
@ 2017-08-13 22:19 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-13 22:19 UTC (permalink / raw)
To: boris.brezillon, ada, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow
to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mtd-nand-declare-tbers-tr-and-tprog-as-u64-to-avoid-integer-overflow.patch
and it can be found in the queue-4.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 6d29231000bbe0fb9e4893a9c68151ffdd3b5469 Mon Sep 17 00:00:00 2001
From: Boris Brezillon <boris.brezillon@free-electrons.com>
Date: Mon, 31 Jul 2017 10:31:27 +0200
Subject: mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow
From: Boris Brezillon <boris.brezillon@free-electrons.com>
commit 6d29231000bbe0fb9e4893a9c68151ffdd3b5469 upstream.
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>
Reviewed-by: Alexander Dahl <ada@thorsis.com>
Tested-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mtd/nand/nand_timings.c | 6 +++---
include/linux/mtd/nand.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
--- 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
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);
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -638,10 +638,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;
Patches currently in stable-queue which might be from boris.brezillon@free-electrons.com are
queue-4.12/mtd-nand-atmel-fix-dt-backward-compatibility-in-pmecc.c.patch
queue-4.12/mtd-nand-fix-timing-setup-for-nands-that-do-not-support-set-features.patch
queue-4.12/mtd-nand-declare-tbers-tr-and-tprog-as-u64-to-avoid-integer-overflow.patch
queue-4.12/nand-fix-wrong-default-oob-layout-for-small-pages-using-soft-ecc.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-14 0:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-13 22:19 Patch "mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow" has been added to the 4.12-stable tree gregkh
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.