From 5a40b5fb2bb3a4d1c20149fe47ab25409026ee2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 24 Dec 2012 17:34:29 +0100 Subject: [PATCH 1/5] mtd: bcm47xxnflash: increase NFLASH_READY_RETRIES MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recently imlemented writing support has shown that current num of retries is too low. Writing requires longer waiting than simple reading. Signed-off-by: Rafał Miłecki Signed-off-by: David Woodhouse --- drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c index 86c9a79b89b..595de4012e7 100644 --- a/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c +++ b/drivers/mtd/nand/bcm47xxnflash/ops_bcm4706.c @@ -17,8 +17,8 @@ #include "bcm47xxnflash.h" /* Broadcom uses 1'000'000 but it seems to be too many. Tests on WNDR4500 has - * shown 164 retries as maxiumum. */ -#define NFLASH_READY_RETRIES 1000 + * shown ~1000 retries as maxiumum. */ +#define NFLASH_READY_RETRIES 10000 #define NFLASH_SECTOR_SIZE 512 From 7a9c83888761a9a26049b439dc0b09e7ea8a854b Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Thu, 3 Jan 2013 21:27:34 +0300 Subject: [PATCH 2/5] mtd: davinci_nand: fix modular build with CONFIG_OF=y Commit cdeadd712f52b16a9285386d61ee26fd14eb4085 (mtd: nand: davinci: add OF support for davinci nand controller) has never been really build tested with the driver as a module. When the driver is built-in, the missing semicolon after structure initializer is "compensated" by MODULE_DEVICE_TABLE() macro being empty and so the initializer using the trailing semicolon on the next line; when the driver is built as a module, compilation error ensues, and as the 'davinci_all_defconfig' has the NAND driver modular, this error prevents DaVinci family kernel from building... Signed-off-by: Sergei Shtylyov Signed-off-by: David Woodhouse Cc: stable@vger.kernel.org # 3.7 --- drivers/mtd/nand/davinci_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 3502606f648..feae55c7b88 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -523,7 +523,7 @@ static struct nand_ecclayout hwecc4_2048 __initconst = { static const struct of_device_id davinci_nand_of_match[] = { {.compatible = "ti,davinci-nand", }, {}, -} +}; MODULE_DEVICE_TABLE(of, davinci_nand_of_match); static struct davinci_nand_pdata From bf65aaa637cabae0386fe46b1ad5cd16997474f5 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Mon, 14 Jan 2013 20:01:37 +0100 Subject: [PATCH 3/5] mtd: docg3 fix missing bitreverse lib Fix missing dependency which can cause a build error such as: ERROR: "byte_rev_table" [drivers/mtd/devices/docg3.ko] undefined! Reported-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: Robert Jarzmik Signed-off-by: David Woodhouse --- drivers/mtd/devices/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig index 27f80cd8aef..46dcb54c32e 100644 --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig @@ -272,6 +272,7 @@ config MTD_DOCG3 tristate "M-Systems Disk-On-Chip G3" select BCH select BCH_CONST_PARAMS + select BITREVERSE ---help--- This provides an MTD device driver for the M-Systems DiskOnChip G3 devices. From 7dfe4be351e81656ca1068e5d4ead235c7ba94b1 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Sun, 23 Dec 2012 13:10:50 +0200 Subject: [PATCH 4/5] mtd: physmap_of: fix cmdline partition method w/o linux, mtd-name Commit d68cbdd4fb (mtd: physmap_of: allow to specify the mtd name for retro compatiblity) broke cmdline partitioning using dev_name() in the kernel command line. of_property_read_string() does not touch mtd_name when linux,mtd-name is not present in the device tree, which causes map.name to be set to a random value. Fix this by initializing mtd_name to NULL. Cc: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Baruch Siach Signed-off-by: David Woodhouse --- drivers/mtd/maps/physmap_of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 37cdc201652..6fb2bd83d7d 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -170,7 +170,7 @@ static int of_flash_probe(struct platform_device *dev) resource_size_t res_size; struct mtd_part_parser_data ppdata; bool map_indirect; - const char *mtd_name; + const char *mtd_name = NULL; match = of_match_device(of_flash_match, &dev->dev); if (!match) From 0ce82b7f7b7373b16ecf7b5725e21e2975204500 Mon Sep 17 00:00:00 2001 From: Matthieu CASTET Date: Wed, 16 Jan 2013 15:25:45 +0100 Subject: [PATCH 5/5] mtd: nand: onfi don't WARN if we are in 16 bits mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit ff3206b2450499203532af2505a7f6f8413e92c0 ('mtd: nand: onfi need to be probed in 8 bits mode') adds a WARN if the onfi probe is in 16 bits mode. This allows to detect driver that need to be fixed, but this is a bit noisy¹. Transform the WARN in a pr_err. ¹ http://article.gmane.org/gmane.linux.ports.arm.omap/91317 Signed-off-by: Matthieu CASTET Signed-off-by: David Woodhouse --- drivers/mtd/nand/nand_base.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 8323ac991ad..3766682a028 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -2857,8 +2857,11 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, int i; int val; - /* ONFI need to be probed in 8 bits mode */ - WARN_ON(chip->options & NAND_BUSWIDTH_16); + /* ONFI need to be probed in 8 bits mode, and 16 bits should be selected with NAND_BUSWIDTH_AUTO */ + if (chip->options & NAND_BUSWIDTH_16) { + pr_err("Trying ONFI probe in 16 bits mode, aborting !\n"); + return 0; + } /* Try ONFI for unknown chip or LP */ chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1); if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' ||