linux/drivers/mtd/nand
Brian Norris 68e8078072 mtd: nand: fix NAND_BUSWIDTH_AUTO for x16 devices
The code for NAND_BUSWIDTH_AUTO is broken. According to Alexander:

  "I have a problem with attach NAND UBI in 16 bit mode.
   NAND works fine if I specify NAND_BUSWIDTH_16 option, but not
   working with NAND_BUSWIDTH_AUTO option. In second case NAND
   chip is identifyed with ONFI."

See his report for the rest of the details:

  http://lists.infradead.org/pipermail/linux-mtd/2013-July/047515.html

Anyway, the problem is that nand_set_defaults() is called twice, we
intend it to reset the chip functions to their x16 buswidth verions
if the buswidth changed from x8 to x16; however, nand_set_defaults()
does exactly nothing if called a second time.

Fix this by hacking nand_set_defaults() to reset the buswidth-dependent
functions if they were set to the x8 version the first time. Note that
this does not do anything to reset from x16 to x8, but that's not the
supported use case for NAND_BUSWIDTH_AUTO anyway.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reported-by: Alexander Shiyan <shc_work@mail.ru>
Tested-by: Alexander Shiyan <shc_work@mail.ru>
Cc: Matthieu Castet <matthieu.castet@parrot.com>
Cc: <stable@vger.kernel.org> # v3.8+
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-08-05 21:02:31 +01:00
..
bcm47xxnflash Fairly unexciting MTD merge for 3.9: 2013-03-02 16:33:54 -08:00
gpmi-nand mtd: gpmi-nand: don't use devm_pinctrl_get_select_default() in probe 2013-08-05 21:01:20 +01:00
alauda.c mtd: driver _read() returns max_bitflips; mtd_read() returns -EUCLEAN 2012-05-13 23:14:23 -05:00
ams-delta.c mtd: nand: ams-delta: remove unnecessary platform_set_drvdata() 2013-08-05 20:58:30 +01:00
atmel_nand_ecc.h mtd: at91: atmel_nand: add Programmable Multibit ECC controller support 2012-07-06 18:23:25 +01:00
atmel_nand.c mtd: atmel_nand: don't use devm_pinctrl_get_select_default() in probe 2013-08-05 21:01:37 +01:00
au1550nd.c mtd: remove use of __devexit 2012-11-22 12:07:03 +02:00
bf5xx_nand.c mtd: nand: bf5xx_nand: remove unnecessary platform_set_drvdata() 2013-08-05 20:58:38 +01:00
cafe_nand.c mtd: nand: subpage write support for hardware based ECC schemes 2013-04-05 13:22:59 +01:00
cmx270_nand.c mtd: kill MTD_NAND_VERIFY_WRITE 2012-09-29 15:00:46 +01:00
cs553x_nand.c mtd cs553x_nand: Initialise ecc.strength before nand_scan() 2012-12-03 16:36:34 +02:00
davinci_nand.c mtd: nand: davinci: use devm_ioremap_resource() 2013-08-05 20:49:10 +01:00
denali_dt.c mtd: denali_dt: Remove redundant use of of_match_ptr 2013-04-05 14:04:34 +01:00
denali_pci.c mtd: remove use of __devexit 2012-11-22 12:07:03 +02:00
denali.c mtd: denali: split the generic driver and PCI layer 2012-11-15 15:37:46 +02:00
denali.h mtd: denali: add a DT driver 2012-11-15 15:37:46 +02:00
diskonchip.c mtd: diskonchip: remove unused entries in Kconfig 2013-08-05 21:01:55 +01:00
docg4.c mtd: nand: docg4: remove unnecessary platform_set_drvdata() 2013-08-05 20:58:42 +01:00
fsl_elbc_nand.c mtd: remove use of __devinit 2012-11-22 12:07:03 +02:00
fsl_ifc_nand.c mtd: fsl_ifc_nand: set NAND_NO_SUBPAGE_WRITE 2013-08-05 19:09:39 +01:00
fsl_upm.c Drivers: mtd: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
fsmc_nand.c mtd: nand: fsmc_nand: remove unnecessary platform_set_drvdata() 2013-08-05 20:58:57 +01:00
gpio.c mtd: nand-gpio: Add missing "owner" field in platform_driver struct 2013-08-05 20:46:21 +01:00
jz4740_nand.c mtd: nand: jz4740_nand: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:05 +01:00
Kconfig mtd: nand-gpio: Unneeded dependency on ARM removed 2013-08-05 20:46:06 +01:00
lpc32xx_mlc.c mtd: nand: lpc32xx: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:06 +01:00
lpc32xx_slc.c mtd: nand: lpc32xx: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:06 +01:00
Makefile mtd: remove the h1910 NAND driver 2013-04-05 13:15:17 +01:00
mpc5121_nfc.c mtd: remove use of __devexit 2012-11-22 12:07:03 +02:00
mxc_nand.c mtd: nand: mxc_nand: Remove unneeded check for platform_get_resource() 2013-08-05 21:01:17 +01:00
nand_base.c mtd: nand: fix NAND_BUSWIDTH_AUTO for x16 devices 2013-08-05 21:02:31 +01:00
nand_bbt.c mtd: nand: remove AG-AND support 2013-04-05 12:00:50 +01:00
nand_bch.c mtd: cleanup style on pr_debug messages 2011-09-11 15:02:16 +03:00
nand_ecc.c mtd: nane: print source of error message 2013-02-04 09:27:19 +02:00
nand_ids.c mtd: nand_ids: use size macros 2013-04-05 13:22:06 +01:00
nandsim.c mtd: nand: remove few tiny page NAND bits 2013-04-05 12:03:16 +01:00
ndfc.c mtd: remove use of __devexit 2012-11-22 12:07:03 +02:00
nuc900_nand.c mtd: nand: nuc900_nand: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:09 +01:00
omap2.c mtd: nand: omap2: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:13 +01:00
orion_nand.c mtd: nand: orion_nand: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:14 +01:00
pasemi_nand.c mtd: remove use of __devexit 2012-11-22 12:07:03 +02:00
plat_nand.c mtd: nand: plat_nand: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:16 +01:00
pxa3xx_nand.c mtd: nand: pxa3xx_nand: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:17 +01:00
r852.c mtd: r852: add CONFIG_PM_SLEEP to suspend/resume functions 2013-08-05 19:00:12 +01:00
r852.h mtd: r852: remove useless pci powerup/down from suspend/resume routines 2010-10-25 01:32:21 +01:00
s3c2410.c mtd: nand: s3c2410: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:19 +01:00
sh_flctl.c mtd: sh_flctl: Use of_match_ptr() macro 2013-04-05 13:20:14 +01:00
sharpsl.c mtd: nand: sharpsl: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:21 +01:00
sm_common.c mtd: nand_ids: use size macros 2013-04-05 13:22:06 +01:00
sm_common.h
socrates_nand.c mtd: remove use of __devexit 2012-11-22 12:07:03 +02:00
tmio_nand.c mtd: kill MTD_NAND_VERIFY_WRITE 2012-09-29 15:00:46 +01:00
txx9ndfmc.c mtd: nand: txx9ndfmc: remove unnecessary platform_set_drvdata() 2013-08-05 20:59:22 +01:00
xway_nand.c mtd: lantiq: Add NAND support on Lantiq XWAY SoC. 2012-09-29 15:05:18 +01:00