]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoENGR00288046: net:fec_ptp: fix WARNING caused by mutex_trylock run in interrupt context
Fugang Duan [Thu, 14 Nov 2013 09:21:14 +0000 (17:21 +0800)]
ENGR00288046: net:fec_ptp: fix WARNING caused by mutex_trylock run in interrupt context

Kernel warning dump by enable kernel config "CONFIG_DEBUG_MUTEXES":

------------[ cut here ]------------
WARNING: at kernel/mutex.c:577 mutex_trylock+0x180/0x1d0()
DEBUG_LOCKS_WARN_ON(in_interrupt())
Modules linked in:
CPU: 0 PID: 68 Comm: kworker/0:2 Tainted: G W 3.10.17-16855-ga44de14 #1325
Workqueue: events phy_state_machine
[<80014cbc>] (unwind_backtrace+0x0/0x138) from [<8001251c>]
(show_stack+0x10/0x14)
[<8001251c>] (show_stack+0x10/0x14) from [<80026754>]
(warn_slowpath_common+0x4c/0x68)
[<80026754>] (warn_slowpath_common+0x4c/0x68) from [<80026804>]
(warn_slowpath_fmt+0x30/0x40)
[<80026804>] (warn_slowpath_fmt+0x30/0x40) from [<8069f6b0>]
(mutex_trylock+0x180/0x1d0)
[<8069f6b0>] (mutex_trylock+0x180/0x1d0) from [<804dce7c>]
(clk_prepare_lock+0xc/0xd8)
[<804dce7c>] (clk_prepare_lock+0xc/0xd8) from [<804ddbcc>]
(clk_get_rate+0xc/0x5c)
[<804ddbcc>] (clk_get_rate+0xc/0x5c) from [<803b7528>]
(fec_ptp_start_cyclecounter+0x1c/0x198)
[<803b7528>] (fec_ptp_start_cyclecounter+0x1c/0x198) from [<803b5928>]
(fec_restart+0x6e8/0x870)
[<803b5928>] (fec_restart+0x6e8/0x870) from [<803b5d50>]
(fec_enet_adjust_link+0x7c/0xb4)
[<803b5d50>] (fec_enet_adjust_link+0x7c/0xb4) from [<803b07b8>]
(phy_state_machine+0xfc/0x394)
[<803b07b8>] (phy_state_machine+0xfc/0x394) from [<8003f03c>]
(process_one_work+0x198/0x428)
[<8003f03c>] (process_one_work+0x198/0x428) from [<8003fd24>]
(worker_thread+0x144/0x3a4)
[<8003fd24>] (worker_thread+0x144/0x3a4) from [<800458d8>]
(kthread+0xa4/0xb0)
[<800458d8>] (kthread+0xa4/0xb0) from [<8000ebd8>] (ret_from_fork+0x14/0x3c)
---[ end trace d1930b3e1c195329 ]---

Root cause:
Worker thread call netif_tx_lock_bh() to diable the softirq preempt, and
then call clk_get_rate() to get ptp clock rate.
In fact, netif_tx_lock_bh()->local_bh_disable(), which make in_interrupt()
to be ture. clk_get_rate()->clk_prepare_lock()->mutex_trylock(), and
mutex_trylock() cannot use at interrupt context, otherwise there have
kernel dump.

So, remove the clk_get_rate() in there.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00287983-2 imx restart: add another WDOG2 reset support for ldo-bypass
Robin Gong [Thu, 14 Nov 2013 05:58:21 +0000 (13:58 +0800)]
ENGR00287983-2 imx restart: add another WDOG2 reset support for ldo-bypass

For ldo-bypass mode on i.MX6Q/DL sabresd board, we will use another WDOG2 to
reset external pmic to trigger POR event, rather than WDOG1 to trigger WDOG
event in ldo-enable mode. We need to consider it in common mxc_restart().
On i.MX6SL sabresd board we use WDOG1 to trigger WDOG event both ldo-bypass and
ldo-enable mode.

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agoENGR00287983-1 imx6sl: replace mx6sl_restart with mxc_restart
Robin Gong [Thu, 14 Nov 2013 05:46:00 +0000 (13:46 +0800)]
ENGR00287983-1 imx6sl: replace mx6sl_restart with mxc_restart

Using common mxc_restart interface to do restart instead of platform specific
interface of imx6sl_restart.

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agoARM: imx: remove imx_src_prepare_restart() call
Shawn Guo [Mon, 28 Oct 2013 08:37:12 +0000 (16:37 +0800)]
ARM: imx: remove imx_src_prepare_restart() call

There is ~10% possibility that the following emergency restart command
fails to reboot imx6q.

$ echo b > /proc/sysrq-trigger

The IMX restart routine mxc_restart() assumes that it will always run on
primary core, and will call imx_src_prepare_restart() to disable
secondary cores in order to get them come to online in the following
boot.  However, the assumption is only true for normal kernel_restart()
case where migrate_to_reboot_cpu() will be called to migrate to primary
core, but not necessarily true for emergency_restart() case.  So when
emergency_restart() calls into mxc_restart() on any secondary core,
system will hang immediately once imx_src_prepare_restart() is called
to disabled secondary cores.  Since emergency_restart() is defined as a
function that is safe to call in interrupt context, we cannot just call
migrate_to_reboot_cpu() to fix the issue.

Fortunately, we just found that the issue can be fixed at imx6q platform
level.  We used to call imx_src_prepare_restart() to disable all
secondary cores before resetting hardware.  Otherwise, the secondary
will fail come to online in the reboot.  However, we recently found that
after commit 6050d18 (ARM: imx: reset core along with enable/disable
operation) comes to play, we do not need to reset the secondary cores
any more.  That said, mxc_restart() now can run on any core to reboot
the system, as long as we remove the imx_src_prepare_restart() call from
mxc_restart().

So let's simply remove imx_src_prepare_restart() call to fix the above
emergency restart failure.

Reported-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
(cherry picked from commit e2eb7f22c90ab47cce77c6836183fa5e684489d1)

Conflicts:

arch/arm/mach-imx/common.h

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agoARM: imx: replace imx6q_restart() with mxc_restart()
Shawn Guo [Sun, 6 Oct 2013 08:47:46 +0000 (16:47 +0800)]
ARM: imx: replace imx6q_restart() with mxc_restart()

The imx6q_restart() works fine with normal reboot but will run into
problem with emergency reboot like sysrq-b.  In that case, of_iomap()
gets called from interrupt context and hence triggers the BUG_ON in
__get_vm_area_node().

Actually, since commit c1e31d1 (ARM: imx: create
mxc_arch_reset_init_dt() for DT boot), imx6q/dl should try to use
mxc_restart() by calling mxc_arch_reset_init_dt() beforehand, where
things like of_iomap() can be done.

The patch updates mxc_restart() a little bit to get it work for imx6q/dl
and kill imx6q_restart() completely.

Reported-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
(cherry picked from commit 87a84b69824d7fd63b20f3bc98d75c0238b8e7d0)

Conflicts:

arch/arm/mach-imx/mach-imx6q.c

Signed-off-by: Robin Gong <b38343@freescale.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: 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>
Signed-off-by: Huang Shijie <b32955@freescale.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>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00287826 mxc: mlb: Fix MLB rcu stall issue when MITB is not set correctly
Luwei Zhou [Wed, 13 Nov 2013 08:21:02 +0000 (16:21 +0800)]
ENGR00287826 mxc: mlb: Fix MLB rcu stall issue when MITB is not set correctly

MLB lock and clock check has logic issue in code. The timeout cann't work and
it will cause rcu-stall.

Exception stack(0xdca21e68 to 0xdca21eb0)
1e60:                   00000001 00000000 ffffff7f 0000270f 00002710 0000ffc0
1e80: 00000000 00000004 00000002 00000001 00000001 7f003b50 f0378000 dca21eb0
1ea0: 7f003b50 7f0009cc 20000013 ffffffff
[<8000dc04>] (__irq_svc+0x44/0x58) from [<7f0009cc>] (mlb150_dev_unmute_syn_ch
[<7f0009cc>] (mlb150_dev_unmute_syn_ch+0x34/0xd4 [mxc_mlb150]) from [<7f002584
[<7f002584>] (mxc_mlb150_ioctl+0x85c/0x898 [mxc_mlb150]) from [<800db86c>] (do_
[<800db86c>] (do_vfs_ioctl+0x40c/0x5e4) from [<800dba7c>] (SyS_ioctl+0x38/0x64)
[<800dba7c>] (SyS_ioctl+0x38/0x64) from [<8000e000>] (ret_fast_syscall+0x0/0x48
INFO: rcu_sched self-detected stall on CPU
        0: (14684 ticks this GP) idle=fdf/140000000000001/0 softirq=1555/1555
         (t=14720 jiffies g=2 c=1 q=22)
CPU: 0 PID: 628 Comm: mxc_mlb150_test Not tainted 3.10.17-16837-g187ed79-dirty
[<80013d7c>] (unwind_backtrace+0x0/0xf4) from [<80011798>] (show_stack+0x10/0x
[<80011798>] (show_stack+0x10/0x14) from [<8008575c>] (rcu_check_callbacks+0x3
[<8008575c>] (rcu_check_callbacks+0x3d0/0x7f8) from [<80033884>] (update_proce
[<80033884>] (update_process_times+0x40/0x6c) from [<80064f48>] (tick_sched_ti
[<80064f48>] (tick_sched_timer+0x4c/0x78) from [<80048508>] (__run_hrtimer.isr
[<80048508>] (__run_hrtimer.isra.32+0x44/0xd4) from [<80048de4>] (hrtimer_inte
[<80048de4>] (hrtimer_interrupt+0x108/0x294) from [<800136f0>] (twd_handler+0x
[<800136f0>] (twd_handler+0x34/0x44) from [<80080208>] (handle_percpu_devid_ir
[<80080208>] (handle_percpu_devid_irq+0x6c/0x84) from [<8007c958>] (generic_ha
[<8007c958>] (generic_handle_irq+0x2c/0x3c) from [<8000e908>] (handle_IRQ+0x40
[<8000e908>] (handle_IRQ+0x40/0x90) from [<8000856c>] (gic_handle_irq+0x2c/0x5
[<8000856c>] (gic_handle_irq+0x2c/0x5c) from [<8000dc04>] (__irq_svc+0x44/0x5.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00287579 mxsfb: i.MX6SL clean master bit before enter suspend
Sandor Yu [Wed, 13 Nov 2013 02:13:14 +0000 (10:13 +0800)]
ENGR00287579 mxsfb: i.MX6SL clean master bit before enter suspend

Clean lcdif bus master bit when lcdif enter low power mode.
Restore the master bit when lcdif back to work mode.

Signed-off-by: Sandor Yu <R01008@freescale.com>
10 years agoENGR00286961-5 ASoC: fsl: set tdm slot number for imx-si476x
Nicolin Chen [Mon, 11 Nov 2013 08:31:22 +0000 (16:31 +0800)]
ENGR00286961-5 ASoC: fsl: set tdm slot number for imx-si476x

When using SSI I2S master mode, we need to decide the time slot number.
Because we use SSI normal mode to trick I2S signal, we here need to set
time slot number to two (left/right).

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00286961-4 ASoC: fsl_ssi: add monaural audio support
Nicolin Chen [Fri, 8 Nov 2013 08:38:43 +0000 (16:38 +0800)]
ENGR00286961-4 ASoC: fsl_ssi: add monaural audio support

We use SSI's normal mode to trick I2S signal by fetching data only from
one side of time slot so that we can purely get or put the monaural audio
data.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00286961-3 ARM: dtsi: imx6qdl: Use non-default value for audmux pinctrl
Nicolin Chen [Fri, 8 Nov 2013 08:26:25 +0000 (16:26 +0800)]
ENGR00286961-3 ARM: dtsi: imx6qdl: Use non-default value for audmux pinctrl

It's better to specify pinctrl value so that we can clearly know what the
exact configuration they are. Also, when we need to set pinctrl state from
another state to default one, it must be given the exact values of pinctrl.

And this patch also sets TXD iomux to PUE keep. This would force TXD pin not
to pull down its signal during an unused state so that it won't distort its
output signal during that state.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00286961-2 ASoC: fsl_ssi: Move DC configuration to set_dai_tdm_slot()
Nicolin Chen [Fri, 8 Nov 2013 07:48:42 +0000 (15:48 +0800)]
ENGR00286961-2 ASoC: fsl_ssi: Move DC configuration to set_dai_tdm_slot()

DC indicates Frame Rate Divider. By setting it we can get a desired
time slot numbers. Thus it should be more plausible to set DC in
set_dai_tdm_slot() instead of hw_params().

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00286961-1 ASoC: fsl_ssi: add period size constraint for dual fifo mode
Nicolin Chen [Fri, 8 Nov 2013 07:38:18 +0000 (15:38 +0800)]
ENGR00286961-1 ASoC: fsl_ssi: add period size constraint for dual fifo mode

When using dual fifo mode, we need to keep period size as an even number
due to behavior of SDMA script. Otherwise, it might neglect the 2nd fifo
at each period when its size appears to be an odd number.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agomtd: gpmi: fix the NULL pointer
Huang Shijie [Tue, 12 Nov 2013 04:23:08 +0000 (12:23 +0800)]
mtd: gpmi: fix the NULL pointer

The imx23 board will check the fingerprint, so it will call the
mx23_check_transcription_stamp. This function will use @chip->buffers->databuf
as its buffer which is allocated in the nand_scan_tail().

Unfortunately, the mx23_check_transcription_stamp is called before the
nand_scan_tail(). So we will meet a NULL pointer bug:

--------------------------------------------------------------------
[    1.150000] NAND device: Manufacturer ID: 0xec, Chip ID: 0xd7 (Samsung NAND 4GiB 3,3V 8-bit), 4096MiB, page size: 4096, OOB size: 8
[    1.160000] Unable to handle kernel NULL pointer dereference at virtual address 000005d0
[    1.170000] pgd = c0004000
[    1.170000] [000005d0] *pgd=00000000
[    1.180000] Internal error: Oops: 5 [#1] ARM
[    1.180000] Modules linked in:
[    1.180000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.12.0 #89
[    1.180000] task: c7440000 ti: c743a000 task.ti: c743a000
[    1.180000] PC is at memcmp+0x10/0x54
[    1.180000] LR is at gpmi_nand_probe+0x42c/0x894
[    1.180000] pc : [<c025fcb0>]    lr : [<c02f6a68>]    psr: 20000053
[    1.180000] sp : c743be2c  ip : 600000d3  fp : ffffffff
[    1.180000] r10: 000005d0  r9 : c02f5f08  r8 : 00000000
[    1.180000] r7 : c75858a8  r6 : c75858a8  r5 : c7585b18  r4 : c7585800
[    1.180000] r3 : 000005d0  r2 : 00000004  r1 : c05c33e4  r0 : 000005d0
[    1.180000] Flags: nzCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
[    1.180000] Control: 0005317f  Table: 40004000  DAC: 00000017
[    1.180000] Process swapper (pid: 1, stack limit = 0xc743a1c0)
--------------------------------------------------------------------

This patch rearrange the init procedure:
   Set the NAND_SKIP_BBTSCAN to skip the nand scan firstly, and after we
   set the proper settings, we will call the chip->scan_bbt() manually.

Cc: stable@vger.kernel.org # 3.12
Signed-off-by: Huang Shijie <b32955@freescale.com>
Reported-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoRevert "serial: i.MX: evaluate linux,stdout-path property"
Greg Kroah-Hartman [Tue, 8 Oct 2013 02:06:59 +0000 (19:06 -0700)]
Revert "serial: i.MX: evaluate linux,stdout-path property"

This reverts commit f7d2c0bbdb7b784cc035cacb7d36b379ba1c3bef, as it
causes build errors when the driver is built as a module.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00287278 mxc: mlb: Enable the clock when open MLB device.
Luwei Zhou [Mon, 11 Nov 2013 08:56:57 +0000 (16:56 +0800)]
ENGR00287278 mxc: mlb: Enable the clock when open MLB device.

The driver enalbe/disable the clock in probe()/remove().
It should be done in open()/close() hook function in fact.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00287512 net:fec: fix WARNING caused by lack of calling dma_mapping_error()
Fugang Duan [Tue, 12 Nov 2013 02:00:43 +0000 (10:00 +0800)]
ENGR00287512 net:fec: fix WARNING caused by lack of calling dma_mapping_error()

Enable CONFIG_HAVE_DMA_API_DEBUG, the kernel dump warning:

------------[ cut here ]------------
WARNING: at lib/dma-debug.c:937 check_unmap+0x43c/0x7d8()
fec 2188000.ethernet: DMA-API: device driver failed to check map
error[device address=0x00000000383a8040] [size=2048 bytes] [mapped as single]

Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.17-16827-g9cdb0ba-dirty #188
[<80013c4c>] (unwind_backtrace+0x0/0xf8) from [<80011704>] (show_stack+0x10
[<80011704>] (show_stack+0x10/0x14) from [<80025614>] (warn_slowpath_common
[<80025614>] (warn_slowpath_common+0x4c/0x6c) from [<800256c8>] (warn_slowp
[<800256c8>] (warn_slowpath_fmt+0x30/0x40) from [<8026bfdc>] (check_unmap+0
[<8026bfdc>] (check_unmap+0x43c/0x7d8) from [<8026c584>] (debug_dma_unmap_p
[<8026c584>] (debug_dma_unmap_page+0x6c/0x78) from [<8038049c>] (fec_enet_r
[<8038049c>] (fec_enet_rx_napi+0x254/0x8a8) from [<804dc8c0>] (net_rx_actio
[<804dc8c0>] (net_rx_action+0x94/0x160) from [<8002c758>] (__do_softirq+0xe
[<8002c758>] (__do_softirq+0xe8/0x1d0) from [<8002c8e8>] (do_softirq+0x4c/0
[<8002c8e8>] (do_softirq+0x4c/0x58) from [<8002cb50>] (irq_exit+0x90/0xc8)
[<8002cb50>] (irq_exit+0x90/0xc8) from [<8000ea88>] (handle_IRQ+0x3c/0x94)
[<8000ea88>] (handle_IRQ+0x3c/0x94) from [<8000855c>] (gic_handle_irq+0x28/
[<8000855c>] (gic_handle_irq+0x28/0x5c) from [<8000de00>] (__irq_svc+0x40/0
Exception stack(0x815a5f38 to 0x815a5f80)
5f20:                                                       815a5f80 3b9aca
5f40: 0fe52383 00000002 0dd8950e 00000002 81e7b080 00000000 00000000 815ac4
5f60: 806032ec 00000000 00000017 815a5f80 80059028 8041fc4c 60000013 ffffff
[<8000de00>] (__irq_svc+0x40/0x50) from [<8041fc4c>] (cpuidle_enter_state+0
[<8041fc4c>] (cpuidle_enter_state+0x50/0xf0) from [<8041fd94>] (cpuidle_idl
[<8041fd94>] (cpuidle_idle_call+0xa8/0x14c) from [<8000edac>] (arch_cpu_idl
[<8000edac>] (arch_cpu_idle+0x10/0x4c) from [<800582f8>] (cpu_startup_entry
[<800582f8>] (cpu_startup_entry+0x60/0x130) from [<80bc7a48>] (start_kernel
[<80bc7a48>] (start_kernel+0x2d0/0x328) from [<10008074>] (0x10008074)
---[ end trace c6edec32436e0042 ]---

Because dma-debug add new interfaces to debug dma mapping errors, pls refer
to: http://lwn.net/Articles/516640/

After dma mapping, it must call dma_mapping_error() to check mapping error,
otherwise the map_err_type alway is MAP_ERR_NOT_CHECKED, check_unmap() define
the mapping is not checked and dump the error msg.

So, and dma_mapping_error() checking to fix the WARNING.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00287256 mxc: mlb: Fix the SYNC mode hang issue when connected with MITB
Luwei Zhou [Mon, 11 Nov 2013 08:03:59 +0000 (16:03 +0800)]
ENGR00287256 mxc: mlb: Fix the SYNC mode hang issue when connected with MITB

This patch fixes the hang and crash issue of MLB SYNC mode in the driver.
The MITB will casue Sabreauto to hang and crash when testing the SYNC mode.
It is because MITB will cause something error on MLB bus when stopping the
SYNC test. The Sabreauto will keep entering error ISR and hang. Since we
don't know the details about MITB, we make drivers provide IO_CTRL
interface to disable the interrupt in SYNC mode.

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agomtd: gpmi: only scan two chips for imx6
Huang Shijie [Thu, 7 Nov 2013 09:46:37 +0000 (17:46 +0800)]
mtd: gpmi: only scan two chips for imx6

We cannot scan two chips for imx23 and imx28:
  imx23: the Ready-Busy1 line is not connected for some board.
  imx28: we do not set the pinctrl for Ready-Busy1

So we only scan two chips for imx6.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: fix kernel BUG due to racing DMA operations
Huang Shijie [Mon, 11 Nov 2013 04:13:45 +0000 (12:13 +0800)]
mtd: gpmi: fix kernel BUG due to racing DMA operations

[1] The gpmi uses the nand_command_lp to issue the commands to NAND chips.
    The gpmi issues a DMA operation with gpmi_cmd_ctrl when it handles
    a NAND_CMD_NONE control command. So when we read a page(NAND_CMD_READ0)
    from the NAND, we may send two DMA operations back-to-back.

    If we do not serialize the two DMA operations, we will meet a bug when

    1.1) we enable CONFIG_DMA_API_DEBUG, CONFIG_DMADEVICES_DEBUG,
         and CONFIG_DEBUG_SG.

    1.2) Use the following commands in an UART console and a SSH console:
         cmd 1: while true;do dd if=/dev/mtd0 of=/dev/null;done
         cmd 1: while true;do dd if=/dev/mmcblk0 of=/dev/null;done

    The kernel log shows below:
    -----------------------------------------------------------------
    kernel BUG at lib/scatterlist.c:28!
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
      .........................
    [<80044a0c>] (__bug+0x18/0x24) from [<80249b74>] (sg_next+0x48/0x4c)
    [<80249b74>] (sg_next+0x48/0x4c) from [<80255398>] (debug_dma_unmap_sg+0x170/0x1a4)
    [<80255398>] (debug_dma_unmap_sg+0x170/0x1a4) from [<8004af58>] (dma_unmap_sg+0x14/0x6c)
    [<8004af58>] (dma_unmap_sg+0x14/0x6c) from [<8027e594>] (mxs_dma_tasklet+0x18/0x1c)
    [<8027e594>] (mxs_dma_tasklet+0x18/0x1c) from [<8007d444>] (tasklet_action+0x114/0x164)
    -----------------------------------------------------------------

    1.3) Assume the two DMA operations is X (first) and Y (second).

         The root cause of the bug:
   Assume process P issues DMA X, and sleep on the completion
 @this->dma_done. X's tasklet callback is dma_irq_callback. It firstly
 wake up the process sleeping on the completion @this->dma_done,
 and then trid to unmap the scatterlist S. The waked process P will
 issue Y in another ARM core. Y initializes S->sg_magic to zero
 with sg_init_one(), while dma_irq_callback is unmapping S at the same
 time.

 See the diagram:

                   ARM core 0              |         ARM core 1
 -------------------------------------------------------------
         (P issues DMA X, then sleep)  --> |
                                           |
         (X's tasklet wakes P)         --> |
                                           |
                                           | <-- (P begin to issue DMA Y)
                                           |
         (X's tasklet unmap the            |
      scatterlist S with dma_unmap_sg) --> | <-- (Y calls sg_init_one() to init
                                           |      scatterlist S)
                                           |

[2] This patch serialize both the X and Y in the following way:
     Unmap the DMA scatterlist S firstly, and wake up the process at the end
     of the DMA callback, in such a way, Y will be executed after X.

     After this patch:

                   ARM core 0              |         ARM core 1
 -------------------------------------------------------------
         (P issues DMA X, then sleep)  --> |
                                           |
         (X's tasklet unmap the            |
      scatterlist S with dma_unmap_sg) --> |
                                           |
         (X's tasklet wakes P)         --> |
                                           |
                                           | <-- (P begin to issue DMA Y)
                                           |
                                           | <-- (Y calls sg_init_one() to init
                                           |     scatterlist S)
                                           |

Cc: stable@vger.kernel.org # 3.2
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agoENGR00174886-2 - EPDC fb: Don't register EPDC unless "epdc" kernel option set
Danny Nold [Wed, 22 Feb 2012 18:59:59 +0000 (12:59 -0600)]
ENGR00174886-2 - EPDC fb: Don't register EPDC unless "epdc" kernel option set

- EPDC firmware build was breaking due to binary build pre-empting
the conversion from .fw.ihex->.fw.  Resolve this by forcing
firmware objects to be built in order.

Signed-off-by: Danny Nold <dannynold@freescale.com>
(cherry picked from commit 7b6cb73b0a86a1d274633830fed5c65c1a0dd7d8)

10 years agoENGR00279944 ath6kl: sdio: fix system panic when doing wifi stress test
Jason Liu [Mon, 11 Nov 2013 06:29:01 +0000 (14:29 +0800)]
ENGR00279944 ath6kl: sdio: fix system panic when doing wifi stress test

When did the wifi test, meet one following kernel panic:

Unable to handle kernel paging request at virtual address 1a480000
pgd = 80004000
[1a480000] *pgd=00000000
Internal error: Oops: 805 [#1] SMP ARM
Modules linked in: ath6kl_sdio ath6kl_core [last unloaded: ath6kl_core]
CPU: 0 PID: 1953 Comm: kworker/u4:0 Not tainted 3.10.9-1.0.0_alpha+dbf364b #1
Workqueue: ath6kl ath6kl_sdio_write_async_work [ath6kl_sdio]
task: dcc9a680 ti: dc9ae000 task.ti: dc9ae000
PC is at v7_dma_clean_range+0x20/0x38
LR is at dma_cache_maint_page+0x50/0x54
pc : [<8001a6f8>]    lr : [<800170fc>]    psr: 20000093
sp : dc9afcf8  ip : 8001a748  fp : 00000004
r10: 00000000  r9 : 00000001  r8 : 00000000
r7 : 00000001  r6 : 00000000  r5 : 80cb7000  r4 : 03f9a480
r3 : 0000001f  r2 : 00000020  r1 : 1a480000  r0 : 1a480000
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 6cc5004a  DAC: 00000015
Process kworker/u4:0 (pid: 1953, stack limit = 0xdc9ae238)
Stack: (0xdc9afcf8 to 0xdc9b0000)
fce0:                                                       80c9b29c 00000000
fd00: 00000000 80017134 8001a748 dc302ac0 00000000 00000000 dc454a00 80c12ed8
fd20: dc115410 80017238 00000000 dc454a10 00000001 80017588 00000001 00000000
fd40: 00000000 dc302ac0 dc9afe38 dc9afe68 00000004 80c12ed8 00000000 dc454a00
fd60: 00000004 80436f88 00000000 00000000 00000600 0000ffff 0000000c 80c113c4
fd80: 80c9b29c 00000001 00000004 dc115470 60000013 dc302ac0 dc46e000 dc302800
fda0: dc9afe10 dc302b78 60000013 dc302ac0 dc46e000 00000035 dc46e5b0 80438c90
fdc0: dc9afe10 dc302800 dc302800 dc9afe68 dc9afe38 80424cb4 00000005 dc9afe10
fde0: dc9afe20 80424de8 dc9afe10 dc302800 dc46e910 80424e90 dc473c00 dc454f00
fe00: 000001b5 7f619d64 dcc7c830 00000000 00000000 dc9afe38 dc9afe68 00000000
fe20: 00000000 00000000 dc9afe28 dc9afe28 80424d80 00000000 00000035 9cac0034
fe40: 00000000 00000000 00000000 00000000 000001b5 00000000 00000000 00000000
fe60: dc9afe68 dc9afe10 3b9aca00 00000000 00000080 00000034 00000000 00000100
fe80: 00000000 00000000 dc9afe10 00000004 dc454a00 00000000 dc46e010 dc46e96c
fea0: dc46e000 dc46e964 00200200 00100100 dc46e910 7f619ec0 00000600 80c0e770
fec0: dc15a900 dcc7c838 00000000 dc46e954 8042d434 dcc44680 dc46e954 dc004400
fee0: dc454500 00000000 00000000 dc9ae038 dc004400 8003c450 dcc44680 dc004414
ff00: dc46e954 dc454500 00000001 dcc44680 dc004414 dcc44698 dc9ae000 dc9ae030
ff20: 00000001 dc9ae000 dc004400 8003d158 8003d020 00000000 00000000 80c53941
ff40: dc9aff64 dcb71ea0 00000000 dcc44680 8003d020 00000000 00000000 00000000
ff60: 00000000 80042480 00000000 00000000 000000f8 dcc44680 00000000 00000000
ff80: dc9aff80 dc9aff80 00000000 00000000 dc9aff90 dc9aff90 dc9affac dcb71ea0
ffa0: 800423cc 00000000 00000000 8000e018 00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
...
---[ end trace 0c038f0b8e0b67a3 ]---

The kernel panic is caused by the sg_buf is not set correctly with the
following code when compiled with Yocto GCC 4.8.1:

drivers/net/wireless/ath/ath6kl/hif.h:
struct hif_scatter_req {
        struct list_head list;
        /* address for the read/write operation */
        u32 addr;
...

        /* bounce buffer for upper layers to copy to/from */
        u8 *virt_dma_buf;

        struct hif_scatter_item scat_list[1];

        u32 scat_q_depth;
};

(Note: the scat_req.scat_list[] will dynamiclly grow with run-time)

drivers/net/wireless/ath/ath6kl/sdio.c: ath6kl_sdio_setup_scat_data(...)
/* assemble SG list */
for (i = 0; i < scat_req->scat_entries; i++, sg++) {
ath6kl_dbg(ATH6KL_DBG_SCATTER, "%d: addr:0x%p, len:%d\n",
   i, scat_req->scat_list[i].buf,
   scat_req->scat_list[i].len);

sg_set_buf(sg, scat_req->scat_list[i].buf,
   scat_req->scat_list[i].len);
}

The GCC 4.8.1 compiler will not do the for-loop till scat_entries, instead,
it only run one round loop. This may be caused by that the GCC 4.8.1 thought
that the scat_list only have one item and then no need to do full iteration,
but this is simply wrong by looking at the assebly code. This will cause the
sg buffer not get set when scat_entries > 1 and thus lead to kernel panic.

This patch is a workaround to the GCC 4.8.1 complier issue by passing the
entry address of the scat_req->scat_list to the for-loop and interate it,
then, GCC 4.8.1 will do the full for-loop correctly.
(Note: This issue not observed with GCC 4.7.2, only found on the GCC 4.8.1)

This patch does not change any function logic and no any performance downgrade.

Signed-off-by: Jason Liu <r64343@freescale.com>
10 years agoENGR00287331-3 sdhci-esdhc-imx: do not need disable clock during remove function
Dong Aisheng [Mon, 11 Nov 2013 08:44:19 +0000 (16:44 +0800)]
ENGR00287331-3 sdhci-esdhc-imx: do not need disable clock during remove function

Since the clock is managed by runtime pm currently, we do not need
disable it again during driver remove function, or it will cause
clock disable count mismatch issue since the clocks have already been disabled.

mx6slevk:/sys/bus/platform/drivers/sdhci-esdhc-imx# echo 2194000.usdhc > unbind
mmc1: card aaaa removed
------------[ cut here ]------------
WARNING: at drivers/clk/clk.c:780 clk_disable+0x18/0x24()
....

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00287331-2 sdhci-esdhc-imx: use bus freq in runtime pm
Dong Aisheng [Mon, 11 Nov 2013 06:53:58 +0000 (14:53 +0800)]
ENGR00287331-2 sdhci-esdhc-imx: use bus freq in runtime pm

Request BUS_FREQ_HIGH when bus is busy and then release BUS_FREQ_HIGH
when bus becomes idle.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00287331-1 mmc: add delay after CMD6 befoer sending CMD13 for sandisk
Ryan QIAN [Wed, 16 Jan 2013 02:23:28 +0000 (10:23 +0800)]
ENGR00287331-1 mmc: add delay after CMD6 befoer sending CMD13 for sandisk

- Some sandisk emmc cards need certain delay befor sending cmd13 after cmd6.
Original CR: ENGR174296 (commit: fd031f9)

Acked-by: Aisheng Dong <b29396@freescale.com>
Signed-off-by: Ryan QIAN <b32804@freescale.com>
(cherry picked from commit f942bf1db36355d46f38792601594949f3f2c71b)

10 years agoENGR00286960-2 arm: imx: improve status check of clock gate
Anson Huang [Fri, 8 Nov 2013 19:59:05 +0000 (14:59 -0500)]
ENGR00286960-2 arm: imx: improve status check of clock gate

For ccm clock gate, both 2b'11 and 2b'01 should be treated
as clock enabled, see below description in CCM:

2b'00: clock is off during all modes;
2b'01: clock is on in run mode, but off in wait and stop mode;
2b'10: Not applicable;
2b'11: clock is on during all modes, except stop mode.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00286960-1 arm: imx: initialize clock gate status
Anson Huang [Fri, 8 Nov 2013 19:54:31 +0000 (14:54 -0500)]
ENGR00286960-1 arm: imx: initialize clock gate status

Some clocks gates need to be set to 2b'01 to allow CCM
auto disabling them when system enters WAIT mode, this
setting can save many runtime power. These clock gates
are normally always enabled, so no need to add another
status for clk gate enable function, just set them to
right status when system boot up is good enough.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00286744-3 arm: imx: optimize power number for busfreq
Anson Huang [Thu, 7 Nov 2013 20:38:20 +0000 (15:38 -0500)]
ENGR00286744-3 arm: imx: optimize power number for busfreq

i.MX6DL's axi clock is sourcing from pfd540 by default,
need to switch axi clock from pfd540 to periph when system
enters low bus mode, this is to allow pfd540 to be disabled,
and it also keeps clk tree correct.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00286744-2 arm: dts: imx6dl: add clks for busfreq
Anson Huang [Thu, 7 Nov 2013 19:11:44 +0000 (14:11 -0500)]
ENGR00286744-2 arm: dts: imx6dl: add clks for busfreq

Need to switch axi clock from pfd540 to periph when
system enters low bus mode, so add necessary clks for
bufreq driver.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00286744-1 arm: imx: add necessary interface for pfd
Anson Huang [Thu, 7 Nov 2013 19:06:00 +0000 (14:06 -0500)]
ENGR00286744-1 arm: imx: add necessary interface for pfd

Common clk framework will disable unused clks only if
they are enabled by default, so we need to add is_enabled
callback for clk framework to get clks' status.

pfd clocks are enabled by default, so we need to add this
interface for common clk framework to disable unused pfds.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00287081 [iMX6SL] - Make sure MMDC clocks are enabled at boot
Ranjani Vaidyanathan [Fri, 8 Nov 2013 18:37:10 +0000 (12:37 -0600)]
ENGR00287081 [iMX6SL] - Make sure MMDC clocks are enabled at boot

Need to enable MMDC clocks to maintain the correct usecount, else
PLL2 can get disabled incorrectly thus hanging the system.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00286345 [iMX6DL] Fixed random hang bug in bus freq driver
Ranjani Vaidyanathan [Tue, 5 Nov 2013 20:44:20 +0000 (14:44 -0600)]
ENGR00286345 [iMX6DL] Fixed random hang bug in bus freq driver

Incorrect clock disable of PLL2 caused random hangs during
DDR freq change in iMX6DL.
Remove PERCLK freq change code as this is not required for TO1.1
and later.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agommc: sdhci: fix ctrl_2 on super-speed selection
Giuseppe CAVALLARO [Thu, 13 Jun 2013 14:41:28 +0000 (16:41 +0200)]
mmc: sdhci: fix ctrl_2 on super-speed selection

This patch fixes the HC ctrl_2 programming where, in case of
SDR104 and HS200, we have to write 100b in the the UHS Mode
bits. We wrote 101b that is reserved from Arasan Specs.

Reported-by: Youssef Triki <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 599115686d8f62999a871f7d7ee87de3b939b258)

10 years agommc: sdhci: fix caps2 for HS200
Giuseppe CAVALLARO [Wed, 12 Jun 2013 06:16:38 +0000 (08:16 +0200)]
mmc: sdhci: fix caps2 for HS200

Although the HC supports HS200 (eMMC) the caps2 are always zero; this
means there's no way to use the super speed mode (when init the card).

If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC
and this patch just sets the MMC_CAP2_HS200 in the host caps2 field.

Reported-by: Youssef Triki <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Philip Rakity <prakity@nvidia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 156e14b126ffb6f040bc6f1aff3c51077e42a744)

10 years agommc: sdhci: add ability to stay runtime-resumed if the card is powered up
Adrian Hunter [Mon, 6 May 2013 09:17:32 +0000 (12:17 +0300)]
mmc: sdhci: add ability to stay runtime-resumed if the card is powered up

If card power is dependent on SD bus power then the host controller
must not be runtime suspended while the card is powered up.  Add
the ability to stay runtime-resumed in that case and enable it with a new
quirk SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit f0710a557cb17746b09234f01073a2cdafe4f4a5)

10 years agoENGR00286971-4 Revert "ENGR00278504-1 mmc: sdhci: add quirk for broken acmd23"
Dong Aisheng [Fri, 8 Nov 2013 10:50:07 +0000 (18:50 +0800)]
ENGR00286971-4 Revert "ENGR00278504-1 mmc: sdhci: add quirk for broken acmd23"

The ACMD23 unwork issue is fixed now. so the former quirk to disable
ACMD23 can be removed.

This reverts commit fd27fce042bfd289eab6dbb7c98ab3adb48ca25b.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286971-3 Revert "ENGR00278504-2 sdhci-esdhc-imx: add broken auto cmd23"
Dong Aisheng [Fri, 8 Nov 2013 10:49:41 +0000 (18:49 +0800)]
ENGR00286971-3 Revert "ENGR00278504-2 sdhci-esdhc-imx: add broken auto cmd23"

This reverts commit 7b725c102e1ddfbaca5856af7c286bfd626363ea.

Conflicts:

drivers/mmc/host/sdhci-esdhc-imx.c

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286971-2 dts: imx6-sabreauto: disabled flexcan when max7310 is gone
Dong Aisheng [Fri, 8 Nov 2013 07:51:10 +0000 (15:51 +0800)]
ENGR00286971-2 dts: imx6-sabreauto: disabled flexcan when max7310 is gone

Flexcan transceiver is using GPIOs from max7310 on i2c3.
Since max7310 is gone on below dts files, so there's no reason
to keep flexcan alive in those dts files.

Note: since flexcan1 is disabled by default, so did not need
to add it.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286971-1 imx6q: add sanity check for getting gpio for flexcan
Dong Aisheng [Fri, 8 Nov 2013 07:48:23 +0000 (15:48 +0800)]
ENGR00286971-1 imx6q: add sanity check for getting gpio for flexcan

This is used to avoid a warning:
WARNING: at /home/b29397/work/projects/linux-2.6-imx/drivers/gpio/gpiolib.c:126
gpio_to_desc+0x30/0x44()
invalid GPIO -517
Modules linked in:
....
gpiod_request: invalid GPIO

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286926 usb: chipidea: imx: add release_bus_freq at failure path
Peter Chen [Fri, 8 Nov 2013 02:14:18 +0000 (10:14 +0800)]
ENGR00286926 usb: chipidea: imx: add release_bus_freq at failure path

If not, the request{release}_bus_freq will be mismatch if
fail occurs.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agommc: sdhci: Avoid needless loop while handling SDIO interrupts in sdhci_irq()
Alexey Neyman [Wed, 6 Nov 2013 03:40:36 +0000 (19:40 -0800)]
mmc: sdhci: Avoid needless loop while handling SDIO interrupts in sdhci_irq()

Ignore Card Interrupt bit in the interrupt status if we already know that
mmc_signal_sdio_irq() is going to be called at the end of sdhci_irq(). This
avoids a needless loop in sdhci_irq() repeatedly reading interrupt status
and doing nothing.

Signed-off-by: Alexey Neyman <stilor@att.net>
Acked-by: Dong Aisheng <b29396@freescale.com>
10 years agommc: sdhci-esdhc-imx: add runtime pm support
Dong Aisheng [Wed, 30 Oct 2013 13:13:26 +0000 (21:13 +0800)]
mmc: sdhci-esdhc-imx: add runtime pm support

The root clock will be disabled in runtime pm which can be used to save power.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
10 years agommc: sdhci-esdhc-imx: fix runtime pm unblance issue
Dong Aisheng [Thu, 7 Nov 2013 07:12:48 +0000 (15:12 +0800)]
mmc: sdhci-esdhc-imx: fix runtime pm unblance issue

Since we're using common esdhc_send_command for tuning commands and
the core code will call pm_runtime_put after command is finished.
So we add a pm_runtime_get_sync here to get the blance.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
10 years agommc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits
Dong Aisheng [Wed, 30 Oct 2013 10:48:52 +0000 (18:48 +0800)]
mmc: sdhci-esdhc-imx: clear SDHCI_CTRL_EXEC_TUNING should not affect other bits

Current code will clear all turning related bits like ESDHC_STD_TUNING_EN
and ESDHC_MIX_CTRL_FBCLK_SEL when clear SDHCI_CTRL_EXEC_TUNING.
This may cause the card which has already passed the turning to become
unwork since the turning status lost.
We observed this failure when enable runtime pm.

BTW, imx needs to enable ESDHC_MIX_CTRL_FBCLK_SEL bit for turned clock.
The FBCLK_SEL will be cleared when SDHCI_CTRL_TUNED_CLK is cleared
and SDHCI_CTRL_EXEC_TUNING is not set.
This is used in case we change to another normal card from a UHS card
in the same slot. FBCLK_SEL is not needed for normal card.

After that, SDHCI_CTRL_EXEC_TUNING will only affect ESDHC_MIX_CTRL_EXE_TUNE.
Clearing it does not affect the turned card to remain working on UHS mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
10 years agommc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
Dong Aisheng [Wed, 30 Oct 2013 08:54:09 +0000 (16:54 +0800)]
mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset

We should not clear tuning bits during reset or the SD3.0/eMMC4.5 card
working on UHS mode may not work after reset since the former tuning
settings was lost.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
10 years agommc: sdhci-pltfm: export pltfm suspend/resume api
Dong Aisheng [Thu, 7 Nov 2013 07:11:00 +0000 (15:11 +0800)]
mmc: sdhci-pltfm: export pltfm suspend/resume api

It is helpful for platforms code to use to elimiate duplicated code.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
10 years agommc: sdhci-esdhc-imx: add eMMC HS200 mode support
Dong Aisheng [Mon, 21 Oct 2013 13:38:30 +0000 (21:38 +0800)]
mmc: sdhci-esdhc-imx: add eMMC HS200 mode support

Add support for eMMC 4.5 cards to work on hs200 mode.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
10 years agommc: core: mmc DDR mode should not depend on UHS_DDR50
Dong Aisheng [Wed, 16 Oct 2013 08:48:39 +0000 (16:48 +0800)]
mmc: core: mmc DDR mode should not depend on UHS_DDR50

The MMC_CAP_UHS_DDR50 must work on 1.8v.
However, the eMMC DDR mode can work on either 1.8v or 3.3v and
should not depend on UHS_DDR50.
So get rid of this limitation to let controller without 1.8v
signal voltage support can also work for eMMC DDR mode if it claims.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
10 years agommc: sdhci-esdhc-imx: add MMC_CAP_1_8V_DDR for mx6
Dong Aisheng [Thu, 7 Nov 2013 07:08:34 +0000 (15:08 +0800)]
mmc: sdhci-esdhc-imx: add MMC_CAP_1_8V_DDR for mx6

The i.MX6 supports 1.8v/3.3v eMMC DDR mode, so add this flag.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
10 years agommc: sdhci-esdhc-imx: fix cpas over write issue
Dong Aisheng [Thu, 17 Oct 2013 06:29:32 +0000 (14:29 +0800)]
mmc: sdhci-esdhc-imx: fix cpas over write issue

We should use '|=' instead '=', or it may over write
the original caps assigned before this line.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
10 years agommc: sdhci-esdhc-imx: add SDHCI_TRANSFER_MODE read function
Dong Aisheng [Fri, 18 Oct 2013 11:38:25 +0000 (19:38 +0800)]
mmc: sdhci-esdhc-imx: add SDHCI_TRANSFER_MODE read function

Used to read out the correct value of SDHCI_TRANSFER_MODE register
for upper layer.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
10 years agommc: sdhci: clear auto cmd setting bits for no data cmds
Dong Aisheng [Fri, 18 Oct 2013 11:36:50 +0000 (19:36 +0800)]
mmc: sdhci: clear auto cmd setting bits for no data cmds

The auto cmd settings bits should be cleared before sending new commands
or we may receive command timeout error for normal commands due to wrongly
pre-sent auto cmd.

e.g. we receive CMD13 timeout error due to ACMD23 is wrongly enabled
by former data commands.

mmc2: new high speed DDR MMC card at address 0001
mmcblk1: mmc2:0001 SEM08G 7.39 GiB
mmcblk1boot0: mmc2:0001 SEM08G partition 1 2.00 MiB
mmcblk1boot1: mmc2:0001 SEM08G partition 2 2.00 MiB
mmcblk1rpmb: mmc2:0001 SEM08G partition 3 128 KiB
 mmcblk1: p1 p2 p3 p4 < p5 p6 p7 >
mmc2: Timeout waiting for hardware interrupt.
 mmcblk1boot1: unknown partition table
mmc2: Timeout waiting for hardware interrupt.
 mmcblk1boot0: unknown partition table

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
10 years agoENGR00286724-11 imx_v7_defconfig: add flexcan support
Dong Aisheng [Thu, 7 Nov 2013 08:10:06 +0000 (16:10 +0800)]
ENGR00286724-11 imx_v7_defconfig: add flexcan support

Add flexcan support.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-10 dts: sabreauto: add new dts for flexcan1 support
Dong Aisheng [Wed, 6 Nov 2013 11:37:38 +0000 (19:37 +0800)]
ENGR00286724-10 dts: sabreauto: add new dts for flexcan1 support

The flexcan1 is pin conflict with fec. So we add a new dts file with
flexcan1 enabled with fec disabled for user to use.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-9 dts: imx6qdl: add properties for flexcan to support wakeup
Dong Aisheng [Wed, 6 Nov 2013 11:14:08 +0000 (19:14 +0800)]
ENGR00286724-9 dts: imx6qdl: add properties for flexcan to support wakeup

According to binding doc, add missed properties for remote wakeup
support.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-8 can: flexcan: add self wakeup support
Dong Aisheng [Wed, 6 Nov 2013 11:10:28 +0000 (19:10 +0800)]
ENGR00286724-8 can: flexcan: add self wakeup support

If wakeup is enabled, enter stop mode, else enter disabled mode.
Self wake can only work on stop mode.
For imx6q, the stop request has to be mannually assert on
IOMUX GPR13[28:29] register, we use syscon to control that bit.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-7 ARM: dts: sabreauto: add flexcan support
Dong Aisheng [Wed, 6 Nov 2013 02:50:09 +0000 (10:50 +0800)]
ENGR00286724-7 ARM: dts: sabreauto: add flexcan support

The flexcan1 is disabled by default since it's conflict with fec.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-6 ARM: imx6q: use auxdata to pass flexcan_switch function hook
Dong Aisheng [Wed, 6 Nov 2013 02:46:35 +0000 (10:46 +0800)]
ENGR00286724-6 ARM: imx6q: use auxdata to pass flexcan_switch function hook

Before we have a common can tranceiver binding to handle gpios
operations, we use auxdata to pass flexcan_switch function first.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-5 can: flexcan: add tranceiver gpios binding
Dong Aisheng [Mon, 10 Dec 2012 12:14:01 +0000 (20:14 +0800)]
ENGR00286724-5 can: flexcan: add tranceiver gpios binding

Add gpios for tranceiver control.

Before we have a common tranceiver binding, we use this way first.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-4 ARM: dts: imx6q: complement of can properties
Dong Aisheng [Mon, 4 Nov 2013 09:33:07 +0000 (17:33 +0800)]
ENGR00286724-4 ARM: dts: imx6q: complement of can properties

Add missed properties.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-3 ARM: dts: imx6q: change to generic name for flexcan
Dong Aisheng [Mon, 4 Nov 2013 09:22:43 +0000 (17:22 +0800)]
ENGR00286724-3 ARM: dts: imx6q: change to generic name for flexcan

As following the device tree naming rule, we change the device node
name to a more generic one and use phandle name specificly.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-2 ARM: clk-imx6q: fix the wrong parent of can_root clock
Dong Aisheng [Mon, 10 Dec 2012 02:36:27 +0000 (10:36 +0800)]
ENGR00286724-2 ARM: clk-imx6q: fix the wrong parent of can_root clock

From the clock tree defined in i.MX6Q Reference Mannual, the parent of can_root
clock should be pll3_60m.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00286724-1 net: flexcan: using per clock for clock rate calculation
Dong Aisheng [Mon, 10 Dec 2012 02:32:56 +0000 (10:32 +0800)]
ENGR00286724-1 net: flexcan: using per clock for clock rate calculation

The per clock is used for the output clock.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agomtd: nand: use a local variable to simplify the nand_scan_tail
Huang Shijie [Fri, 18 Oct 2013 06:20:53 +0000 (14:20 +0800)]
mtd: nand: use a local variable to simplify the nand_scan_tail

There are too many "chip->ecc" in the nand_scan_tail() which makes the eyes
sore.

This patch uses a local variable "ecc" to replace the "chip->ecc" to
make the code more graceful.

Do the code change with "s/chip->ecc\./ecc->/g" in the nand_scan_tail,
and also change some lines by hand.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
10 years agomtd: gpmi: Use devm_kzalloc()
Fabio Estevam [Tue, 5 Nov 2013 02:07:05 +0000 (00:07 -0200)]
mtd: gpmi: Use devm_kzalloc()

Using devm_kzalloc() can make the code simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoASoC: generic-dmaengine-pcm: Use SNDRV_DMA_TYPE_DEV_IRAM as default
Nicolin Chen [Thu, 7 Nov 2013 06:45:16 +0000 (14:45 +0800)]
ASoC: generic-dmaengine-pcm: Use SNDRV_DMA_TYPE_DEV_IRAM as default

When allocating memory space for DMA buffer, use on-chip internal SRAM
as default choice to save power. Since the core would allocate memory
from traditional external memory if iram allocation failed, we don't
need to worry about any side effect.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit ca2b029515b4a81bbedcffc69a5d9574bb5ba475)

10 years agoENGR00286459 usb: chipidea: imx: add request{release}_bus_freq
Peter Chen [Wed, 6 Nov 2013 08:38:18 +0000 (16:38 +0800)]
ENGR00286459 usb: chipidea: imx: add request{release}_bus_freq

When the usb in idle, it calls release_bus_req.
When the usb is going to use, it calls request_bus_req.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286273-3 arm: dtsi: imx6sl: add iram property to support internal SRAM
Nicolin Chen [Tue, 5 Nov 2013 11:46:51 +0000 (19:46 +0800)]
ENGR00286273-3 arm: dtsi: imx6sl: add iram property to support internal SRAM

By doing this, we can allow SDMA driver to allocate its memory from iram
when using i.MX6 SoloLite SoC.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00286273-2 misc: sram: Set default alignment to 4Kbytes
Nicolin Chen [Tue, 5 Nov 2013 11:23:58 +0000 (19:23 +0800)]
ENGR00286273-2 misc: sram: Set default alignment to 4Kbytes

As Kernel 3.0.35 does, we set the default iram alignment to 4Kbytes,
although it would waste few memory space.

We here try to do this as an expediency because currently we couldn't
find a perfect solution for 4Kbytes alignment requirement from SDMA.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00286273-1 dma: imx-sdma: allocate memory from iram
Nicolin Chen [Tue, 5 Nov 2013 11:19:07 +0000 (19:19 +0800)]
ENGR00286273-1 dma: imx-sdma: allocate memory from iram

We try to allocate memory from SoC internal SRAM so that we can turn off
voltage of external DDR to save power. Surely, if we failed to get the
iram DT node or allocate memory due to no enough SRAM space, we would
allow SDMA driver to allocate memory in a traditional way.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00286462 mx6sl fb: fix runtime pm not work at probe time
Robby Cai [Wed, 6 Nov 2013 08:21:08 +0000 (16:21 +0800)]
ENGR00286462 mx6sl fb: fix runtime pm not work at probe time

For mxsfb, the lcdif controller is enabled (with clock enabled as well)
at probe time, but pm_runtime_enable() is called after its enablement,
thus runtime pm function only works at next enablement. The root cause
is that pm_runtime_get_sync() function need to be called after
pm_runtime_enable(). This patch fixes the problem by moving the
position of pm_runtime_enable() ahead.

For epdc fb, runtime pm may not work at probe time if DEFAULT_PANEL_HW_INIT
is turned on (off by default). Fix it for safety.

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoENGR00286426-22 usb: chipidea: imx: Enable CI_HDRC_IMX_EHCI_QUIRK
Peter Chen [Fri, 11 Oct 2013 03:04:16 +0000 (11:04 +0800)]
ENGR00286426-22 usb: chipidea: imx: Enable CI_HDRC_IMX_EHCI_QUIRK

Enable CI_HDRC_IMX_EHCI_QUIRK for controllers who use mxs-phy.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-21 usb: chipidea: host: add ehci quirk for imx controller
Peter Chen [Sun, 29 Sep 2013 02:52:43 +0000 (10:52 +0800)]
ENGR00286426-21 usb: chipidea: host: add ehci quirk for imx controller

When the port goes to suspend or finishes resme, it needs to
notify PHY, it is not a standard EHCI operation, so we add a
quirk for it.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-20 usb: chipidea: host: add quirk for ehci operation
Peter Chen [Sun, 29 Sep 2013 03:07:23 +0000 (11:07 +0800)]
ENGR00286426-20 usb: chipidea: host: add quirk for ehci operation

For chipidea controller, it does not follow ehci spec strictly.
Taking resume signal as an example, it will stop resume signal about
20-21ms later automatically, but standard ehci spec says, the resume
signal is controlled by software (clear portsc.PORT_RESUME).

This operation causes some remote wakeup problems for high speed
devices due to host controller does not send SOF in time since
software can't guarantee set run/stop bit in time (run/stop bit
was cleared at the ehci suspend routine).

When software sets run/stop bit, it needs 1 SoF time to make it effect.
If we close the PHY clock just after setting run/stop bit, it does
not be set in practice, so a software delay is needed.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-19 usb: chipidea: imx: Enable runtime pm support for imx6
Peter Chen [Mon, 21 Oct 2013 08:50:35 +0000 (16:50 +0800)]
ENGR00286426-19 usb: chipidea: imx: Enable runtime pm support for imx6

Currently, only imx6 SoC series add wakeup logic, so only enable
runtime pm for imx6.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-18 usb: chipidea: imx: call set_wakeup when necessary
Peter Chen [Fri, 27 Sep 2013 09:10:58 +0000 (17:10 +0800)]
ENGR00286426-18 usb: chipidea: imx: call set_wakeup when necessary

- Disable wakeup after probe
- Enable wakeup during the suspend
- Disable wakeup after controller is active

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-17 usb: chipidea: usbmisc_imx: add set_wakup API
Peter Chen [Fri, 27 Sep 2013 08:40:33 +0000 (16:40 +0800)]
ENGR00286426-17 usb: chipidea: usbmisc_imx: add set_wakup API

It is used to enable USB wakeup, currently only imx6 SoC series
usb's wakeup is enabled.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-16 usb: chipidea: usbmisc_imx: remove the controller's clock info
Peter Chen [Tue, 22 Oct 2013 06:17:10 +0000 (14:17 +0800)]
ENGR00286426-16 usb: chipidea: usbmisc_imx: remove the controller's clock info

Currently, the usbmisc is just an API supplier for controller
driver, the controller calls related APIs to handle different
things among the SoCs, before calling it, the clock must
be on. So the clock operation is useless for usbmisc, it also
increases the difficulties to manage the clock, especially at
runtime power management situation.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-15 usb: chipidea: add wakeup interrupt handler
Peter Chen [Tue, 22 Oct 2013 06:15:50 +0000 (14:15 +0800)]
ENGR00286426-15 usb: chipidea: add wakeup interrupt handler

When the controller is at suspend mode, it can be waken up by
external events (like vbus, dp/dm or id change). Once we receive
the wakeup interrupt, we need to resume the controller first, eg
open clocks, disable some wakeup settings, etc. After that, the
controller can receive the normal USB interrupts.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-14 usb: chipidea: imx: add power management support
Peter Chen [Fri, 27 Sep 2013 06:03:30 +0000 (14:03 +0800)]
ENGR00286426-14 usb: chipidea: imx: add power management support

Add system and runtime power management support for imx gluy layer.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-13 usb: chipidea: Add power management support
Peter Chen [Thu, 26 Sep 2013 07:45:23 +0000 (15:45 +0800)]
ENGR00286426-13 usb: chipidea: Add power management support

This commit adds runtime and system power management support for
chipidea core. The runtime pm support is controlled by glue
layer, it can be enabled by flag CI_HDRC_SUPPORTS_RUNTIME_PM.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-12 usb: phy-mxs: Add system suspend/resume API
Peter Chen [Thu, 26 Sep 2013 13:10:53 +0000 (21:10 +0800)]
ENGR00286426-12 usb: phy-mxs: Add system suspend/resume API

We need this to keep PHY's power on or off during the system
suspend mode. If we need to enable USB wakeup, then we
must keep PHY's power being on during the system suspend mode.
Otherwise, we need to keep PHY's power being off to save power.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-11 usb: phy-mxs: Add implementation of set_wakeup
Peter Chen [Mon, 16 Sep 2013 05:52:16 +0000 (13:52 +0800)]
ENGR00286426-11 usb: phy-mxs: Add implementation of set_wakeup

When we need the PHY can be waken up by external signals,
we can call this API. Besides, we call mxs_phy_disconnect_line
at this API to close the connection between USB PHY and
controller, after that, the line state from controller is SE0.
Once the PHY is out of power, without calling mxs_phy_disconnect_line,
there are unknown wakeups due to dp/dm floating at device mode.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-10 usb: phy: Add set_wakeup API
Peter Chen [Wed, 18 Sep 2013 06:19:28 +0000 (14:19 +0800)]
ENGR00286426-10 usb: phy: Add set_wakeup API

This API is used to set wakeup enable at PHY registers, in that
case, the PHY can be waken up from suspend due to external events,
like vbus change, dp/dm change and id change.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-9 usb: phy-mxs: Enable IC fixes for related SoCs
Peter Chen [Fri, 11 Oct 2013 05:51:48 +0000 (13:51 +0800)]
ENGR00286426-9 usb: phy-mxs: Enable IC fixes for related SoCs

Some PHY bugs are fixed by IC logic, but these bits are not
enabled by default, so we enable them at driver.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-8 usb: phy-mxs: Add implementation of nofity_suspend{resume}
Peter Chen [Wed, 18 Sep 2013 05:57:59 +0000 (13:57 +0800)]
ENGR00286426-8 usb: phy-mxs: Add implementation of nofity_suspend{resume}

Implementation of notify_suspend and notify_resume will be different
according to mxs_phy_data->flags.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-7 usb: phy: add notify suspend and resume callback
Peter Chen [Mon, 16 Sep 2013 08:31:24 +0000 (16:31 +0800)]
ENGR00286426-7 usb: phy: add notify suspend and resume callback

They are used to notify PHY that the controller enters suspend
or finishes resume.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-6 usb: phy-mxs: Add anatop regmap
Peter Chen [Mon, 16 Sep 2013 04:57:27 +0000 (12:57 +0800)]
ENGR00286426-6 usb: phy-mxs: Add anatop regmap

It is needed by imx6 SoC series, but not for imx23 and imx28.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-5 ARM: dts: imx6: add anatop phandle for usbphy
Peter Chen [Mon, 16 Sep 2013 04:09:21 +0000 (12:09 +0800)]
ENGR00286426-5 ARM: dts: imx6: add anatop phandle for usbphy

Add anatop phandle for usbphy

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-4 usb: doc: phy-mxs: update binding for adding anatop phandle
Peter Chen [Fri, 11 Oct 2013 03:11:05 +0000 (11:11 +0800)]
ENGR00286426-4 usb: doc: phy-mxs: update binding for adding anatop phandle

Add anatop phandle which is used to access anatop registers to
control PHY's power and other USB operations.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-3 usb: phy-mxs: Add auto clock and power setting
Peter Chen [Wed, 4 Sep 2013 06:14:47 +0000 (14:14 +0800)]
ENGR00286426-3 usb: phy-mxs: Add auto clock and power setting

With the auto setting, the PHY's clock and power can be
recovered correctly from low power mode, it is ganranteed by IC logic.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-2 usb: phy-mxs: Add platform judgement code
Peter Chen [Mon, 9 Sep 2013 03:25:46 +0000 (11:25 +0800)]
ENGR00286426-2 usb: phy-mxs: Add platform judgement code

The mxs-phy has several bugs and features at different
versions, the driver code can get it through of_device_id.data.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286426-1 usb: doc: phy-mxs: Add more compatible strings
Peter Chen [Tue, 5 Nov 2013 06:56:24 +0000 (14:56 +0800)]
ENGR00286426-1 usb: doc: phy-mxs: Add more compatible strings

Add "fsl,imx6q-usbphy" for imx6dq and imx6dl, add
"fsl,imx6sl-usbphy" for imx6sl.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoUSB: EHCI: export ehci_handshake for ehci-hcd sub-drivers
Manjunath Goudar [Thu, 13 Jun 2013 17:24:09 +0000 (11:24 -0600)]
USB: EHCI: export ehci_handshake for ehci-hcd sub-drivers

In order to split ehci-hcd.c into separate modules, handshake() must be
exported. Rename the symbol to add an ehci_ prefix, to avoid any naming
clashes.

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
[swarren, split Manjunath's patches more logically, limit this change
to export just handshake()]
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoARM: 7851/1: check for number of arguments in syscall_get/set_arguments()
AKASHI Takahiro [Wed, 9 Oct 2013 14:58:29 +0000 (15:58 +0100)]
ARM: 7851/1: check for number of arguments in syscall_get/set_arguments()

commit 3c1532df5c1b54b5f6246cdef94eeb73a39fe43a upstream.

In ftrace_syscall_enter(),
    syscall_get_arguments(..., 0, n, ...)
        if (i == 0) { <handle ORIG_r0> ...; n--;}
        memcpy(..., n * sizeof(args[0]));
If 'number of arguments(n)' is zero and 'argument index(i)' is also zero in
syscall_get_arguments(), none of arguments should be copied by memcpy().
Otherwise 'n--' can be a big positive number and unexpected amount of data
will be copied. Tracing system calls which take no argument, say sync(void),
may hit this case and eventually make the system corrupted.
This patch fixes the issue both in syscall_get_arguments() and
syscall_set_arguments().

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 4a402463a7a4a4243c9c66600fd01ae800f959e3)

10 years agoENGR00286416 net:fec: Pinctrl PM: add net device running status check
Fugang Duan [Wed, 6 Nov 2013 05:36:23 +0000 (13:36 +0800)]
ENGR00286416 net:fec: Pinctrl PM: add net device running status check

In below case:
ifconfig eth0 down
echo mem > /sys/power/state

After resume, fec pin status set to default, which is not expected
and cost unnecessary power. So, add net device running status check
before calling Pinctrl PM APIs.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00286181 ARM: i.MX6: add more chip revision support
Jason Liu [Tue, 5 Nov 2013 04:03:18 +0000 (12:03 +0800)]
ENGR00286181 ARM: i.MX6: add more chip revision support

With the new tap-out of i.MX6DQ(TO1.5) and i.MX6DL/SOLO(TO1.2), we need add
more chip revision support in order to report the chip revision correctly.

Signed-off-by: Jason Liu <r64343@freescale.com>
10 years agoENGR00286418 usb: chipidea: host: fix below build error
Peter Chen [Wed, 6 Nov 2013 05:50:52 +0000 (13:50 +0800)]
ENGR00286418 usb: chipidea: host: fix below build error

/drivers/usb/chipidea/host.c: In function 'host_start':
/drivers/usb/chipidea/host.c:67:6: error: 'struct ehci_hcd'
has no member named 'has_tdi_phy_lpm'

Signed-off-by: Peter Chen <peter.chen@freescale.com>