]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoENGR00288569: net:fec_ptp: fix the potential issue for storing timestamp
Fugang Duan [Tue, 19 Nov 2013 04:59:18 +0000 (12:59 +0800)]
ENGR00288569: net:fec_ptp: fix the potential issue for storing timestamp

The timestamps generated in the i.MX drivers are generated by the
nanoseconds part coming from the 1588 clock. But the number of seconds
are maintained in a private structure of the interface. Those are
updated in a 1588 clock rollover interrupt.

The timestamp is generated right before a rollover of a second and the
timestamp value is constructed afterwards. Therefore the bigger part of
the timestamp is wrong (the second).

commit:54181c1d83e04b18e63c7723ac80f974b760e019
Suggested solution (pseudo-code):
    If( actual-time.nsec < timestamp.nsec )
        Timestamp.sec = fpp->prtc -1;
    Else
        Timestamp.sec = fpp->prtc;

But it is not perfect and there still exist potenitial second sync issue.
So, the patch Suggested solution (pseudo-code):
    If( actual-time.nsec < timestamp.nsec &&
!FEC_IEVENT[TS_TIMER] )
        Timestamp.sec = fpp->prtc -1;
    Else
        Timestamp.sec = fpp->prtc;

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00289278 dts: imx6qdl-sabreauto: fix usdhc1 pin conflict with gpmi
Dong Aisheng [Fri, 22 Nov 2013 05:45:22 +0000 (13:45 +0800)]
ENGR00289278 dts: imx6qdl-sabreauto: fix usdhc1 pin conflict with gpmi

The SD1 on sabreauto baseboard is conflict with gpmi nand. The conflict
pins are DAT4~DAT7. Since the SD3 on cpu board already supports 8 bit bus
width, we do not want add an extra dts file for it, so we disable 8 bit and use
4 bit width for this issue.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00289279 mmc: sdhci: get runtime pm when sdio irq is enabled
Dong Aisheng [Fri, 15 Nov 2013 09:54:36 +0000 (17:54 +0800)]
ENGR00289279 mmc: sdhci: get runtime pm when sdio irq is enabled

SDIO cards may need clock to send the card interrupt to host.
Thus, we get runtime pm when sdio irq is enabled to prevent the clock
resource is released and put it when sdio irq is disabled.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00288578-8 usb: phy-mxs: do not set PWD.RXPWD1PT1 for low speed connection
Peter Chen [Thu, 21 Nov 2013 08:45:18 +0000 (16:45 +0800)]
ENGR00288578-8 usb: phy-mxs: do not set PWD.RXPWD1PT1 for low speed connection

At very rare cases, the SoF will not send out after resume with
low speed connection. The workaround is do not power down
PWD.RXPWD1PT1 bit during the suspend.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288578-7 usb: phy-mxs: add controller id
Peter Chen [Thu, 21 Nov 2013 11:14:42 +0000 (19:14 +0800)]
ENGR00288578-7 usb: phy-mxs: add controller id

Meanwhile, we fix the problem that we only use controller-1's related
registers at mxs_phy_disconnect_line.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288578-6 ARM: imx: add mxs phy controller id
Peter Chen [Thu, 21 Nov 2013 08:55:28 +0000 (16:55 +0800)]
ENGR00288578-6 ARM: imx: add mxs phy controller id

We use to use controller id to access different register regions

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288578-5 usb: chipidea: change some output message
Peter Chen [Tue, 19 Nov 2013 08:32:52 +0000 (16:32 +0800)]
ENGR00288578-5 usb: chipidea: change some output message

To reduce the message output when unload the module

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288578-4 usb: chipidea: using timer to delay decreasing power.usage_count
Peter Chen [Tue, 19 Nov 2013 07:42:32 +0000 (15:42 +0800)]
ENGR00288578-4 usb: chipidea: using timer to delay decreasing power.usage_count

We need to keep controller as active until the udc or host driver
requests its power.usage_count, otherwise, the system will hang
due to access register at low power mode.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288578-3 usb: chipidea: only update ci->vbus_active at peripheral mode
Peter Chen [Tue, 19 Nov 2013 06:29:33 +0000 (14:29 +0800)]
ENGR00288578-3 usb: chipidea: only update ci->vbus_active at peripheral mode

If we connect between otg-host and host pc with Male-A-To-Male-A cable,
the ci->vbus_active will be error, and cause the controller run when
we load gadget module (ci_udc_start will be run), it causes the kernel
panic since no one will handle irq at that mode.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288578-2 usb: phy-mxs: Add sync time after controller clear phcd
Peter Chen [Thu, 21 Nov 2013 07:37:38 +0000 (15:37 +0800)]
ENGR00288578-2 usb: phy-mxs: Add sync time after controller clear phcd

After clear portsc.phcd, PHY needs 200us time from switch
32K clock to AHB clock.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288578-1 usb: chipidea: using correct low power timing
Peter Chen [Tue, 19 Nov 2013 06:25:04 +0000 (14:25 +0800)]
ENGR00288578-1 usb: chipidea: using correct low power timing

After PHY leaves low power mode, the controller needs 2ms
to reflect PHY's status correctly.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288522 power: imx6-usb-charger: fix build error when build as module
Peter Chen [Tue, 19 Nov 2013 02:38:55 +0000 (10:38 +0800)]
ENGR00288522 power: imx6-usb-charger: fix build error when build as module

It is a library, so it can't be built as a module, besides,
it uses anatop register, it should depends on imx6 soc series.
Below is the build error message it fixes:

CC [M]  drivers/power/imx6_usb_charger.o
/home/b29397/work/projects/linux-2.6-imx/drivers/power/imx6_usb_charger.c:173:5: error: redefinition of 'imx6_usb_vbus_connect'
/home/b29397/work/projects/linux-2.6-imx/include/linux/power/imx6_usb_charger.h:70:5: note: previous definition of 'imx6_usb_vbus_connect' was here
/home/b29397/work/projects/linux-2.6-imx/drivers/power/imx6_usb_charger.c:200:5: error: redefinition of 'imx6_usb_charger_detect_post'
/home/b29397/work/projects/linux-2.6-imx/include/linux/power/imx6_usb_charger.h:74:5: note: previous definition of 'imx6_usb_charger_detect_post' was here
/home/b29397/work/projects/linux-2.6-imx/drivers/power/imx6_usb_charger.c:235:5: error: redefinition of 'imx6_usb_vbus_disconnect'
/home/b29397/work/projects/linux-2.6-imx/include/linux/power/imx6_usb_charger.h:65:5: note: previous definition of 'imx6_usb_vbus_disconnect' was here
/home/b29397/work/projects/linux-2.6-imx/drivers/power/imx6_usb_charger.c:256:5: error: redefinition of 'imx6_usb_create_charger'
/home/b29397/work/projects/linux-2.6-imx/include/linux/power/imx6_usb_charger.h:59:5: note: previous definition of 'imx6_usb_create_charger' was here
/home/b29397/work/projects/linux-2.6-imx/drivers/power/imx6_usb_charger.c:290:6: error: redefinition of 'imx6_usb_remove_charger'
/home/b29397/work/projects/linux-2.6-imx/include/linux/power/imx6_usb_charger.h:54:6: note: previous definition of 'imx6_usb_remove_charger' was here
make[3]: *** [drivers/power/imx6_usb_charger.o] Error 1
make[2]: *** [drivers/power] Error 2

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00277698 net:fec: avoid kernel dump for skb page allocation fail
Fugang Duan [Thu, 21 Nov 2013 04:58:01 +0000 (12:58 +0800)]
ENGR00277698 net:fec: avoid kernel dump for skb page allocation fail

Fast reproduce steps:
1. set kernel parameter mem=500M, after kernel up, run below steps.
1. mount 10.192.225.224:/nfsroot /media/Videos/224nfsroot -t nfs
   -o rw,nolock,addr=10.192.225.224
2. cd /media/Videos/224nfsroot/gst-sanity-test
3. ./linux_recording_sanity_test.sh recording_playback_cmd.txt

kernel dump:
--------------------------------------------------------------
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Total swap = 0kB
kswapd0: page allocation failure: order:0, mode:0x20
CPU: 0 PID: 54 Comm: kswapd0 Tainted: G        W    3.10.17-16884-gc530ac0 #239
[<80013c4c>] (unwind_backtrace+0x0/0xf8) from [<80011704>] (show_stack+0x10/0x14)
[<80011704>] (show_stack+0x10/0x14) from [<8008bb7c>] (warn_alloc_failed+0xd0/0x114)
[<8008bb7c>] (warn_alloc_failed+0xd0/0x114) from [<8008e860>] (__alloc_pages_nodemask+0x5e0/0x8b8)
[<8008e860>] (__alloc_pages_nodemask+0x5e0/0x8b8) from [<804cceb8>] (__netdev_alloc_frag+0x9c/0x138)
[<804cceb8>] (__netdev_alloc_frag+0x9c/0x138) from [<804cddc4>] (__netdev_alloc_skb+0x40/0xe0)
[<804cddc4>] (__netdev_alloc_skb+0x40/0xe0) from [<8037dc8c>] (fec_enet_rx_napi+0x268/0x7e0)
[<8037dc8c>] (fec_enet_rx_napi+0x268/0x7e0) from [<804d7cf8>] (net_rx_action+0x94/0x160)
[<804d7cf8>] (net_rx_action+0x94/0x160) from [<8002c8fc>] (__do_softirq+0xe8/0x1d0)
[<8002c8fc>] (__do_softirq+0xe8/0x1d0) from [<8002ca8c>] (do_softirq+0x4c/0x58)
[<8002ca8c>] (do_softirq+0x4c/0x58) from [<8002ccf4>] (irq_exit+0x90/0xc8)
[<8002ccf4>] (irq_exit+0x90/0xc8) from [<8000ea88>] (handle_IRQ+0x3c/0x94)
[<8000ea88>] (handle_IRQ+0x3c/0x94) from [<8000855c>] (gic_handle_irq+0x28/0x5c)
[<8000855c>] (gic_handle_irq+0x28/0x5c) from [<8000de00>] (__irq_svc+0x40/0x50)
Exception stack(0xac21be08 to 0xac21be50)
be00:                   80ca16f0 00000000 0000bf28 0000bf28 80ca16c8 ac449c00
be20: 000006a4 00000000 00000000 00000000 000003a4 00000000 00000000 ac21be50
be40: 800bf9e4 805fc0d4 600f0013 ffffffff
[<8000de00>] (__irq_svc+0x40/0x50) from [<805fc0d4>] (_raw_spin_lock+0x38/0x3c)
[<805fc0d4>] (_raw_spin_lock+0x38/0x3c) from [<800bf9e4>] (put_super+0x18/0x3c)
[<800bf9e4>] (put_super+0x18/0x3c) from [<800c0968>] (prune_super+0x13c/0x17c)
[<800c0968>] (prune_super+0x13c/0x17c) from [<80093ff8>] (shrink_slab+0x88/0x218)
[<80093ff8>] (shrink_slab+0x88/0x218) from [<8009637c>] (kswapd+0x510/0x80c)
[<8009637c>] (kswapd+0x510/0x80c) from [<80042d64>] (kthread+0xa4/0xb0)
[<80042d64>] (kthread+0xa4/0xb0) from [<8000e258>] (ret_from_fork+0x14/0x3c)
--------------------------------------------------------------

Firstly, alloc_page() try to allocate page from pcp high speed cached page or
free_list by calling get_page_from_freelist(). If failed, and then use low
speed allocation mechanism by calling  __alloc_pages_slowpath(), which may
allocate from reclaimed pages and kernel dump the memory allocate info.

Still don't find the root cause, this patch avoid the kernel dump
in temporarily.

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00289050 mxsfb: remove dev_err in pan_dispaly function
Sandor Yu [Thu, 21 Nov 2013 08:00:12 +0000 (16:00 +0800)]
ENGR00289050 mxsfb: remove dev_err in pan_dispaly function

Xserver will call pan display after fb blanked when device bootup.
mxsfb have prevent such operate.
Replace dev_err with dev_dbg to avoid message print.

Signed-off-by: Sandor Yu <R01008@freescale.com>
10 years agoENGR00289037 dts: Remove hdcp ddc pin property in imx6qdl-sabresd.dtsi
Sandor Yu [Thu, 21 Nov 2013 07:35:09 +0000 (15:35 +0800)]
ENGR00289037 dts: Remove hdcp ddc pin property in imx6qdl-sabresd.dtsi

HDCP ddc pin property define in imx6q-sabresd-hdcp.dts,
so remove the ddc pin preperty from imx6qdl-sabresd.dtsi.

Signed-off-by: Sandor Yu <R01008@freescale.com>
10 years agoENGR00264453 asoc: when codec probe failed, alsa return RETRY error.
Shengjiu Wang [Thu, 21 Nov 2013 08:10:55 +0000 (16:10 +0800)]
ENGR00264453 asoc: when codec probe failed, alsa return RETRY error.

If there is no codec device, the machine driver will not register the
card. then alsa will not return RETRY error. update the error handling
for machine driver.
Add for cs42888 and si476x.
update dts file for sound-fm.

Signed-off-by: Shengjiu Wang <b02247@freescale.com>
10 years agoENGR00288985 imx: sata: add bus frequency high callbacks
Richard Zhu [Thu, 21 Nov 2013 04:46:08 +0000 (12:46 +0800)]
ENGR00288985 imx: sata: add bus frequency high callbacks

Add the fsl BUS_FREQ_HIGH request/release callbacks, during
clk enable/disable operations.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288972 HDMI: unmask overflow interrupter when HDMI phy power on
Sandor Yu [Thu, 21 Nov 2013 05:20:37 +0000 (13:20 +0800)]
ENGR00288972 HDMI: unmask overflow interrupter when HDMI phy power on

Clean HDMI overflow bit need pixel clock on.
HDMI phy power state is align with pixel clock,
so move HDMI overflow bit mask/unmask code to
hdmi phy powerdown/powerup function.

Signed-off-by: Sandor Yu <R01008@freescale.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 agoENGR00288506 [iMX6SL] Improve Audio playback power
Ranjani Vaidyanathan [Mon, 18 Nov 2013 22:20:33 +0000 (16:20 -0600)]
ENGR00288506 [iMX6SL] Improve Audio playback power

When ARM executes WFI in audio playback mode, its possible to
lower the power consumed on the VDDHIGH_IN and VDDSOC_IN rails
by:
1. Putting DDR into self-refresh
2. Lower DDR frequency to 25MHz
3. Float DDR IO pads.

Also drop AHB to 8MHz in audio playback mode (aligning with 3.0.35)

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00285283 PXP: make pxp driver compatible for G2D
Fancy Fang [Wed, 20 Nov 2013 02:25:45 +0000 (10:25 +0800)]
ENGR00285283 PXP: make pxp driver compatible for G2D

Use stride to set AS and PS pitch by default, if stride is 0, then use
width to set AS and PS pitch instead. This will make PXP driver both
work for PXP kernel users and G2D applications.

Signed-off-by: Fancy Fang <B47543@freescale.com>
10 years agoENGR00284411-1 PXP: Enhance YUV, alpha blend and rotation
Fancy Fang [Mon, 21 Oct 2013 05:51:21 +0000 (13:51 +0800)]
ENGR00284411-1 PXP: Enhance YUV, alpha blend and rotation

Support YUV formats like: I420, NV12, NV21, UYVY,
YUYV, VYUY, YVYU, NV16, NV61 and YV12.
Support rotation in both stages before and after alpha blending.

Signed-off-by: Fancy Fang <B47543@freescale.com>
10 years agoENGR00288842 mmc: sdhci-esdhc-imx: add ADMA Length Mismatch errata fix
Dong Aisheng [Tue, 19 Nov 2013 10:10:27 +0000 (18:10 +0800)]
ENGR00288842 mmc: sdhci-esdhc-imx: add ADMA Length Mismatch errata fix

The uSDHC has an ADMA Length Mismatch errata ERR004536 which may cause ADMA
work abnormally. The errata has already been fixed for i.MX6Q TO1.2
and i.MX6DL TO1.1 by enable the bit 7 in 0x6c register.
Unfortunately this fix is not included in i.MX6SL.
So we disable ADMA for i.MX6SL and use SDMA instead.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
10 years agoENGR00288409 pcie: enable pcie pm when pcie is enabled
Richard Zhu [Mon, 18 Nov 2013 08:42:18 +0000 (16:42 +0800)]
ENGR00288409 pcie: enable pcie pm when pcie is enabled

L2 can exit by 'reset' or Inband beacon (from remote EP)
toggling phy_powerdown has same effect as 'inband beacon'
So, toggle bit18 of GPR1, used as a workaround of errata
"PCIe PCIe does not support L2 Power Down"
WARNING: This is not official workaround for ERR005723. But we
have not found issue yet. User should take own risk to use it.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288407 pcie: add pcie ep rc validation system
Richard Zhu [Thu, 14 Nov 2013 09:16:53 +0000 (17:16 +0800)]
ENGR00288407 pcie: add pcie ep rc validation system

HW setup:
* Two i.MX6Q SD boards, one is used as PCIe RC, the other
is used as PCIe EP. Connected by 2*mini_PCIe to standard_PCIe
adaptors, 2*PEX cable adaptors, One PCIe cable.

SW setup:
* When build RC image, make sure that
  CONFIG_IMX_PCIE=y
  # CONFIG_EP_MODE_IN_EP_RC_SYS is not set
  # CONFIG_EP_SELF_IO_TEST is not set
  CONFIG_RC_MODE_IN_EP_RC_SYS=y
* When build EP image,(enable if you want ep do self IO test):
  CONFIG_EP_MODE_IN_EP_RC_SYS=y
  CONFIG_EP_SELF_IO_TEST=y
  # CONFIG_RC_MODE_IN_EP_RC_SYS is not set

Features:
* Set-up link between RC and EP by their stand-alone
125MHz running internally.
* In EP's system, EP can access the reserved ddr memory
(default address:0x40000000) of PCIe RC's system, by the
interconnection between PCIe EP and PCIe RC.
* add the configuration methods in the EP side, used to
configure the start address and the size of the reserved
RC's memory window.
- cat /sys/devices/soc0/soc.1/1ffc000.pcie/rc_memw_info
- echo 0x41000000 > /sys/devices/soc0/soc.1/1ffc000.pcie/rc_memw_start_set
- echo 0x800000 > /sys/devices/soc0/soc.1/1ffc000.pcie/rc_memw_size_set
* provide one example, howto configure the bar# and so on, when
* pcie ep emaluates one memory ram ep device

Throughput:
* To Be fine-tuned.

NOTE:
* boot up EP platform firstly, then boot up RC platform.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288406 pcie: imx: enable pcie switch support
Richard Zhu [Wed, 13 Nov 2013 08:42:06 +0000 (16:42 +0800)]
ENGR00288406 pcie: imx: enable pcie switch support

Fix the pcie switch no detection issue
Root cause why the switch can't be detected before:
* The initialization sequence is not properly, 100ms reset
should be just issue before ltssm enable.
* Lagency INTx mapping is wrong
* remove un-correct IO/MEM iATU outbound mapping.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00286487 pci: imx: eanble pcie msi support
Richard Zhu [Tue, 12 Nov 2013 07:57:42 +0000 (15:57 +0800)]
ENGR00286487 pci: imx: eanble pcie msi support

eanble pcie msi support on imx6 platforms
* add check_device api in the msi chip.
* add the quirks into pcie_port struct for the deviation
from standard routines.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoARM: pci: add ->add_bus() and ->remove_bus() hooks to hw_pci
Thomas Petazzoni [Fri, 9 Aug 2013 20:27:12 +0000 (22:27 +0200)]
ARM: pci: add ->add_bus() and ->remove_bus() hooks to hw_pci

Some PCI drivers may need to adjust the pci_bus structure after it has
been allocated by the Linux PCI core. The PCI core allows
architectures to implement the pcibios_add_bus() and
pcibios_remove_bus() for this purpose. This commit therefore extends
the hw_pci and pci_sys_data structures of the ARM PCI core to allow
PCI drivers to register ->add_bus() and ->remove_bus() in hw_pci,
which will get called when a bus is added or removed from the system.

This will be used for example by the Marvell PCIe driver to connect a
particular PCI bus with its corresponding MSI chip to handle Message
Signaled Interrupts.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Daniel Price <daniel.price@gmail.com>
Tested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoARM: integrator: merge PCIv3 driver into one file
Linus Walleij [Tue, 29 Jan 2013 16:14:18 +0000 (17:14 +0100)]
ARM: integrator: merge PCIv3 driver into one file

The Integrator/AP PCI bridget, "v3" is contained in two files,
where pci.c is a socket container to plug in the v3 device.
However to transition the v3 to enable device tree probing, it
need to be converted to a platform device (so that it can have
a device node in the device tree) and then we want the PCI
driver in a single file, as any other device driver, so we can
handle variants using compatible strings and device name,
and get the base address etc from resources connected to the
device node.

To move toward this goal we consolidate all code in the
pci_v3.c file.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 years agoof: pci: add registry of MSI chips
Thomas Petazzoni [Fri, 9 Aug 2013 20:27:09 +0000 (22:27 +0200)]
of: pci: add registry of MSI chips

This commit adds a very basic registry of msi_chip structures, so that
an IRQ controller driver can register an msi_chip, and a PCIe host
controller can find it, based on a 'struct device_node'.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoof/pci: Add of_pci_parse_bus_range() function
Thierry Reding [Thu, 16 May 2013 15:55:19 +0000 (17:55 +0200)]
of/pci: Add of_pci_parse_bus_range() function

This function can be used to parse a bus-range property as specified by
device nodes representing PCI bridges.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoof/pci: Add of_pci_get_devfn() function
Thierry Reding [Thu, 16 May 2013 15:55:18 +0000 (17:55 +0200)]
of/pci: Add of_pci_get_devfn() function

This function can be used to parse the device and function number from a
standard 5-cell PCI resource. PCI_SLOT() and PCI_FUNC() can be used on
the returned value obtain the device and function numbers respectively.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoPCI: Introduce new MSI chip infrastructure
Thierry Reding [Fri, 9 Aug 2013 20:27:08 +0000 (22:27 +0200)]
PCI: Introduce new MSI chip infrastructure

The new struct msi_chip is used to associated an MSI controller with a
PCI bus. It is automatically handed down from the root to its children
during bus enumeration.

This patch provides default (weak) implementations for the architecture-
specific MSI functions (arch_setup_msi_irq(), arch_teardown_msi_irq()
and arch_msi_check_device()) which check if a PCI device's bus has an
attached MSI chip and forward the call appropriately.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Daniel Price <daniel.price@gmail.com>
Tested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoPCI: use weak functions for MSI arch-specific functions
Thomas Petazzoni [Fri, 9 Aug 2013 20:27:06 +0000 (22:27 +0200)]
PCI: use weak functions for MSI arch-specific functions

Until now, the MSI architecture-specific functions could be overloaded
using a fairly complex set of #define and compile-time
conditionals. In order to prepare for the introduction of the msi_chip
infrastructure, it is desirable to switch all those functions to use
the 'weak' mechanism. This commit converts all the architectures that
were overidding those MSI functions to use the new strategy.

Note that we keep two separate, non-weak, functions
default_teardown_msi_irqs() and default_restore_msi_irqs() for the
default behavior of the arch_teardown_msi_irqs() and
arch_restore_msi_irqs(), as the default behavior is needed by x86 PCI
code.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Daniel Price <daniel.price@gmail.com>
Tested-by: Thierry Reding <thierry.reding@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: linux-ia64@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Cc: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
10 years agoPCI: Allocate only as many MSI vectors as requested by driver
Alexander Gordeev [Mon, 13 May 2013 09:05:48 +0000 (11:05 +0200)]
PCI: Allocate only as many MSI vectors as requested by driver

Because of the encoding of the "Multiple Message Capable" and "Multiple
Message Enable" fields, a device can only advertise that it's capable of a
power-of-two number of vectors, and the OS can only enable a power-of-two
number.

For example, a device that's limited internally to using 18 vectors would
have to advertise that it's capable of 32.  The 14 extra vectors consume
vector numbers and IRQ descriptors even though the device can't actually
use them.

This fix introduces a 'msi_desc::nvec_used' field to address this issue.
When non-zero, it is the actual number of MSIs the device will send, as
requested by the device driver.  This value should be used by architectures
to set up and tear down only as many interrupt resources as the device will
actually use.

Note, although the existing 'msi_desc::multiple' field might seem
redundant, in fact it is not.  The number of MSIs advertised need not be
the smallest power-of-two larger than the number of MSIs the device will
send.  Thus, it is not always possible to derive the former from the
latter, so we need to keep them both to handle this case.

[bhelgaas: changelog, rename to "nvec_used"]
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: designware: Add irq_create_mapping()
Pratyush Anand [Wed, 9 Oct 2013 12:32:12 +0000 (21:32 +0900)]
PCI: designware: Add irq_create_mapping()

Without irq_create_mapping(), the correct IRQ number cannot be
provided.  In this case, it makes problems such as NULL dereference.
Thus, irq_create_mapping() should be added for MSI.

Suggested-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: designware: Make dw_pcie_rd_own_conf(), etc., static
Bjorn Helgaas [Wed, 9 Oct 2013 15:12:37 +0000 (09:12 -0600)]
PCI: designware: Make dw_pcie_rd_own_conf(), etc., static

The following variables and functions are used only in pcie-designware.c,
so make them static:

  global_io_offset
  dw_pcie_rd_own_conf()
  dw_pcie_wr_own_conf()
  dw_pcie_setup()
  dw_pcie_scan_bus()
  dw_pcie_map_irq()

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
10 years agoPCI: designware: Add header guards
Seungwon Jeon [Wed, 9 Oct 2013 15:12:21 +0000 (09:12 -0600)]
PCI: designware: Add header guards

Add header guards to prevent redundant inclusion.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: exynos: Add missing clk_disable_unprepare() on error path
Wei Yongjun [Sun, 29 Sep 2013 02:29:11 +0000 (10:29 +0800)]
PCI: exynos: Add missing clk_disable_unprepare() on error path

Add the missing clk_disable_unprepare() before return
from exynos_pcie_probe() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
10 years agoPCI: exynos: Turn off power of phy block when link failed
Jingoo Han [Fri, 6 Sep 2013 08:21:45 +0000 (17:21 +0900)]
PCI: exynos: Turn off power of phy block when link failed

When link failed, there is no need to turn on phy block. Also,
turning on phy block is added, in order to turn on phy block
regardless of the default value of phy registers.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 years agoPCI: exynos: Add support for MSI
Jingoo Han [Fri, 6 Sep 2013 06:54:59 +0000 (15:54 +0900)]
PCI: exynos: Add support for MSI

This patch adds support for Message Signaled Interrupt in the
Exynos PCIe driver using Synopsys designware PCIe core IP.

Signed-off-by: Siva Reddy Kallam <siva.kallam@samsung.com>
Signed-off-by: Srikanth T Shivanand <ts.srikanth@samsung.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Pratyush Anand <pratyush.anand@st.com>
Cc: Mohit KUMAR <Mohit.KUMAR@st.com>
10 years agoENGR00288405: pcie: switch to upstreamed pcie driver
Richard Zhu [Mon, 11 Nov 2013 07:33:02 +0000 (15:33 +0800)]
ENGR00288405: pcie: switch to upstreamed pcie driver

Based on community patch-set, re-setup pcie driver on
imx6 platforms.
* re-fine the pcie clks.
* add the pcie support in dts files.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoPCI: imx6: Probe the PCIe in fs_initcall()
Marek Vasut [Tue, 15 Oct 2013 16:06:38 +0000 (18:06 +0200)]
PCI: imx6: Probe the PCIe in fs_initcall()

Probe the PCIe driver in fs_initcall() instead of module_init()
to assure that pci_assign_unassigned_resources() will be called
early.  This function is called in dw_pcie_host_init(), which is
in turn called from imx6_add_pcie_port(), which is called from
imx6_pcie_probe().  If this is not called early, we will hit
resource collisions since pcieport driver is then probed way too
late.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Frank Li <lznuaa@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Mohit KUMAR <Mohit.KUMAR@st.com>
Cc: Pratyush Anand <pratyush.anand@st.com>
Cc: Richard Zhu <r65037@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Sean Cross <xobs@kosagi.com>
Cc: Siva Reddy Kallam <siva.kallam@samsung.com>
Cc: Srikanth T Shivanand <ts.srikanth@samsung.com>
Cc: Tim Harvey <tharvey@gateworks.com>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: Yinghai Lu <yinghai@kernel.org>(cherry picked from commit f216f57ffe6eede3c8a763add65d331e688f8c56)
10 years agoPCI: imx6: Remove redundant of_match_ptr
Sachin Kamat [Mon, 21 Oct 2013 09:06:41 +0000 (14:36 +0530)]
PCI: imx6: Remove redundant of_match_ptr

imx6_pcie_of_match is always compiled in because PCI_IMX6 depends on
SOC_IMX6Q, which only supports OF build.  Hence of_match_ptr is not
required.

[bhelgaas: add changelog details from Shawn]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sean Cross <xobs@kosagi.com>(cherry picked from commit 8bcadbe17207aee0df4a1f5cb41371d71bf3e4b0)
10 years agoPCI: imx6: Increase link startup timeout
Marek Vasut [Wed, 23 Oct 2013 05:12:18 +0000 (22:12 -0700)]
PCI: imx6: Increase link startup timeout

A longer link startup timeout is required when certain PCI switches are
attached to the root complex.  This was tested with a Pericom switch
and a PLX switch.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>(cherry picked from commit 017f10e1c78e14d48be7a28f2c33a32dae15fee5)
10 years agoPCI: imx6: Fix imprecise abort handler
Tim Harvey [Fri, 18 Oct 2013 00:27:22 +0000 (17:27 -0700)]
PCI: imx6: Fix imprecise abort handler

An imprecise abort is triggered when a port behind a switch is accessed
and no device is present.  At enumeration, imprecise aborts are not enabled
thus this ends up getting deferred until the kernel has completed init.  At
that point we must not adjust PC - the handler must do nothing, but a
handler must exist.

This fixes random crashes that occur right after freeing init.

Tested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Marek Vasut <marex@denx.de>(cherry picked from commit 4ec3ed7f5e91e9325c810dcb995ef5a55e4a79a6)
10 years agoPCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()
Wei Yongjun [Sat, 12 Oct 2013 06:11:02 +0000 (14:11 +0800)]
PCI: imx6: Remove redundant dev_err() in imx6_pcie_probe()

There is an error message within devm_ioremap_resource()
already, so remove the dev_err() call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>(cherry picked from commit 9b5cd0948b67e1750498b5ff85267e87d3b4c5b3)
10 years agoPCI: imx6: Add support for i.MX6 PCIe controller
Sean Cross [Thu, 26 Sep 2013 03:24:47 +0000 (11:24 +0800)]
PCI: imx6: Add support for i.MX6 PCIe controller

Add support for the PCIe port present on the i.MX6 family of controllers.
These use the Synopsis Designware core tied to their own PHY.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
(cherry picked from commit bb38919ec56e0758c3ae56dfc091dcde1391353e)

10 years agoARM: imx6q: Add PCIe bits to GPR syscon definition
Sean Cross [Thu, 26 Sep 2013 03:24:46 +0000 (11:24 +0800)]
ARM: imx6q: Add PCIe bits to GPR syscon definition

PCIe requires additional bits be defined for GPR8 and GPR12.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 8d6a35fb13406f87d926fffeee0d70360ce3077d)

10 years agoARM: dts: imx6qdl: add pcie device node
Sean Cross [Thu, 26 Sep 2013 02:51:09 +0000 (10:51 +0800)]
ARM: dts: imx6qdl: add pcie device node

Add pcie device node for imx6qdl.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
(cherry picked from commit 3a57291fa4ca7f7647d826f5b47082ef306d839f)

10 years agoENGR00288568 Revert "ENGR00275213-1 arm: pcie: enable pcie on imx6 platforms"
Richard Zhu [Thu, 7 Nov 2013 08:44:23 +0000 (16:44 +0800)]
ENGR00288568 Revert "ENGR00275213-1 arm: pcie: enable pcie on imx6 platforms"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-1 arm: pcie: enable pcie on imx6 platforms"
This reverts commit d33370c77e57aed5a9b6733c9898418541fed54a.

Conflicts:

Documentation/devicetree/bindings/clock/imx6q-clock.txt
arch/arm/mach-imx/clk-imx6q.c

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288567 Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits definitions...
Richard Zhu [Thu, 7 Nov 2013 08:39:38 +0000 (16:39 +0800)]
ENGR00288567 Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits definitions of gpr"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-2 ARM: imx6q: update the pcie bits definitions of gpr"
This reverts commit 0ddad708c7484a8b5d2016d31fda2bd8b9b8f275.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288566 Revert "ENGR00275213-3 arm: dts: enable pcie on imx6 platforms"
Richard Zhu [Thu, 7 Nov 2013 08:38:10 +0000 (16:38 +0800)]
ENGR00288566 Revert "ENGR00275213-3 arm: dts: enable pcie on imx6 platforms"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-3 arm: dts: enable pcie on imx6 platforms"
This reverts commit 085fa6af23253017220d29e156dd19060af3d9c1.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288565 Revert "ENGR00275213-4 pcie_imx: enable pcie on imx6 platforms"
Richard Zhu [Thu, 7 Nov 2013 08:34:54 +0000 (16:34 +0800)]
ENGR00288565 Revert "ENGR00275213-4 pcie_imx: enable pcie on imx6 platforms"

switch to community upstreamed pcie driver.
Revert "ENGR00275213-4 pcie_imx: enable pcie on imx6 platforms"
This reverts commit dce7d25b770086a978d4dd9838c46f5ff52ee135.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288564 Revert "ENGR00277241 imx: pcie: Re-correct the pcie dts"
Richard Zhu [Thu, 7 Nov 2013 08:34:31 +0000 (16:34 +0800)]
ENGR00288564 Revert "ENGR00277241 imx: pcie: Re-correct the pcie dts"

switch to community upstreamed pcie driver.
Revert "ENGR00277241 imx: pcie: Re-correct the pcie dts"
This reverts commit 611f8d430690643f828ba94f8cab52e45bbfcca9.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288563 Revert "ENGR00277654 imx: pcie: enable pcie lm errata when pcie is enabled"
Richard Zhu [Thu, 7 Nov 2013 08:34:15 +0000 (16:34 +0800)]
ENGR00288563 Revert "ENGR00277654 imx: pcie: enable pcie lm errata when pcie is enabled"

switch to community upstreamed pcie driver.
Revert "ENGR00277654 imx: pcie: enable pcie lm errata when pcie is enabled"
This reverts commit 72524b16f5cb4e13c1a194dda4cc0c4f206e4e46.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00288562 Revert "ENGR00278492 imx: pcie: delay is required after REF_CLK_EN is...
Richard Zhu [Thu, 7 Nov 2013 08:33:17 +0000 (16:33 +0800)]
ENGR00288562 Revert "ENGR00278492 imx: pcie: delay is required after REF_CLK_EN is set"

switch to community upstreamed pcie driver.
Revert "ENGR00278492 imx: pcie: delay is required after REF_CLK_EN is set"
This reverts commit 1976e889408175354a19824375bc5137f43ef14e.

Signed-off-by: Richard Zhu <r65037@freescale.com>
10 years agoENGR00270037 mxc: mlb: Fix MLB crash when testing abnormally
Luwei Zhou [Tue, 19 Nov 2013 09:32:35 +0000 (17:32 +0800)]
ENGR00270037 mxc: mlb: Fix MLB crash when testing abnormally

If quit the test program via CTRL+c during the test and leaving
the MITB still running, kernel crash sometimes happen when launching
the test program for a second time. This patch fix this issue. The
main modification is:

* Initialize the wait queue head dynamically not statically
* Enable/Disalbe IRQ when necessary

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = 80004000
[00000000] *pgd=00000000
Internal error: Oops: 80000007 [#1] SMP ARM
Modules linked in: mxc_mlb150
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.17-16879-g5d48ab5 #227
task: 80c2d908 ti: 80c22000 task.ti: 80c22000
PC is at 0x0
LR is at __wake_up_common+0x54/0x94
pc : [<00000000>]    lr : [<8004b9fc>]    psr: 90000193
sp : 80c23e18  ip : dc86ff1c  fp : 80c23e44
r10: 00000000  r9 : 00000001  r8 : 00000000
r7 : 00000000  r6 : 7f002fe0  r5 : 7f0017fc  r4 : dcaff0f4
r3 : 00000000  r2 : 00000000  r1 : 00000001  r0 : dc86ff1c
Flags: NzcV  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 6c90004a  DAC: 00000015
Process swapper/0 (pid: 0, stack limit = 0x80c22238)
Stack: (0x80c23e18 to 0x80c24000)
3e00:                                                       00000000 00000001
3e20: dc1d14c0 7f002fdc 20000193 00000001 00000001 00000000 00000000 80c7018e
3e40: 80c23e6c 8004bbf4 00000000 8004bbf4 00000004 0091a840 7f002f80 7f002e1c
3e60: 00000004 fffffff9 00000001 7f001054 ffffae63 00000009 0000005a 00000000
3e80: ffffffff 00000010 00000095 00000000 00000000 00000095 dc011180 7f001168
3ea0: dc482e40 80073c08 00000015 80c2a770 80c1e7e0 dc011180 00000095 00000000
3ec0: f4000100 00000000 00000000 80c22000 80c2a4d8 80073d70 00000000 dc011180
3ee0: 00000095 80076ae8 00000095 800733d0 80c1ee3c 8000e848 f400010c 80c2a8b8
3f00: 80c23f20 80008570 8005a15c 804299d0 60000013 ffffffff 80c23f54 8000dbc0
3f20: 80c23f68 0000005a 3437dc5e 00000015 34373d83 00000015 81aef080 80c30050
3f40: 00000000 00000000 80c22000 80c2a4d8 00000017 80c23f68 8005a15c 804299d0
3f60: 60000013 ffffffff 3437dc5e 00000015 80cc41a4 806152ac 81aef080 80cc41a4
3f80: 00000000 80c30050 00000000 80429b10 00000001 80c7017a 80c2a524 806152ac
3fa0: 80c22000 80c7017a 80c22000 8000eb7c 00067162 800599f0 000000d9 80c12ef0
3fc0: 00000000 80bd6a9c ffffffff ffffffff 80bd6548 00000000 00000000 80c12ef0
3fe0: 10c53c7d 80c2a4a0 80c12eec 80c2e6ec 1000406a 10008074 00000000 00000000
[<8004b9fc>] (__wake_up_common+0x54/0x94) from [<8004bbf4>] (__wake_up+0x3c/0x50)
[<8004bbf4>] (__wake_up+0x3c/0x50) from [<7f001054>] (mlb_tx_isr+0xa0/0xf4 [mxc_mlb150])
[<7f001054>] (mlb_tx_isr+0xa0/0xf4 [mxc_mlb150]) from [<7f001168>] (mlb_ahb_isr+0xc0/0x134 [mxc_mlb150])
[<7f001168>] (mlb_ahb_isr+0xc0/0x134 [mxc_mlb150]) from [<80073c08>] (handle_irq_event_percpu+0x54/0x17c)
[<80073c08>] (handle_irq_event_percpu+0x54/0x17c) from [<80073d70>] (handle_irq_event+0x40/0x60)
[<80073d70>] (handle_irq_event+0x40/0x60) from [<80076ae8>] (handle_fasteoi_irq+0x80/0x158)
[<80076ae8>] (handle_fasteoi_irq+0x80/0x158) from [<800733d0>] (generic_handle_irq+0x2c/0x3c)
[<800733d0>] (generic_handle_irq+0x2c/0x3c) from [<8000e848>] (handle_IRQ+0x40/0x90)
[<8000e848>] (handle_IRQ+0x40/0x90) from [<80008570>] (gic_handle_irq+0x2c/0x5c)
[<80008570>] (gic_handle_irq+0x2c/0x5c) from [<8000dbc0>] (__irq_svc+0x40/0x50

Signed-off-by: Luwei Zhou <b45643@freescale.com>
10 years agoENGR00288421-4 mxc: asrc: keep map/unmap parameters symmetic
Nicolin Chen [Tue, 19 Nov 2013 06:57:00 +0000 (14:57 +0800)]
ENGR00288421-4 mxc: asrc: keep map/unmap parameters symmetic

We are using DEV_TO_MEM for dma_map but MEM_TO_DEV for dma_unmap, thus fix it.
It also adds missing device pointer since assigning it to dma_free_coherent().

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00288421-3 ASoC: fsl_ssi: Move i2s_mode from static to ssi_private
Nicolin Chen [Mon, 18 Nov 2013 09:54:01 +0000 (17:54 +0800)]
ENGR00288421-3 ASoC: fsl_ssi: Move i2s_mode from static to ssi_private

It's no good to use static variable because there might be several
drivers calling the function and the value would be overwritten by
all of them. Thus we move it into ssi_private.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00288421-2 ASoC: fsl_spdif: Ignore system clock due to potential risk
Nicolin Chen [Mon, 18 Nov 2013 09:35:19 +0000 (17:35 +0800)]
ENGR00288421-2 ASoC: fsl_spdif: Ignore system clock due to potential risk

The current clock selecting mechanism would choose a clock and set its rate
later when using it. It might be feasible for other clock sources but not
for sysclk -- ipg clock. Changing ipg clock rate in specific driver would
be a dangerous operation, so we here ingore the sysclk and will restore it
after we accomplish a better mechanism.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
10 years agoENGR00288421-1 ASoC: fsl_spdif: Use correct clock for Rx clock rate calculation
Nicolin Chen [Mon, 18 Nov 2013 09:17:10 +0000 (17:17 +0800)]
ENGR00288421-1 ASoC: fsl_spdif: Use correct clock for Rx clock rate calculation

According to the Reference Manual, we should use system clock to calculate
rx clock rate instead of spdif own clock. Thus add system clock to spdif
driver and replace the incorrect one in rate calculation.

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.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 agoENGR00288123 [iMX6SL] Add low power audio support
Ranjani Vaidyanathan [Wed, 13 Nov 2013 20:03:35 +0000 (14:03 -0600)]
ENGR00288123 [iMX6SL] Add low power audio support

Add support for low power audio playback:
1. SSI2 is sourced from PLL4
2. Extern_audio_clk is sourced from pll4
3. PLL4 is in bypass mode during audio playback (based
   on freq requested by extern_audio_clk and ssi2 clk)
4. DDR is at 100MHz, AHB is at 24MHz.

Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
10 years agoENGR00283186 imx6sl: Add support for power gating of display MIX
Robby Cai [Thu, 14 Nov 2013 10:15:53 +0000 (18:15 +0800)]
ENGR00283186 imx6sl: Add support for power gating of display MIX

The display MIX can be power gated when EPDC, PXP and LCDIF are all inactive.
For safety, this feature is only supported when system enters suspend/standby
mode, in other words, this patch does not support run-time gating.

Signed-off-by: Robby Cai <R63905@freescale.com>
Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agousb: phy: phy-mxs-usb: set the correct platform drvdata
Jisheng Zhang [Thu, 7 Nov 2013 02:55:49 +0000 (10:55 +0800)]
usb: phy: phy-mxs-usb: set the correct platform drvdata

We need to set mxs_phy rather as the platform drvdata so that we can get
the correct mxs_phy in mxs_phy_remove().

Acked-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
10 years agoENGR00255359 usb: core: notify disconnection when core detects disconnect
Peter Chen [Thu, 21 Mar 2013 06:56:17 +0000 (14:56 +0800)]
ENGR00255359 usb: core: notify disconnection when core detects disconnect

It is safe to call notify disconnect when the usb core
thinks the device is disconnected.

This commit also fixes one bug found at below situation:
we have not enabled usb wakeup, we do suspend when there
is an usb device at the port, after suspend, we plug out
the usb device, then plug in device again. At that time,
the nofity disconnect was not called at former code, as
the controller doesn't know the usb device was disconnected
during the suspend, but USB core knows, so to fix this problem,
let the usb core call notify disconnect.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 54d314b320e8adee0593d1bed045197f134cd9cc)

10 years agoENGR00287992-7 ARM: imx_v7_defconfig: enable USB charger detection for imx6
Peter Chen [Thu, 14 Nov 2013 08:48:23 +0000 (16:48 +0800)]
ENGR00287992-7 ARM: imx_v7_defconfig: enable USB charger detection for imx6

Enable imx6 USB charger detection

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-6 usb: chipidea: imx: add usb charger detection for imx6
Peter Chen [Thu, 14 Nov 2013 08:27:05 +0000 (16:27 +0800)]
ENGR00287992-6 usb: chipidea: imx: add usb charger detection for imx6

The usb controller driver creates usb charger, and notify
the charger connect and disconnect using vbus connect and
disconnect event.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-5 usb: chipidea: msm: change the return value for msm notify_event
Peter Chen [Thu, 14 Nov 2013 08:24:38 +0000 (16:24 +0800)]
ENGR00287992-5 usb: chipidea: msm: change the return value for msm notify_event

The return value of .notify_event has changed.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-4 usb: chipidea: Add usb charger detect notify
Peter Chen [Thu, 14 Nov 2013 06:38:20 +0000 (14:38 +0800)]
ENGR00287992-4 usb: chipidea: Add usb charger detect notify

- Change .notify's return value from void to int.
- Add CI_HDRC_CONTROLLER_CHARGER_EVENT and
CI_HDRC_CONTROLLER_CHARGER_POST_EVENT to finish the USB charger
detection flow.
- Add usb_gadget_vbus_connect for only notify udc when vbus
is on, the main reason we add it is we don't want the first
notification when the vbus is off, it causes the
dev->power.usage_count equals -1 when do charger detection.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-3 ARM: imx6: add usb charger detection property
Peter Chen [Thu, 14 Nov 2013 06:35:06 +0000 (14:35 +0800)]
ENGR00287992-3 ARM: imx6: add usb charger detection property

Besides, we have added anatop phandle at usbotg node to
access anatop register.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-2 usb: doc: chipidea: imx: add imx6-usb-charger-detection property
Peter Chen [Thu, 14 Nov 2013 06:29:51 +0000 (14:29 +0800)]
ENGR00287992-2 usb: doc: chipidea: imx: add imx6-usb-charger-detection property

It is used to indicate whether we use SoC's usb charger
detection or not. Besides, we add anatop phandle since
we need to use anatop register to do most of charger detect operations.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00287992-1 power: imx6: add imx6 USB charger detection
Peter Chen [Thu, 14 Nov 2013 05:52:14 +0000 (13:52 +0800)]
ENGR00287992-1 power: imx6: add imx6 USB charger detection

Add imx6 USB charger detection, the vbus supplier will create and
remove struct usb_charger, and notify vbus connect and disconnect
event. The detail USB charger detection flow is at: "i.MX6 RM,
Chapter Universal Serial Bus 2.0 Integrated PHY (USB-PHY),
Charger detection, Charger detection software flow".

Since imx6 only has charger detection function, and no charging
current function is existed. It the user wants the detection abilities
from SoC, it can use this detection method
(add imx6-usb-charger-detection at dts). If the charger IC
already has USB charger detection function, and the user wants
to use the detection method from charger IC, please do not add
imx6-usb-charger-detection property at dts.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288351 sabresd_battery: fix usb charger detect when resume back on mx6sl
Robin Gong [Fri, 15 Nov 2013 10:29:03 +0000 (18:29 +0800)]
ENGR00288351 sabresd_battery: fix usb charger detect when resume back on mx6sl

Fix  below redundant log after first resume back on mx6slevk:
max8903-charger max8903.12: USB Charger Connected

It's caused by not add enough prepare for uok&dok which are connected, such as
i.MX6SL-EVK. In this case the board only support DC charger detect, so we
didn't need judge the uok pin for USB charger detect, although uok share with
dok pin.

Signed-off-by: Robin Gong <b38343@freescale.com>
10 years agoENGR00288342 net:fec_ptp: fix the potential issue for storing timestamp
Fugang Duan [Mon, 18 Nov 2013 02:17:03 +0000 (10:17 +0800)]
ENGR00288342 net:fec_ptp: fix the potential issue for storing timestamp

The timestamps generated in the i.MX drivers are generated by the
nanoseconds part coming from the 1588 clock. But the number of seconds
are maintained in a private structure of the interface. Those are
updated in a 1588 clock rollover interrupt.

The timestamp is generated right before a rollover of a second and the
timestamp value is constructed afterwards. Therefore the bigger part of
the timestamp is wrong (the second).

Suggested solution (pseudo-code):
If( actual-time.nsec < timestamp.nsec )
Timestamp.sec = fpp->prtc -1;
Else
Timestamp.sec = fpp->prtc;

Signed-off-by: Fugang Duan <B38611@freescale.com>
10 years agoENGR00288196 ARM: dts: fix epdc and csi conflict on imx6sl evk
Robby Cai [Fri, 15 Nov 2013 09:21:16 +0000 (17:21 +0800)]
ENGR00288196 ARM: dts: fix epdc and csi conflict on imx6sl evk

There is pinmux conflict for EPDC and I2C3 on imx6sl soc.
While on imx6sl evk board, the camera is attached on I2C3 bus, so the
EPDC function and CSI function can not be used at same time.
This patch removes the conflict in imx6sl-evk.dts file for EPDC function
and adds a new dts file for CSI function.

Signed-off-by: Robby Cai <R63905@freescale.com>
10 years agoENGR00279980 ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1
Huang Shijie [Wed, 18 Sep 2013 02:17:39 +0000 (10:17 +0800)]
ENGR00279980 ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1

If the master mtd does not have any slave mtd partitions,
and its numeraseregions is one(only has one erease block), and
we attach the master mtd with : ubiattach -m 0 -d 0

We will meet the error:
-------------------------------------------------------
root@freescale ~$ ubiattach /dev/ubi_ctrl -m 0 -d 0
UBI: attaching mtd0 to ubi0
UBI error: io_init: multiple regions, not implemented
ubiattach: error!: cannot attach mtd0
           error 22 (Invalid argument)
-------------------------------------------------------

In fact, if there is only one "erase block", we should not
prevent the attach.

This patch fixes it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
10 years agoENGR00288133 arm: imx: correct arm clock usecount for i.MX6Q/DL
Anson Huang [Fri, 15 Nov 2013 14:35:20 +0000 (09:35 -0500)]
ENGR00288133 arm: imx: correct arm clock usecount for i.MX6Q/DL

ARM clock is sourcing from pll1_sw, and pll1_sw can be either
from pll1_sys or step, so we should enable arm clock during
clock initialization instead of pll1_sys, otherwise, arm clock's
usecount would be incorrect and PLL1 will never be disabled even
it is not used.

Signed-off-by: Anson Huang <b20788@freescale.com>
10 years agoENGR00286962-2 usb: chipidea: fix the system will be deadlock with ID wakeup
Peter Chen [Sat, 9 Nov 2013 00:08:10 +0000 (08:08 +0800)]
ENGR00286962-2 usb: chipidea: fix the system will be deadlock with ID wakeup

When we plug in Micro B-TO-A cable at OTG port with u-disk connected,
and enable USB ID wakeup, then, suspend the system, the system
will be deadlock during the resume. See below Sysrq dump.

If the flush_work at block layer is called after system resume
has completed, this problem has fixed (using pm_mutex at ci_otg_work).
It seems if the task is rescheduled before the system resume has
completed (after thaw_processes), it will cause the system dead lock.
Unless the task has been freezed explicitly before system suspend.

The fixes uses wait_event_freezable to wait event, it should call
try_to_freeze during the freeze_processes, and task will not be
scheduled until thaw_processes has called (for frozen process, it will
call wake_up_process explicitly).

--------------------------------------Sysrq dump------------------------------------------
sh              D 80600860     0  1016   1014 0x00000000

[<80600860>] (__schedule+0x1e0/0x5d8) from [<80601274>] (schedule_preempt_disabled+0xc/0x10)

[<80601274>] (schedule_preempt_disabled+0xc/0x10) from [<805ffe00>] (__mutex_lock_slowpath+0x154/0x1f4)

[<805ffe00>] (__mutex_lock_slowpath+0x154/0x1f4) from [<805ffef0>] (mutex_lock+0x50/0x54)

[<805ffef0>] (mutex_lock+0x50/0x54) from [<802f7f84>] (dpm_complete+0xac/0x1ac)

[<802f7f84>] (dpm_complete+0xac/0x1ac) from [<80057a34>] (suspend_devices_and_enter+0x1bc/0x330)

[<80057a34>] (suspend_devices_and_enter+0x1bc/0x330) from [<80057d50>] (pm_suspend+0x1a8/0x240)

[<80057d50>] (pm_suspend+0x1a8/0x240) from [<80056a8c>] (state_store+0x6c/0xbc)

[<80056a8c>] (state_store+0x6c/0xbc) from [<802586c0>] (kobj_attr_store+0x14/0x20)

[<802586c0>] (kobj_attr_store+0x14/0x20) from [<80117374>] (sysfs_write_file+0xfc/0x17c)

[<80117374>] (sysfs_write_file+0xfc/0x17c) from [<800bdcc0>] (vfs_write+0xbc/0x184)

[<800bdcc0>] (vfs_write+0xbc/0x184) from [<800be058>] (SyS_write+0x40/0x68)

[<800be058>] (SyS_write+0x40/0x68) from [<8000e040>] (ret_fast_syscall+0x0/0x30)

kworker/u8:2    D 80600860     0 16146      2 0x00000000

Workqueue: ci_otg ci_otg_work

[<80600860>] (__schedule+0x1e0/0x5d8) from [<805ff374>] (schedule_timeout+0x14c/0x198)

[<805ff374>] (schedule_timeout+0x14c/0x198) from [<80600db8>] (wait_for_common+0xc4/0x17c)

[<80600db8>] (wait_for_common+0xc4/0x17c) from [<8003bbd0>] (flush_work+0xc0/0x160)

[<8003bbd0>] (flush_work+0xc0/0x160) from [<8009d02c>] (bdi_unregister+0x108/0x148)

[<8009d02c>] (bdi_unregister+0x108/0x148) from [<8024b5b4>] (del_gendisk+0xf8/0x1c4)

[<8024b5b4>] (del_gendisk+0xf8/0x1c4) from [<8031e8e8>] (sd_remove+0x64/0x98)

[<8031e8e8>] (sd_remove+0x64/0x98) from [<802f0678>] (__device_release_driver+0x70/0xcc)

[<802f0678>] (__device_release_driver+0x70/0xcc) from [<802f06f0>] (device_release_driver+0x1c/0x28)

[<802f06f0>] (device_release_driver+0x1c/0x28) from [<802f01e4>] (bus_remove_device+0xd8/0xf8)

[<802f01e4>] (bus_remove_device+0xd8/0xf8) from [<802edef8>] (device_del+0xf4/0x178)

[<802edef8>] (device_del+0xf4/0x178) from [<8031abbc>] (__scsi_remove_device+0x48/0xa0)

[<8031abbc>] (__scsi_remove_device+0x48/0xa0) from [<80319bb8>] (scsi_forget_host+0x5c/0x60)

[<80319bb8>] (scsi_forget_host+0x5c/0x60) from [<8031072c>] (scsi_remove_host+0x64/0xf0)

[<8031072c>] (scsi_remove_host+0x64/0xf0) from [<803be150>] (usb_stor_disconnect+0x50/0xc8)

[<803be150>] (usb_stor_disconnect+0x50/0xc8) from [<803ac020>] (usb_unbind_interface+0x58/0x188)

[<803ac020>] (usb_unbind_interface+0x58/0x188) from [<802f0678>] (__device_release_driver+0x70/0xcc)

[<802f0678>] (__device_release_driver+0x70/0xcc) from [<802f06f0>] (device_release_driver+0x1c/0x28)

[<802f06f0>] (device_release_driver+0x1c/0x28) from [<802f01e4>] (bus_remove_device+0xd8/0xf8)

[<802f01e4>] (bus_remove_device+0xd8/0xf8) from [<802edef8>] (device_del+0xf4/0x178)

[<802edef8>] (device_del+0xf4/0x178) from [<803a9e8c>] (usb_disable_device+0xa0/0x1c8)

[<803a9e8c>] (usb_disable_device+0xa0/0x1c8) from [<803a25fc>] (usb_disconnect+0x88/0x1a0)

[<803a25fc>] (usb_disconnect+0x88/0x1a0) from [<803a25e4>] (usb_disconnect+0x70/0x1a0)

[<803a25e4>] (usb_disconnect+0x70/0x1a0) from [<803a5940>] (usb_remove_hcd+0xac/0x15c)

[<803a5940>] (usb_remove_hcd+0xac/0x15c) from [<803c487c>] (host_stop+0x1c/0x3c)

[<803c487c>] (host_stop+0x1c/0x3c) from [<803c1880>] (ci_otg_work+0xc8/0x118)

[<803c1880>] (ci_otg_work+0xc8/0x118) from [<8003c62c>] (process_one_work+0x110/0x360)

[<8003c62c>] (process_one_work+0x110/0x360) from [<8003d180>] (worker_thread+0x144/0x3ac)

[<8003d180>] (worker_thread+0x144/0x3ac) from [<8004272c>] (kthread+0xa4/0xb0)

[<8004272c>] (kthread+0xa4/0xb0) from [<8000e0d8>] (ret_from_fork+0x14/0x3c)

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00286962-1 ARM: imx6dl-auto: enable usb peripheral mode for nor and nand
Peter Chen [Fri, 8 Nov 2013 07:17:08 +0000 (15:17 +0800)]
ENGR00286962-1 ARM: imx6dl-auto: enable usb peripheral mode for nor and nand

Enable usb peripheral mode for spi-nor and gpmi nand.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
10 years agoENGR00288021 IPUv3 disp:get the integer part of div correctly
Sandor Yu [Thu, 14 Nov 2013 08:48:42 +0000 (16:48 +0800)]
ENGR00288021 IPUv3 disp:get the integer part of div correctly

TV will show 639x480p60 when HDMI output 640x480p60.
The same issue can be found when pixel clock sources from ipu internally.
All video modes whose pixel clocks derive from DI clock work OK.
It is caused by the wrong parent clock rate the driver gets.
Fix the issue by getting the right parent clock(ipu->pixel_clk_sel).

Signed-off-by: Sandor Yu <R01008@freescale.com>
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>
11 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>
11 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>
11 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>