Commit Graph

404935 Commits

Author SHA1 Message Date
Jialing Fu
f51501b7bb mmc: core: fix race condition in mmc_wait_data_done
The following panic is captured in ker3.14, but the issue still exists
in latest kernel.
---------------------------------------------------------------------
[   20.738217] c0 3136 (Compiler) Unable to handle kernel NULL pointer dereference
at virtual address 00000578
......
[   20.738499] c0 3136 (Compiler) PC is at _raw_spin_lock_irqsave+0x24/0x60
[   20.738527] c0 3136 (Compiler) LR is at _raw_spin_lock_irqsave+0x20/0x60
[   20.740134] c0 3136 (Compiler) Call trace:
[   20.740165] c0 3136 (Compiler) [<ffffffc0008ee900>] _raw_spin_lock_irqsave+0x24/0x60
[   20.740200] c0 3136 (Compiler) [<ffffffc0000dd024>] __wake_up+0x1c/0x54
[   20.740230] c0 3136 (Compiler) [<ffffffc000639414>] mmc_wait_data_done+0x28/0x34
[   20.740262] c0 3136 (Compiler) [<ffffffc0006391a0>] mmc_request_done+0xa4/0x220
[   20.740314] c0 3136 (Compiler) [<ffffffc000656894>] sdhci_tasklet_finish+0xac/0x264
[   20.740352] c0 3136 (Compiler) [<ffffffc0000a2b58>] tasklet_action+0xa0/0x158
[   20.740382] c0 3136 (Compiler) [<ffffffc0000a2078>] __do_softirq+0x10c/0x2e4
[   20.740411] c0 3136 (Compiler) [<ffffffc0000a24bc>] irq_exit+0x8c/0xc0
[   20.740439] c0 3136 (Compiler) [<ffffffc00008489c>] handle_IRQ+0x48/0xac
[   20.740469] c0 3136 (Compiler) [<ffffffc000081428>] gic_handle_irq+0x38/0x7c
----------------------------------------------------------------------

Because in SMP, "mrq" has race condition between below two paths:
path1: CPU0: <tasklet context>
  static void mmc_wait_data_done(struct mmc_request *mrq)
  {
    mrq->host->context_info.is_done_rcv = true;
    //
    // If CPU0 has just finished "is_done_rcv = true" in path1, and at
    // this moment, IRQ or ICache line missing happens in CPU0.
    // What happens in CPU1 (path2)?
    //
    // If the mmcqd thread in CPU1(path2) hasn't entered to sleep mode:
    // path2 would have chance to break from wait_event_interruptible
    // in mmc_wait_for_data_req_done and continue to run for next
    // mmc_request (mmc_blk_rw_rq_prep).
    //
    // Within mmc_blk_rq_prep, mrq is cleared to 0.
    // If below line still gets host from "mrq" as the result of
    // compiler, the panic happens as we traced.
    wake_up_interruptible(&mrq->host->context_info.wait);
  }

path2: CPU1: <The mmcqd thread runs mmc_queue_thread>
 static int mmc_wait_for_data_req_done(...
 {
    ...
    while (1) {
          wait_event_interruptible(context_info->wait,
                  (context_info->is_done_rcv ||
                   context_info->is_new_req));

  static void mmc_blk_rw_rq_prep(...
  {
    ...
    memset(brq, 0, sizeof(struct mmc_blk_request));

This issue happens very coincidentally; however adding mdelay(1) in
mmc_wait_data_done as below could duplicate it easily.
  static void mmc_wait_data_done(struct mmc_request *mrq)
  {
    mrq->host->context_info.is_done_rcv = true;
    mdelay(1);
    wake_up_interruptible(&mrq->host->context_info.wait);
  }
At runtime, IRQ or ICache line missing may just happen at the same place
of the mdelay(1).

This patch gets the mmc_context_info at the beginning of function, it can
avoid this race condition.

Signed-off-by: Jialing Fu <jlfu@marvell.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: lintao <lintao@rock-chips.com>
2015-04-13 15:32:15 +08:00
zhangqing
409b9a9fe4 rk3368: clk: powerdomain: enable powerdomain func.
test:Passed the special test.Test machine 15 for P9 and test 12H.
	Have the test report form Quality department.

Signed-off-by: zhangqing <zhangqing@rock-chips.com>
2015-04-13 04:27:48 -07:00
hjc
9118760938 rk fb: do something when user set invalid config
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-13 11:15:03 +08:00
CMY
3186064dd9 rk: iommu: enable iommu by default on rk33xx platform
Signed-off-by: CMY <cmy@rock-chips.com>
2015-04-13 09:30:50 +08:00
lintao
db26b0def7 dts: rk3368: add mcu jtag pcl sd1 inactive state
Signed-off-by: lintao <lintao@rock-chips.com>
2015-04-13 09:22:52 +08:00
hjc
5de58df8a6 rk fb: set retire fence fd to -1 when ignore this frame
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-13 09:39:50 +08:00
Zheng Yang
33be0d0365 HDMI: calling rk_fb_switch_screen() to close vop related to HDMI
before calling switch_set_state() when HDMI is removed.
      For android hwcompser need to make sure vop is disabled when
      received hdmi removing event.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-11 17:33:19 +08:00
Aiyoujun
c04cdecff9 usb: ftp: fix the bug of ftp ioctrl args problem with 32bit userspace on 64bit platforms
Signed-off-by: Aiyoujun <ayj@rock-chips.com>
2015-04-11 16:14:20 +08:00
guoyi
c3ab142dc7 rk3368-p9: dts: enabled change ddr-freq 2015-04-11 16:40:46 +08:00
lyz
bd1b1fd8d6 usb: dwc_otg: fix bugs
1.Cancel usb vbus detect work in driver shutdown rountine
2.Check empty list
3.Disable usb interrupt before usb mode change

TEST:

1.reboot test
2.while true; do
    echo 1 > force_usb_mode;busybox sleep 5;
    echo 2 > force_usb_mode;busybox sleep 5;
  done

Signed-off-by: lyz <lyz@rock-chips.com>
2015-04-10 16:30:56 +08:00
Alpha Lin
f161a8f22b IEP: Support processing part of input image
Enable virtual size and actual size and start offset, to support
processing part of input image.

Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
2015-04-10 13:56:19 +08:00
Zheng Yang
2258ac9cca HDMI: call function hdmi->ops->disable() if it is disabled.
For system can not be wakeup under following case:
      step1. Disable HDMI.
      step2. set system to deep sleep mode.
      step3. remove HDMI connection.
      step4. wake up system.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-09 18:07:37 +08:00
hjc
474610f48c rk fb: when unplug hdmi,post fb to display
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-09 18:06:02 +08:00
hjc
bd0229c230 rk fb: hdmi 24hz frame time need 41ms
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-09 17:37:15 +08:00
hjc
e1ad97b825 rk fb: recovery need two framebuffer
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-09 16:26:57 +08:00
Tang Yun ping
860a4ab343 RK3368 DDR: add support 3368 ddr change freq function
note:need using new trustimage and uboot for support ddr change freq

Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2015-04-09 11:51:56 +08:00
smj
12bac32cc2 i2s:fix the hdmi no sound sometimes
support for hdmi passthrough output

Signed-off-by: smj  <smj@rock-chips.com>
2015-04-09 11:35:12 +08:00
hjc
a790322296 rk3368 lcdc: flush update regs worker when switch screen
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-09 11:55:03 +08:00
guoyi
7e6a7a6950 arm64: rockchip: rockchip_defconfig enabled rk818 & gt9xx & es8316 2015-04-09 11:14:05 +08:00
hjc
9ee1b26d4d rk fb: ignore frame when in hdmi switch or set error config
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-09 11:31:27 +08:00
hjc
336b5c3ebb rk3368 lcdc: reset lcdc when switch screen video mode
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-09 11:30:35 +08:00
Jianqun Xu
71fb032a4f ARM64: dt: rk3368: add driver support for rk818
Support rk818 pmic, patch is from zhangqing@rock-chips.com.

Signed-off-by: Zhangqing <zhangqing@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2015-04-09 10:13:14 +08:00
Zheng Yang
5dc14650f0 rk3368-box.dts: enable uboot logo.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-08 18:46:46 +08:00
huang zhibao
4457b5e860 dts:rk3368-box.dts default iommu 2015-04-08 16:22:27 +08:00
zxl
93691f7140 RK3368 GPU version: L0.12
1. Instead kmalloc to kzalloc.
2. Clear cleanup_sync in pvr_sync_clean_freelist.
2015-04-08 11:20:30 +08:00
xubilv
721f684bc0 rk3368:mipi: Solve clk_unprepare error problem when plug and pull out hdmi.
Signed-off-by: xubilv <xbl@rock-chips.com>
2015-04-07 18:45:26 +08:00
zhangqing
9f7e4c2ef6 rk3368: clk: clk_add_recalc_ddr_freq.
Get ddr frequency correctly.

Signed-off-by: zhangqing <zhangqing@rock-chips.com>
2015-04-03 06:54:08 -07:00
Aiyoujun
b511d18e50 mailbox: rockchip: add driver for Rockchip SoCs integrated mailbox && System Control and Power Interface(SCPI) protocol
Signed-off-by: Aiyoujun <ayj@rock-chips.com>
2015-04-02 18:26:51 +08:00
hjc
6219706cdb rk fb: from rk3368 fb only need to reserved 1 framebuffer
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-02 19:11:02 +08:00
hjc
6608228a9e delete unused file
Signed-off-by: hjc <hjc@rock-chips.com>
2015-04-02 18:56:31 +08:00
Zheng Yang
08cc20b019 HDMI: revert commit 3fe08a661c for
find root reason on commit 7f2f16780d.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-02 17:11:12 +08:00
Zheng Yang
e981d562c2 HDMI: improve cec function:
1. To get logic address more stable, we ping 3 times to each
	   logic address. If the result is NACK for two times, this
	   logic address is not occupied.
        2. If transmmit cec data failed, retry immediately.
        4. set CECOP_IMAGE_VIEW_ON only taget to TV, not broadcasting.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-02 17:00:23 +08:00
Zheng Yang
9e22aee0dd HDMI: fix edid mode list error: set head->prev to edid->modelist.
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2015-04-02 16:59:58 +08:00
Huang, Tao
a203a16126 Merge tag lsk-v3.10-15.03-android
lsk-v3.10-15.03-android release
2015-04-02 09:25:21 +08:00
Huang, Tao
6fb4a384a9 arm64: rockchip: rk3368 support boot from little core without swap
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2015-04-02 09:10:34 +08:00
Huang, Tao
95b72769e7 rm64: rockchip: rockchip_defconfig enable POWERVR_ROGUE
just for debug

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2015-04-02 09:10:34 +08:00
Huang, Tao
de2da66e82 arm64: rockchip: rockchip_defconfig disable reboot while panic
just for debug

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2015-04-02 09:10:34 +08:00
hwg
6229969239 modify wifi: load driver when kernel bootup:
can increase speed of wifi open/close
 can solve memory alloc fail when open wifi
2015-04-01 21:30:34 +08:00
lyz
1673f9b259 usb: gadget: MTP support compat ioctl 2015-04-01 16:04:27 +08:00
lyz
44a750dd53 usb: dwc_otg: fix usb otg force_device_mode
TEST: set rockchip,usb-mode = <2> in dts and then the usb works

Tested-by: huang zhibao <hzb@rock-chips.com>
Signed-off-by: lyz <lyz@rock-chips.com>
2015-04-01 10:28:44 +08:00
hjc
bb3979823e rk3368 lcdc: fix fps show error
Signed-off-by: hjc <hjc@rock-chips.com>
2015-03-31 15:20:10 +08:00
guoyi
4abf8b29e8 rk3368-p9: dts : add core&gpu dvfs table 2015-03-31 14:17:46 +08:00
David Wu
624fc16c68 rk3368: thermal: add suspend judeg
Signed-off-by: David Wu <wdc@rock-chips.com>
2015-03-31 12:07:04 +08:00
ywj
3a17db34cd mend debug info 2015-03-31 09:45:47 +08:00
guoyi
3af03af999 rk3368-p9 : dts: set vccio to 3.3V 2015-03-31 09:27:21 +08:00
hjc
3b0e2ca8fd rk3368 lcdc: update lcdc interface for mutile area check
Signed-off-by: hjc <hjc@rock-chips.com>
2015-03-31 09:40:56 +08:00
hjc
bce3bc61d1 rk fb: add consider vop full mutile area for vsync register check
Signed-off-by: hjc <hjc@rock-chips.com>
2015-03-31 09:40:55 +08:00
ywj
54912637db rk818 battery update:low power check and statu reg setting,uboot 2015-03-30 18:48:16 +08:00
guoyi
d495b998e2 rk3368-p9 : dts: enable dsihost0 2015-03-30 17:49:16 +08:00
guoyi
0b14e08dea rk3368-p9: dts: disabled vdd_arm when deep yxsuspend 2015-03-30 17:21:13 +08:00