firefly-linux-kernel-4.4.55.git
10 years agomtd: nand: davinci: don't request AEMIF address range
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:38:31 +0000 (15:38 +0200)]
mtd: nand: davinci: don't request AEMIF address range

The TI AEMIF driver registers are used to setup timings for each chip
select. The same registers range is used to setup NAND settings.
The AEMIF and NAND drivers not use the same registers in this range.

In case with TI AEMIF driver, the memory address range is requested
already by AEMIF, so we cannot request it twice, just ioremap.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: reuse driver for Keystone arch
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:38:12 +0000 (15:38 +0200)]
mtd: nand: davinci: reuse driver for Keystone arch

The Keystone arch has compatible nand device, so reuse it.
In case with Keystone it depends on TI_AEMIF because AEMIF
driver is responsible to set timings.

See http://www.ti.com/lit/ug/sprugz3a/sprugz3a.pdf

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: adjust DT properties to MTD generic
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:37:56 +0000 (15:37 +0200)]
mtd: nand: davinci: adjust DT properties to MTD generic

The properties davinci-ecc-mode, davinci-nand-use-bbt, davinci-nand-buswidth
are MTD generic. Correct names for them are: nand-ecc-mode, nand-on-flash-bbt,
nand-bus-width accordingly. So rename them in dts and documentation.

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: extend description of bindings
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:37:37 +0000 (15:37 +0200)]
mtd: nand: davinci: extend description of bindings

Extend bindings for davinci_nand driver to be more clear.
This is clarification only, without semantic changes.

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: move bindings under mtd
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:37:22 +0000 (15:37 +0200)]
mtd: nand: davinci: move bindings under mtd

Move bindings under mtd. Do this in order to make davinci-nand
driver usable by keystone architecture.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: simplify error handling
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:37:00 +0000 (15:37 +0200)]
mtd: nand: davinci: simplify error handling

There is not needed to use a lot of names for err handling.
It complicates code support and reading.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: check required ti,davinci-chipselect property
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:36:44 +0000 (15:36 +0200)]
mtd: nand: davinci: check required ti,davinci-chipselect property

The property "ti,davinci-chipselect" is required. So we have to check
if it is set.

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: return ENOMEM if memory allocation is failed
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:36:05 +0000 (15:36 +0200)]
mtd: nand: davinci: return ENOMEM if memory allocation is failed

In case when memory allocation is failed the driver should return
ENOMEM instead of ENODEV.

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: davinci: fix driver registration
Ivan Khoronzhuk [Tue, 17 Dec 2013 13:33:50 +0000 (15:33 +0200)]
mtd: nand: davinci: fix driver registration

When kernel is booted using DT, there is no guarantee that Davinci
NAND device has been created already at the time when driver init
function is executed. Therefore, platform_driver_probe() can't be used
because this may result the Davinci NAND driver will never be probed.
The driver probing has to be made with core mechanism.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: au1550nd: add missing platform_set_drvdata()
Wei Yongjun [Mon, 11 Nov 2013 06:18:29 +0000 (14:18 +0800)]
mtd: au1550nd: add missing platform_set_drvdata()

Add missing platform_set_drvdata() in au1550nd_probe(), otherwise
calling platform_get_drvdata() in remove returns NULL.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: mxc_nand: add missing clk_disable_unprepare() in mxcnd_remove()
Wei Yongjun [Tue, 17 Dec 2013 03:35:35 +0000 (11:35 +0800)]
mtd: mxc_nand: add missing clk_disable_unprepare() in mxcnd_remove()

clock source is prepared and enabled by clk_prepare_enable() in
mxcnd_probe() function, but no disable/unprepare in mxcnd_remove().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: sh_flctl: Remove unneeded CONFIG_OF
Ezequiel Garcia [Sat, 7 Dec 2013 14:31:01 +0000 (11:31 -0300)]
mtd: nand: sh_flctl: Remove unneeded CONFIG_OF

Since the of_mtd header provides dummy stubs for !CONFIG_OF, it's safe
to remove the #ifdef CONFIG_OF. Build tested only.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoMAINTAINERS: mtd: add PXA3xx NAND driver to MAINTAINERS
Ezequiel Garcia [Wed, 4 Dec 2013 23:28:46 +0000 (15:28 -0800)]
MAINTAINERS: mtd: add PXA3xx NAND driver to MAINTAINERS

Add the pxa3xx-nand driver which supports PXA3xx and Armada 370/XP SoC
family to MAINTAINERS to ensure I get proper Cc on patches.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoMAINTAINERS: mtd: add Brian Norris for MTD maintenance
Brian Norris [Wed, 4 Dec 2013 23:28:45 +0000 (15:28 -0800)]
MAINTAINERS: mtd: add Brian Norris for MTD maintenance

While we're at it, change the git URL to remove the version legacy. It's
been a symlink to linux-mtd.git for a while now anyway.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
10 years agomtd: denali: remove DEFINE_PCI_DEVICE_TABLE macro
Jingoo Han [Mon, 2 Dec 2013 23:18:28 +0000 (08:18 +0900)]
mtd: denali: remove DEFINE_PCI_DEVICE_TABLE macro

Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: sh_flctl: use devm_* managed allocators
Laurent Pinchart [Wed, 27 Nov 2013 10:27:44 +0000 (11:27 +0100)]
mtd: sh_flctl: use devm_* managed allocators

This simplifies error and cleanup code paths.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: sh_flctl: fix warnings due to improper casts
Laurent Pinchart [Wed, 27 Nov 2013 10:17:28 +0000 (11:17 +0100)]
mtd: sh_flctl: fix warnings due to improper casts

Cast pointers to uintptr_t instead of unsigned int. This fixes warnings
on platforms where pointers have a different size than int.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: sh_flctl: enable driver compilation with COMPILE_TEST
Laurent Pinchart [Wed, 27 Nov 2013 01:18:31 +0000 (02:18 +0100)]
mtd: sh_flctl: enable driver compilation with COMPILE_TEST

This helps increasing build testing coverage.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: make register_mtd_parser return void
Axel Lin [Sun, 1 Dec 2013 11:01:06 +0000 (19:01 +0800)]
mtd: make register_mtd_parser return void

register_mtd_parser never fails; hence make it return void.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: make deregister_mtd_parser return void
Axel Lin [Sun, 1 Dec 2013 10:59:15 +0000 (18:59 +0800)]
mtd: make deregister_mtd_parser return void

deregister_mtd_parser never fails; hence make it return void.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agojffs2: NULL return of kmem_cache_zalloc should be handled
Zhouyi Zhou [Mon, 2 Dec 2013 10:37:05 +0000 (18:37 +0800)]
jffs2: NULL return of kmem_cache_zalloc should be handled

NULL return of kmem_cache_zalloc should be handled in jffs2_alloc_xattr_datum
and jff2_alloc_xattr_ref.

Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: refactor print messages
Ezequiel Garcia [Mon, 25 Nov 2013 11:30:31 +0000 (08:30 -0300)]
mtd: nand: refactor print messages

Add a nice "nand:" prefix to all pr_xxx() messages. This allows
to get rid of the "NAND" words in messages, given the context
is already given by the prefix.

Remove the __func__ report from messages where it's not needed and refactor
the device detection messages to show itself in several lines.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: tests: mtd_nandecctest: Use IS_ENABLED() macro
Fabio Estevam [Mon, 2 Dec 2013 02:30:27 +0000 (00:30 -0200)]
mtd: tests: mtd_nandecctest: Use IS_ENABLED() macro

Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: convert to use ATTRIBUTE_GROUPS
Axel Lin [Mon, 2 Dec 2013 02:12:25 +0000 (10:12 +0800)]
mtd: convert to use ATTRIBUTE_GROUPS

Use new ATTRIBUTE_GROUPS macro to declare attribute groups.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: m25p80: add support for m25px16
Igor Grinberg [Mon, 11 Nov 2013 20:55:29 +0000 (22:55 +0200)]
mtd: m25p80: add support for m25px16

Add support for Micron m25px16 spi flash chip.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: mxc_nand: Check the return value from clk_prepare_enable()
Fabio Estevam [Mon, 2 Dec 2013 02:50:02 +0000 (00:50 -0200)]
mtd: nand: mxc_nand: Check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: mxc_nand: remove duplicated ecc_stats counting
Michael Grzeschik [Fri, 29 Nov 2013 13:14:29 +0000 (14:14 +0100)]
mtd: mxc_nand: remove duplicated ecc_stats counting

The ecc_stats.corrected count variable will already be incremented in
the above framework-layer just after this callback.

Cc: stable@vger.kernel.org # 2.6.36+
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoof_mtd: fix header file include guard
Philipp Rosenberger [Thu, 28 Nov 2013 11:36:52 +0000 (12:36 +0100)]
of_mtd: fix header file include guard

It seems the include guard was copied from of_net.h.

Signed-off-by: Philipp Rosenberger <philipp.rosenberger@xse.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: fix misspelling in ONFI parameter field name
Brian Norris [Mon, 2 Dec 2013 19:12:22 +0000 (11:12 -0800)]
mtd: nand: fix misspelling in ONFI parameter field name

s/strenght/strength/

This field isn't used anywhere, so this rename is safe.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: dataflash: remove unnecessary spi_set_drvdata()
Jingoo Han [Mon, 25 Nov 2013 03:24:22 +0000 (12:24 +0900)]
mtd: dataflash: remove unnecessary spi_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq
Wei Yongjun [Wed, 25 Sep 2013 07:40:38 +0000 (15:40 +0800)]
mtd: mpc5121_nfc: drop devm_free_irq of devm_ allocated irq

The devm_request_irq function allocates irq that is released
when a driver detaches. Thus, there is no reason to explicitly
call devm_free_irq in probe or remove functions.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: change pr_debug to dev_dbg
Huang Shijie [Wed, 20 Nov 2013 02:09:44 +0000 (10:09 +0800)]
mtd: gpmi: change pr_debug to dev_dbg

change all the pr_debug to dev_dbg.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: change pr_err to dev_err
Huang Shijie [Wed, 20 Nov 2013 02:09:43 +0000 (10:09 +0800)]
mtd: gpmi: change pr_err to dev_err

There are pr_err and dev_err in the gpmi driver now.
It makes people confused.

This patch changes all the pr_err to dev_err except the one
in the gpmi_reset_block(). We also remove the unnecessary
print for OOM message.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: remove the unnecessary pr_err()
Huang Shijie [Tue, 19 Nov 2013 02:57:50 +0000 (10:57 +0800)]
mtd: gpmi: remove the unnecessary pr_err()

The error messages for the failure of dmaengine_prep_slave_sg are
not necessary, this patch removes all these pr_err, and returns with
the proper error code -EINVAL, not -1.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: diskonchip: Request memory region prior ioremap()
Alexander Shiyan [Wed, 13 Nov 2013 11:59:25 +0000 (15:59 +0400)]
mtd: nand: diskonchip: Request memory region prior ioremap()

This patch adds request_mem_region() prior ioremap() for diskonchip
driver. This will allow to check if memory region is occupied by any
other device, for example in case if we have memory region for several
optional devices and only one device can be used at once.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: use devm_request_irq
Huang Shijie [Thu, 14 Nov 2013 06:25:49 +0000 (14:25 +0800)]
mtd: gpmi: use devm_request_irq

Use devm_request_irq to simplify the code.
Also remove the unused fields of structure resources{}.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: use devm_ioremap_resource
Huang Shijie [Thu, 14 Nov 2013 06:25:48 +0000 (14:25 +0800)]
mtd: gpmi: use devm_ioremap_resource

Use the devm_ioremap_resource to simplify the code.

[Note: as a side effect, this adds a missing call to request_memory().]

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: rename the functions from gpmi_nfc_* to gpmi_nand_*
Huang Shijie [Thu, 14 Nov 2013 06:25:47 +0000 (14:25 +0800)]
mtd: gpmi: rename the functions from gpmi_nfc_* to gpmi_nand_*

The gpmi_nfc_* is the legacy name. In order to avoid the confusion,
The patch renames the gpmi_nfc_* functions to gpmi_nand_*.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: remove the unused line
Huang Shijie [Thu, 14 Nov 2013 06:25:46 +0000 (14:25 +0800)]
mtd: gpmi: remove the unused line

We do not use the chip->oob_poi in the mx23_write_transcription_stamp.
So remove the unused line.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: delete the gpmi_pre_bbt_scan
Huang Shijie [Thu, 14 Nov 2013 06:25:45 +0000 (14:25 +0800)]
mtd: gpmi: delete the gpmi_pre_bbt_scan

We do not scan the BBT after we call the gpmi_pre_bbt_scan,
so it has lost the meaning of existence.

This patch merges this function into gpmi_init_last, and delete it.
This patch does not change any logic.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: do not use the local array to do the DMA transfer
Huang Shijie [Thu, 14 Nov 2013 06:25:44 +0000 (14:25 +0800)]
mtd: gpmi: do not use the local array to do the DMA transfer

The local array feature[] is in the stack. We can see the warning
when we enable the CONFIG_DMA_API_DEBUG:
----------------------------------------------------------
WARNING: at lib/dma-debug.c:950 check_for_stack+0xac/0xf8()
gpmi-nand 112000.gpmi-nand: DMA-API: device driver maps memory fromstack [addr=dc05be34]
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.17-16851-g2414a73 #1324
[<80014cbc>] (unwind_backtrace+0x0/0x138) from [<8001251c>] (show_stack+0x10/0x14)
[<8001251c>] (show_stack+0x10/0x14) from [<8002699c>] (warn_slowpath_common+0x4c/0x68)
[<8002699c>] (warn_slowpath_common+0x4c/0x68) from [<80026a4c>] (warn_slowpath_fmt+0x30/0x40)
[<80026a4c>] (warn_slowpath_fmt+0x30/0x40) from [<8028e2f8>] (check_for_stack+0xac/0xf8)
[<8028e2f8>] (check_for_stack+0xac/0xf8) from [<8028e438>] (debug_dma_map_sg+0xf4/0x188)
[<8028e438>] (debug_dma_map_sg+0xf4/0x188) from [<803968d0>] (prepare_data_dma+0xb8/0x1a8)
[<803968d0>] (prepare_data_dma+0xb8/0x1a8) from [<80397b20>] (gpmi_send_data+0x84/0xfc)
[<80397b20>] (gpmi_send_data+0x84/0xfc) from [<8038c2b4>] (nand_onfi_set_features+0x50/0x74)
[<8038c2b4>] (nand_onfi_set_features+0x50/0x74) from [<80397198>] (gpmi_extra_init+0x90/0x170)
[<80397198>] (gpmi_extra_init+0x90/0x170) from [<8039520c>] (gpmi_nand_probe+0x2f8/0xb3c)
[<8039520c>] (gpmi_nand_probe+0x2f8/0xb3c) from [<8031b974>] (platform_drv_probe+0x18/0x1c)
----------------------------------------------------------

The patch uses the kzalloc to allocate the buffer, and free it when
we do not use it anymore.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: make ECC configuration checks more explicit
Brian Norris [Thu, 14 Nov 2013 22:41:32 +0000 (14:41 -0800)]
mtd: nand: pxa3xx: make ECC configuration checks more explicit

The Armada BCH configuration in this driver uses one of the two
following ECC schemes:

 16-bit correction per 2048 bytes
 16-bit correction per 1024 bytes

These are sufficient for mapping to the 4-bit per 512-bytes and 8-bit
per 512-bytes (respectively) minimum correctability requirements of many
common NAND.

The current code only checks for the required strength (4-bit or 8-bit)
without checking the ECC step size that is associated with that strength
(and simply assumes it is 512). While that is often a safe assumption to
make, let's make it explicit, since we have that information.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
10 years agomtd: nand: pxa3xx: Add ECC BCH correctable errors detection
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:39 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Add ECC BCH correctable errors detection

This commit extends the ECC correctable error detection to include
ECC BCH errors. The number of BCH correctable errors can be any up to 16,
and the actual value is exposed in the NDSR register.

Therefore, we change some symbol names to refer to correctable or
uncorrectable (instead of single-bit or double-bit as it was in the
Hamming case) and while at it, cleanup the detection code slightly.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Add multiple chunk write support
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:38 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Add multiple chunk write support

This commit adds write support for large pages (4 KiB, 8 KiB).
Such support is implemented by issuing a multiple command sequence,
transfering a set of 2 KiB chunks per transaction.

The splitted command sequence requires to send the SEQIN command
independently of the PAGEPROG command and therefore it's set as
an execution command.

Since PAGEPROG enables ECC, each 2 KiB chunk of data is written
together with ECC code at a controller-fixed location within
the flash page.

Currently, only devices with a 4 KiB page size has been tested.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Introduce multiple page I/O support
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:37 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Introduce multiple page I/O support

As preparation work to fully support large pages, this commit adds
the initial infrastructure to support splitted (aka chunked) I/O
operation. This commit adds support for read, and follow-up patches
will add write support.

When a read (aka READ0) command is issued, the driver loops issuing
the same command until all the requested data is transfered, changing
the 'extended' command field as needed.

For instance, if the driver is required to read a 4 KiB page, using a
chunk size of 2 KiB, the transaction is splitted in:
1. Monolithic read, first 2 KiB page chunk is read
2. Last naked read, second and last 2KiB page chunk is read

If ECC is enabled it is calculated on each chunk transfered and added
at a controller-fixed location after the data chunk that must be
spare area.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Add a read/write buffers markers
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:36 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Add a read/write buffers markers

In preparation to support multiple (aka chunked, aka splitted)
page I/O, this commit adds 'data_buff_pos' and 'oob_buff_pos' fields
to keep track of where the next read (or write) should be done.

This will allow multiple calls to handle_data_pio() to continue
the read (or write) operation.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Fix SEQIN column address set
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:35 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Fix SEQIN column address set

This commit adds support page programming with a non-zero "column"
address setting. This is important to support OOB writing, through
command sequences such as:

  cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, ofs);
  write_buf(mtd, oob_buf, 6);
  cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Move the data buffer clean to prepare_start_command()
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:34 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Move the data buffer clean to prepare_start_command()

To allow future support of multiple page reading/writing, move the data
buffer clean out of prepare_set_command().

This is done to prevent the data buffer from being cleaned on every command
preparation, when a multiple command sequence is implemented to read/write
pages larger than the FIFO size (2 KiB).

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Split prepare_command_pool() in two stages
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:33 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Split prepare_command_pool() in two stages

This commit splits the prepare_command_pool() function into two
stages: prepare_start_command() / prepare_set_command().

This is a preparation patch without any functionality changes,
and is meant to allow support for multiple page reading/writing
operations.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Remove READ0 switch/case falltrough
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:32 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Remove READ0 switch/case falltrough

READ0 and READOOB command preparation has a falltrough to SEQIN
case, where the command address is specified.
This is certainly confusing and makes the code less readable with
no added value. Let's remove it.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Add helper function to set page address
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:31 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Add helper function to set page address

Let's simplify the code by first introducing a helper function
to set the page address, as done by the READ0, READOOB and SEQIN
commands.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Clear cmd buffer #3 (NDCB3) on command start
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:30 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Clear cmd buffer #3 (NDCB3) on command start

Command buffer #3 is not properly cleared and it keeps the last
set value. Fix this by clearing when a command is setup.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Add driver-specific ECC BCH support
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:29 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Add driver-specific ECC BCH support

This commit adds the BCH ECC support available in NFCv2 controller.
Depending on the detected required strength the respective ECC layout
is selected.

This commit adds an empty ECC layout, since support to access large
pages is first required. Once that support is added, a proper ECC
layout will be added as well.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Add bad block handling
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:28 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Add bad block handling

Add support for flash-based bad block table using Marvell's
custom in-flash bad block table layout. The support is enabled
a 'flash_bbt' platform data or device tree parameter.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Use waitfunc() to wait for the device to be ready
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:27 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Use waitfunc() to wait for the device to be ready

In pxa3xx_nand_sensing() instead of simply using info->is_ready
after issuing a command, the correct way of checking is to wait
for the device to be ready through the chip's waitfunc().

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Use a completion to signal device ready
Ezequiel Garcia [Thu, 14 Nov 2013 21:25:26 +0000 (18:25 -0300)]
mtd: nand: pxa3xx: Use a completion to signal device ready

The expected behavior of the waitfunc() NAND chip call is to wait
for the device to be READY (this is a standard chip line).
However, the current implementation does almost nothing, which opens
the possibility of issuing a command to a non-ready device.

Fix this by adding a new completion to wait for the ready event to arrive.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Add a nice comment to pxa3xx_set_datasize()
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:18 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Add a nice comment to pxa3xx_set_datasize()

Add a comment clarifying the use of pxa3xx_set_datasize() which is only
applicable on data read/write commands (i.e. commands with a data cycle,
such as READID, READ0, STATUS, etc.)

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Replace host->page_size by mtd->writesize
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:17 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Replace host->page_size by mtd->writesize

There's no need to privately store the device page size as it's
available in mtd structure field mtd->writesize.
Also, this removes the hardcoded page size value, leaving the
auto-detected value only.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Split FIFO size from to-be-read FIFO count
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:16 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Split FIFO size from to-be-read FIFO count

Introduce a fifo_size field to represent the size of the controller's
FIFO buffer, and use it to distinguish that size from the amount
of data bytes to be read from the FIFO.

This is important to support devices with pages larger than the
controller's internal FIFO, that need to read the pages in FIFO-sized
chunks.

In particular, the current code is at least confusing, for it mixes
all the different sizes involved: FIFO size, page size and data size.

This commit starts the cleaning by removing the info->page_size field
that is not currently used. The host->page_size field should also
be removed and use always mtd->writesize instead. Follow up commits
will clean this up.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Use chip->cmdfunc instead of the internal
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:15 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Use chip->cmdfunc instead of the internal

Whenever possible, it's always better to use the generic chip->cmdfunc
instead of the internal pxa3xx_nand_cmdfunc().
In this particular case, this will allow to have multiple cmdfunc()
implementations for different SoC variants.

Reviewed-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Early variant detection
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:14 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Early variant detection

In order to customize early settings depending on the detected SoC variant,
move the detection to be before the nand_chip struct filling.

In a follow-up patch, this change is needed to detect the variant *before*
the call to alloc_nand_resource(), which allows to set a different cmdfunc()
for each variant.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: read_page() returns max_bitflips
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:13 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: read_page() returns max_bitflips

As per the ecc.read_page() prototype, we must return the maximum number
of bitflips that were corrected on any one region covering an ecc step.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Prevent sub-page writes
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:12 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Prevent sub-page writes

The current driver doesn't support sub-page writing, so report
that to the NAND core.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Make config menu show supported platforms
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:11 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Make config menu show supported platforms

Since we have now support for the NFCv2 controller found on
Armada 370/XP platforms.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: Add documentation about the controller
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:10 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: Add documentation about the controller

Given there's no public specification to this date, and in order
to capture some important details and singularities about the
controller let's document them once and for good.

Cc: linux-doc@vger.kernel.org
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: pxa3xx: devicetree binding update
Ezequiel Garcia [Thu, 7 Nov 2013 15:17:09 +0000 (12:17 -0300)]
mtd: nand: pxa3xx: devicetree binding update

Since the driver supports the new compatible string, the binding
documentation must be updated to reflect it.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: make mtd_partition.name const
Geert Uytterhoeven [Tue, 12 Nov 2013 19:11:26 +0000 (20:11 +0100)]
mtd: make mtd_partition.name const

This allows to drop a few casts.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: ms02-nv: remove superfluous name cast
Geert Uytterhoeven [Tue, 12 Nov 2013 19:07:23 +0000 (20:07 +0100)]
mtd: ms02-nv: remove superfluous name cast

mtd_info.name is "const char *"

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: pasemi_nand.c: remove superfluous name cast
Geert Uytterhoeven [Tue, 12 Nov 2013 19:07:16 +0000 (20:07 +0100)]
mtd: pasemi_nand.c: remove superfluous name cast

device_driver.name is "const char *"

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Olof Johansson <olof@lixom.net>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: remove superfluous name casts
Geert Uytterhoeven [Tue, 12 Nov 2013 19:07:15 +0000 (20:07 +0100)]
mtd: remove superfluous name casts

map_info.name is "const char *"

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi-lib: Make checkpatch happy
Fabio Estevam [Fri, 8 Nov 2013 01:28:43 +0000 (23:28 -0200)]
mtd: gpmi-lib: Make checkpatch happy

Fix the following checkpatch warnings:

WARNING: line over 80 characters
#268: FILE: mtd/nand/gpmi-nand/gpmi-lib.c:268:
+ * consecutive reboots. The latter case has not been seen on the MX23 yet,

WARNING: space prohibited before semicolon
#356: FILE: mtd/nand/gpmi-nand/gpmi-lib.c:356:
+ (target.tRHOH_in_ns >= 0) ;

WARNING: space prohibited before semicolon
#1006: FILE: mtd/nand/gpmi-nand/gpmi-lib.c:1006:
+ BF_GPMI_TIMING0_DATA_SETUP(hw.data_setup_in_cycles)       ;

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: Use devm_clk_get()
Fabio Estevam [Fri, 8 Nov 2013 00:32:38 +0000 (22:32 -0200)]
mtd: gpmi: Use devm_clk_get()

Using devm_clk_get() can make the code smaller and cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
Huang Shijie [Thu, 7 Nov 2013 10:07:38 +0000 (18:07 +0800)]
mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC

In default way, we use the ecc_strength/ecc_step size calculated by ourselves
and use all the OOB area.

This patch adds a new property : "fsl,use-minimum-ecc"

If we enable it, we will firstly try to use the datasheet's minimum required
ECC provided by the MTD layer (the ecc_strength_ds/ecc_step_ds fields
in the nand_chip{}). So we may have free space in the OOB area by using the
minimum ECC, and we may support JFFS2 with some SLC NANDs, such as Micron's
SLC NAND.

If we fail to use the minimum ECC, we will use the legacy method to calculate
the ecc_strength and ecc_step size.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: nand: omap2: Fix OMAP_BCH option dependency
Ezequiel Garcia [Fri, 25 Oct 2013 10:17:55 +0000 (07:17 -0300)]
mtd: nand: omap2: Fix OMAP_BCH option dependency

This option does not need to depend in MTD_NAND, for it's enclosed
under it. Also, it's wrong to make it depend in ARCH_OMAP3 only
since the controller is used in a wider range of SoCs.

Instead, just leave the dependency on the OMAP2 driver option.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agodrivers: mtd: m25p80: add quad read support
Sourav Poddar [Wed, 6 Nov 2013 14:35:35 +0000 (20:05 +0530)]
drivers: mtd: m25p80: add quad read support

Some flash also support quad read mode. Adding support for quad read
mode in m25p80 for Spansion and Macronix flash.

[Tweaked by Brian]

With this patch, quad-read support will override fast-read and
normal-read, if the SPI controller and flash chip both support it.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agodrivers: mtd: m25p80: convert "bool" read check into an enum
Sourav Poddar [Wed, 6 Nov 2013 14:35:34 +0000 (20:05 +0530)]
drivers: mtd: m25p80: convert "bool" read check into an enum

This is a cleanup prior to adding quad read support. This will facilitate
easy addition of more read commands check under an enum rather that defining a
separate bool for it.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoLinux 3.13-rc6
Linus Torvalds [Mon, 30 Dec 2013 00:01:33 +0000 (16:01 -0800)]
Linux 3.13-rc6

10 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sun, 29 Dec 2013 21:49:51 +0000 (13:49 -0800)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "Another smallish batch of fixes, it's been quiet due to the holidays.
  Nothing controversial here, a handful of things across the board"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  ARM: pxa: fix USB gadget driver compilation regression
  ARM: OMAP2+: Fix LCD panel backlight regression for LDP legacy booting
  ARM: OMAP2+: hwmod_data: fix missing OMAP_INTC_START in irq data
  ARM: DRA7: hwmod: Fix boot crash with DEBUG_LL
  ARM: shmobile: r8a7790: fix shdi resource sizes
  ARM: shmobile: bockw: fixup DMA mask
  ARM: shmobile: armadillo: Add PWM backlight power supply

10 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 29 Dec 2013 21:35:04 +0000 (13:35 -0800)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Peter Anvin:
 "There is a small EFI fix and a big power regression fix in this batch.

  My queue also had a fix for downing a CPU when there are insufficient
  number of IRQ vectors available, but I'm holding that one for now due
  to recent bug reports"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/efi: Don't select EFI from certain special ACPI drivers
  x86 idle: Repair large-server 50-watt idle-power regression

10 years agoMerge tag 'pm+acpi-3.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Sun, 29 Dec 2013 21:27:51 +0000 (13:27 -0800)]
Merge tag 'pm+acpi-3.13-rc6' of git://git./linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes and new device IDs from Rafael Wysocki:

 - Fix for a cpufreq regression causing stale sysfs files to be left
   behind during system resume if cpufreq_add_dev() fails for one or
   more CPUs from Viresh Kumar.

 - Fix for a bug in cpufreq causing CONFIG_CPU_FREQ_DEFAULT_* to be
   ignored when the intel_pstate driver is used from Jason Baron.

 - System suspend fix for a memory leak in pm_vt_switch_unregister()
   that forgot to release objects after removing them from
   pm_vt_switch_list.  From Masami Ichikawa.

 - Intel Valley View device ID and energy unit encoding update for the
   (recently added) Intel RAPL (Running Average Power Limit) driver from
   Jacob Pan.

 - Intel Bay Trail SoC GPIO and ACPI device IDs for the Low Power
   Subsystem (LPSS) ACPI driver from Paul Drews.

* tag 'pm+acpi-3.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  powercap / RAPL: add support for ValleyView Soc
  PM / sleep: Fix memory leak in pm_vt_switch_unregister().
  cpufreq: Use CONFIG_CPU_FREQ_DEFAULT_* to set initial policy for setpolicy drivers
  cpufreq: remove sysfs files for CPUs which failed to come back after resume
  ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs

10 years agoMerge tag 'omap-for-v3.13/intc-ldp-fix' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Sat, 28 Dec 2013 23:38:32 +0000 (15:38 -0800)]
Merge tag 'omap-for-v3.13/intc-ldp-fix' of git://git./linux/kernel/git/tmlind/linux-omap into fixes

From Tony Lindgren:
Fix a regression for wrong interrupt numbers for some devices after
the sparse IRQ conversion, fix DRA7 console output for earlyprintk,
and fix the LDP LCD backlight when DSS is built into the kernel and
not as a loadable module.

* tag 'omap-for-v3.13/intc-ldp-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Fix LCD panel backlight regression for LDP legacy booting
  ARM: OMAP2+: hwmod_data: fix missing OMAP_INTC_START in irq data
  ARM: DRA7: hwmod: Fix boot crash with DEBUG_LL
  + v3.13-rc5

Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'renesas-fixes2-for-v3.13' of git://git.kernel.org/pub/scm/linux/kernel...
Olof Johansson [Sat, 28 Dec 2013 23:20:35 +0000 (15:20 -0800)]
Merge tag 'renesas-fixes2-for-v3.13' of git://git./linux/kernel/git/horms/renesas into fixes

From Simon Horman:
Second Round of Renesas ARM based SoC Fixes for v3.13

* r8a7790 (R-Car H2) based Lager board
  - Correct SHDI resource sizes
    This bug has been present since sdhi resources were added to the r8a7790 by
    8c9b1aa41853272a ("ARM: shmobile: r8a7790: add MMCIF and SDHI DT
    templates") in v3.11-rc2.

* r8a7778 (R-Car M1) based Bock-W board
  - Correct DMA mask
    This resolves a regression introduced by 4dcfa60071b3d23f
    ("ARM: DMA-API: better handing of DMA masks for coherent allocations")
    in v3.12-rc1.

* r8a7740 (R-Mobile A1) based Armadillo board
  - Add PWM backlight power supply
    This resolves a regression introduced by 22ceeee16eb8f0d0
    ("pwm-backlight: Add power supply support") in v3.12.

* tag 'renesas-fixes2-for-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: r8a7790: fix shdi resource sizes
  ARM: shmobile: bockw: fixup DMA mask
  ARM: shmobile: armadillo: Add PWM backlight power supply

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoARM: pxa: fix USB gadget driver compilation regression
Linus Walleij [Wed, 11 Dec 2013 08:48:58 +0000 (09:48 +0100)]
ARM: pxa: fix USB gadget driver compilation regression

After commit 88f718e3fa4d67f3a8dbe79a2f97d722323e4051
"ARM: pxa: delete the custom GPIO header" a compilation
error was introduced in the PXA25x gadget driver.
An attempt to fix the problem was made in
commit b144e4ab1ef130e8bf30bcd3e529b7f35112c503
"usb: gadget: fix pxa25x compilation problems"
by explictly stating the driver needs the <mach/hardware.h>
header, which solved the compilation for a few boards,
such as the pxa255-idp and its defconfig.

However the Lubbock board has this special clause in
drivers/usb/gadget/pxa25x_udc.c:

This include file has an implicit dependency on
<mach/irqs.h> having been included before <mach/lubbock.h>
was included.

Before commit 88f718e3fa4d67f3a8dbe79a2f97d722323e4051
"ARM: pxa: delete the custom GPIO header" this implicit
dependency for the pxa25x_udc compile on the Lubbock was
satisfied by <linux/gpio.h> implicitly including
<mach/gpio.h> which was in turn including <mach/irqs.h>,
apart from the earlier added <mach/hardware.h>.

Fix this by having the PXA25x <mach/lubbock.h> explicitly
include <mach/irqs.h>.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Greg Kroah-Hartmann <gregkh@linuxfoundation.org>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoMerge tag 'for-v3.13-rc/hwmod-fixes-b' of git://git.kernel.org/pub/scm/linux/kernel...
Tony Lindgren [Fri, 27 Dec 2013 17:51:25 +0000 (09:51 -0800)]
Merge tag 'for-v3.13-rc/hwmod-fixes-b' of git://git./linux/kernel/git/pjw/omap-pending into debug-ll-and-ldp-backlight-fix

A few OMAP hwmod fixes for v3.13-rc.  One patch fixes some IRQ
problems with GPMC, RNG, and ISP/IVA MMUs on OMAP2/3.  The other fixes
some problems with DEBUG_LL on DRA7xx.

Basic build, boot, and PM test logs are available here:

http://www.pwsan.com/omap/testlogs/hwmod_fixes_b_v3.13-rc/20131226021920/

10 years agoARM: OMAP2+: Fix LCD panel backlight regression for LDP legacy booting
Tony Lindgren [Fri, 27 Dec 2013 17:33:27 +0000 (09:33 -0800)]
ARM: OMAP2+: Fix LCD panel backlight regression for LDP legacy booting

Looks like the LCD panel on LDP has been broken quite a while, and
recently got fixed by commit 0b2aa8bed3e1 (gpio: twl4030: Fix regression
for twl gpio output). However, there's still an issue left where the panel
backlight does not come on if the LCD drivers are built into the
kernel.

Fix the issue by registering the DPI LCD panel only after the twl4030
GPIO has probed.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
[tony@atomide.com: updated per Tomi's comments]
Signed-off-by: Tony Lindgren <tony@atomide.com>
10 years agoMerge branches 'powercap' and 'acpi-lpss' with new device IDs
Rafael J. Wysocki [Thu, 26 Dec 2013 23:43:24 +0000 (00:43 +0100)]
Merge branches 'powercap' and 'acpi-lpss' with new device IDs

* powercap:
  powercap / RAPL: add support for ValleyView Soc

* acpi-lpss:
  ACPI: Add BayTrail SoC GPIO and LPSS ACPI IDs

10 years agoMerge branches 'pm-cpufreq' and 'pm-sleep' containing PM fixes
Rafael J. Wysocki [Thu, 26 Dec 2013 23:42:27 +0000 (00:42 +0100)]
Merge branches 'pm-cpufreq' and 'pm-sleep' containing PM fixes

* pm-cpufreq:
  cpufreq: Use CONFIG_CPU_FREQ_DEFAULT_* to set initial policy for setpolicy drivers
  cpufreq: remove sysfs files for CPUs which failed to come back after resume

* pm-sleep:
  PM / sleep: Fix memory leak in pm_vt_switch_unregister().

10 years agoMerge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
Linus Torvalds [Thu, 26 Dec 2013 17:26:12 +0000 (09:26 -0800)]
Merge tag 'ext4_for_linus' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "A collection of bug fixes destined for stable and some printk cleanups
  and a patch so that instead of BUG'ing we use the ext4_error()
  framework to mark the file system is corrupted"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: add explicit casts when masking cluster sizes
  ext4: fix deadlock when writing in ENOSPC conditions
  jbd2: rename obsoleted msg JBD->JBD2
  jbd2: revise KERN_EMERG error messages
  jbd2: don't BUG but return ENOSPC if a handle runs out of space
  ext4: Do not reserve clusters when fs doesn't support extents
  ext4: fix del_timer() misuse for ->s_err_report
  ext4: check for overlapping extents in ext4_valid_extent_entries()
  ext4: fix use-after-free in ext4_mb_new_blocks
  ext4: call ext4_error_inode() if jbd2_journal_dirty_metadata() fails

10 years agoARM: OMAP2+: hwmod_data: fix missing OMAP_INTC_START in irq data
Suman Anna [Mon, 23 Dec 2013 22:53:11 +0000 (16:53 -0600)]
ARM: OMAP2+: hwmod_data: fix missing OMAP_INTC_START in irq data

Commit 7d7e1eb (ARM: OMAP2+: Prepare for irqs.h removal) and commit
ec2c082 (ARM: OMAP2+: Remove hardcoded IRQs and enable SPARSE_IRQ)
updated the way interrupts for OMAP2/3 devices are defined in the
HWMOD data structures to being an index plus a fixed offset (defined
by OMAP_INTC_START).

Couple of irqs in the OMAP2/3 hwmod data were misconfigured completely
as they were missing this OMAP_INTC_START relative offset. Add this
offset back to fix the incorrect irq data for the following modules:
OMAP2 - GPMC, RNG
OMAP3 - GPMC, ISP MMU & IVA MMU

Signed-off-by: Suman Anna <s-anna@ti.com>
Fixes: 7d7e1eba7e92 ("ARM: OMAP2+: Prepare for irqs.h removal")
Fixes: ec2c0825ca31 ("ARM: OMAP2+: Remove hardcoded IRQs and enable SPARSE_IRQ")
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
10 years agoARM: DRA7: hwmod: Fix boot crash with DEBUG_LL
Rajendra Nayak [Thu, 12 Dec 2013 09:52:49 +0000 (15:22 +0530)]
ARM: DRA7: hwmod: Fix boot crash with DEBUG_LL

With commit '7dedd34: ARM: OMAP2+: hwmod: Fix a crash in _setup_reset() with
 DEBUG_LL' we moved from parsing cmdline to identify uart used for earlycon
to using the requsite hwmod CONFIG_DEBUG_OMAPxUARTy FLAGS.

On DRA7 though, we seem to be missing this flag, and atleast on the DRA7 EVM
where we use uart1 for console, boot fails with DEBUG_LL enabled.

Reported-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Lokesh Vutla <lokeshvutla@ti.com> # on a different base
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Fixes: 7dedd346941d ("ARM: OMAP2+: hwmod: Fix a crash in _setup_reset() with DEBUG_LL")
Signed-off-by: Paul Walmsley <paul@pwsan.com>
10 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Tue, 24 Dec 2013 18:06:03 +0000 (10:06 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 - fix for a memory leak on certain unplug events
 - a collection of bcache fixes from Kent and Nicolas
 - a few null_blk fixes and updates form Matias
 - a marking of static of functions in the stec pci-e driver

* 'for-linus' of git://git.kernel.dk/linux-block:
  null_blk: support submit_queues on use_per_node_hctx
  null_blk: set use_per_node_hctx param to false
  null_blk: corrections to documentation
  null_blk: warning on ignored submit_queues param
  null_blk: refactor init and init errors code paths
  null_blk: documentation
  null_blk: mem garbage on NUMA systems during init
  drivers: block: Mark the functions as static in skd_main.c
  bcache: New writeback PD controller
  bcache: bugfix for race between moving_gc and bucket_invalidate
  bcache: fix for gc and writeback race
  bcache: bugfix - moving_gc now moves only correct buckets
  bcache: fix for gc crashing when no sectors are used
  bcache: Fix heap_peek() macro
  bcache: Fix for can_attach_cache()
  bcache: Fix dirty_data accounting
  bcache: Use uninterruptible sleep in writeback
  bcache: kthread don't set writeback task to INTERUPTIBLE
  block: fix memory leaks on unplugging block device
  bcache: fix sparse non static symbol warning

10 years agoMerge branch 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Tue, 24 Dec 2013 17:49:20 +0000 (09:49 -0800)]
Merge branch 'for-3.13-fixes' of git://git./linux/kernel/git/tj/cgroup

Pull cgroup fixes from Tejun Heo:
 "Two fixes.  One fixes a bug in the error path of cgroup_create().  The
  other changes cgrp->id lifetime rule so that the id doesn't get
  recycled before all controller states are destroyed.  This premature
  id recycling made memcg malfunction"

* 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup: don't recycle cgroup id until all csses' have been destroyed
  cgroup: fix cgroup_create() error handling path

10 years agoMerge branch 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Tue, 24 Dec 2013 17:48:43 +0000 (09:48 -0800)]
Merge branch 'for-3.13-fixes' of git://git./linux/kernel/git/tj/percpu

Pull percpu fix from Tejun Heo:
 "A single commit to fix a spurious sparse warning coming from
  DEFINE_PER_CPU()'s hack to support the use of weak symbols.  Shouldn't
  cause observable behavior change"

* 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  percpu: fix spurious sparse warnings from DEFINE_PER_CPU()

10 years agoMerge branch 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Tue, 24 Dec 2013 17:35:58 +0000 (09:35 -0800)]
Merge branch 'for-3.13-fixes' of git://git./linux/kernel/git/tj/libata

Pull libata fixes from Tejun Heo:
 "There's one interseting commit - "libata, freezer: avoid block device
  removal while system is frozen".  It's an ugly hack working around a
  deadlock condition between driver core resume and block layer device
  removal paths through freezer which was made more reproducible by
  writeback being converted to workqueue some releases ago.  The bug has
  nothing to do with libata but it's just an workaround which is easy to
  backport.  After discussion, Rafael and I seem to agree that we don't
  really need kernel freezables - both kthread and workqueue.  There are
  few specific workqueues which constitute PM operations and require
  freezing, which will be converted to use workqueue_set_max_active()
  instead.  All other kernel freezer uses are planned to be removed,
  followed by the removal of kthread and workqueue freezer support,
  hopefully.

  Others are device-specific fixes.  The most notable is the addition of
  NO_NCQ_TRIM which is used to disable queued TRIM commands to Micro
  M500 SSDs which otherwise suffers data corruption"

* 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
  libata, freezer: avoid block device removal while system is frozen
  libata: implement ATA_HORKAGE_NO_NCQ_TRIM and apply it to Micro M500 SSDs
  libata: disable a disk via libata.force params
  ahci: bail out on ICH6 before using AHCI BAR
  ahci: imx: Explicitly clear IMX6Q_GPR13_SATA_MPLL_CLK_EN
  libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8

10 years agoauxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE
Ard Biesheuvel [Mon, 23 Dec 2013 17:49:30 +0000 (18:49 +0100)]
auxvec.h: account for AT_HWCAP2 in AT_VECTOR_SIZE_BASE

Commit 2171364d1a92 ("powerpc: Add HWCAP2 aux entry") introduced a new
AT_ auxv entry type AT_HWCAP2 but failed to update AT_VECTOR_SIZE_BASE
accordingly.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: 2171364d1a92 (powerpc: Add HWCAP2 aux entry)
Cc: stable@vger.kernel.org
Acked-by: Michael Neuling <michael@neuling.org>
Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Tue, 24 Dec 2013 01:37:20 +0000 (17:37 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/linux-security

Pull SELinux fixes from James Morris.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()
  selinux: fix broken peer recv check

10 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Linus Torvalds [Tue, 24 Dec 2013 01:24:38 +0000 (17:24 -0800)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-fs

Pull ext2 fix from Jan Kara:
 "One simple fix of oops in ext2 which was recently hit by Christoph"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  ext2: Fix oops in ext2_get_block() called from ext2_quota_write()

10 years agoMerge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
Linus Torvalds [Tue, 24 Dec 2013 01:23:42 +0000 (17:23 -0800)]
Merge tag 'rdma-for-linus' of git://git./linux/kernel/git/roland/infiniband

Pull infiniband fixes from Roland Dreier:
 "Last batch of InfiniBand/RDMA changes for 3.13 / 2014:
   - Additional checks for uverbs to ensure forward compatibility,
     handle malformed input better.
   - Fix potential use-after-free in iWARP connection manager.
   - Make a function static"

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/uverbs: Check access to userspace response buffer in extended command
  IB/uverbs: Check input length in flow steering uverbs
  IB/uverbs: Set error code when fail to consume all flow_spec items
  IB/uverbs: Check reserved fields in create_flow
  IB/uverbs: Check comp_mask in destroy_flow
  IB/uverbs: Check reserved field in extended command header
  IB/uverbs: New macro to set pointers to NULL if length is 0 in INIT_UDATA()
  IB/core: const'ify inbuf in struct ib_udata
  RDMA/iwcm: Don't touch cm_id after deref in rem_ref
  RDMA/cxgb4: Make _c4iw_write_mem_dma() static

10 years agoselinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()
Oleg Nesterov [Mon, 23 Dec 2013 22:45:01 +0000 (17:45 -0500)]
selinux: selinux_setprocattr()->ptrace_parent() needs rcu_read_lock()

selinux_setprocattr() does ptrace_parent(p) under task_lock(p),
but task_struct->alloc_lock doesn't pin ->parent or ->ptrace,
this looks confusing and triggers the "suspicious RCU usage"
warning because ptrace_parent() does rcu_dereference_check().

And in theory this is wrong, spin_lock()->preempt_disable()
doesn't necessarily imply rcu_read_lock() we need to access
the ->parent.

Reported-by: Evan McNabb <emcnabb@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paul Moore <pmoore@redhat.com>
10 years agoselinux: fix broken peer recv check
Chad Hanson [Mon, 23 Dec 2013 22:45:01 +0000 (17:45 -0500)]
selinux: fix broken peer recv check

Fix a broken networking check. Return an error if peer recv fails.  If
secmark is active and the packet recv succeeds the peer recv error is
ignored.

Signed-off-by: Chad Hanson <chanson@trustedcs.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paul Moore <pmoore@redhat.com>