Commit Graph

852081 Commits

Author SHA1 Message Date
Jianing Ren
f1b53c2ed2 usb: dwc3: gadget: fixed crash when unplugged usb cable
If the USB cable is unplugged when powered on or connected to PC,
it will cause the system to freeze. The final log is as follows:

[    5.109122] read descriptors
[    5.109180] read strings
[    5.113205] udc fe800000.dwc3: registering UDC driver [g1]

The crash is caused by visit registers of dwc3 when PD is off. the
function dwc3_gadget_set_speed is added in udc_bind_to_driver in
kernel 4.19 update. We need jump of this function when dwc3 is
suspended.

Change-Id: Ie0337aaf225543b4e9e05ee57a5eb7416797d56e
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-02-28 14:51:35 +08:00
Guochun Huang
404c1b21e0 drm/rockchip: upgrade initcall level of protect loader clocks
To avoid the potential parent PLL clock of display being
closed when PD is shutdown, excute protect loader clocks
earlier.

Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I5125590aac51b423e7e9fdc0032da9185c450be1
2020-02-28 14:34:35 +08:00
Simon Xue
7636d59e28 drm/rockchip: gem: add IOMMU_TLB_SHOT_ENTIRE when call iommu_map_sg
Add IOMMU_TLB_SHOT_ENTIRE prot for iommu_map_sg, this shoot down entire
iommu tlb one time after iommu_map_sg.This may save about 5ms when DRM
mapping 12MB buffer.

Change-Id: I618aff1b3928bd1ec1dd3d896db746e09e96acdc
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-02-28 14:25:36 +08:00
Simon Xue
5bb0884f84 iommu: rockchip: Introduce flush_iotlb_all to shoot entire tlb once
Change-Id: I1ef476fcde1b6d323dd2653dc01e27f9990cc6f5
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2020-02-28 14:25:26 +08:00
Wu Liangqing
18e0c32625 arm: rockchip_defconfig: enable CONFIG_ROCKCHIP_VENDOR_STORAGE_UPDATE_LOADER
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Change-Id: Ibdb149548d315ab924cca0d8ad89626d4617c86d
2020-02-27 15:04:45 +08:00
Wu Liangqing
c0f60bc7de arm64: rockchip_defconfig: enable CONFIG_ROCKCHIP_VENDOR_STORAGE_UPDATE_LOADER
Change-Id: Ia0329e9e7f3d22bb8799da87152f32ddc77f4605
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-02-27 15:04:45 +08:00
Mark Yao
09d07c8016 drm/drm-prime: cache dma_buf import context
This patch is used by android 8+ system on RK3368 SoCs.

When drm to free object, it needs map sg again when alloc it next
time. For RK3368 SoCs' system, one dma buffer may used by ion and
drm devices together, it spend time to map sg, this patch remove
the destroy object and do it after final dma_buf_put.

Change-Id: Ia39a3d4691f0b545039efb880c999a35886178a0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-27 14:54:19 +08:00
Mark Yao
3841912481 dma-buf: add release callback support
This patch is required by system on RK3368 SoCs.

Since its system used ion and drm drivers together, one dma-buf
may used by two devices, if one device deattached buffer, then
the other one need to map sg again, that takes time several ms.

The patch fix it by set buffer release operation in a list, and
do release after final dma_buf_put.

Change-Id: Ibfb4ffe3d97fae0a27f20032fdfbc3cc561aa375
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-27 14:46:53 +08:00
Cai YiWei
758a5b4ecb leds: add rgb13h led flash
Change-Id: Iafd7db5aa53ea70d9a6aa45f8270a3d3fd43bf4e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-02-27 14:41:33 +08:00
Cai YiWei
b88174b49a dt-bindings: leds: add leds-rgb13h
Change-Id: I0a32ba516ad8dab6fa6e72a81b6328c31ef61d0b
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-02-27 14:41:33 +08:00
Cai YiWei
e697e47ae1 media: i2c: add sgm3784 flash driver
Change-Id: I7ba480f5e76d98dcdd801c7ea7ab13173427f3ca
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-02-27 14:41:33 +08:00
Cai YiWei
e7debfa127 dt-bindings: media: i2c: add sgm3784
Change-Id: Ia7332e4737b104ef450aca572d642f0522fb5dd8
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-02-27 14:41:33 +08:00
Cai YiWei
b2a218ec91 media: rockchip: add led flash header
Change-Id: Ia7833a62b7b04f2f282f88b9bb2b79886f1e4c18
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-02-27 14:41:33 +08:00
Wyon Bi
ecd47ba5f3 drm/rockchip: lvds: Add missing configuration for rockchip_crtc_state
Change-Id: Id844c89db0623213c5751d438ff494130d604bab
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-02-27 14:40:50 +08:00
Wyon Bi
590bf4c3f4 drm/rockchip: dsi: Add missing configuration for rockchip_crtc_state
Change-Id: I8c5b4911f0f8832771f91a189a9e9ceea041c233
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-02-27 14:40:50 +08:00
Huang Jiachai
f894dd834d dma-buf/sw_sync: sw_sync register as misc devices
Because the kernel debug fs will removed from android 11, so we move
sw_sync to misc devices, as android lib sync has done the compatibility
work, so after this commit, the hwc there is no need to update.

Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
Change-Id: I799b66b1ba98c9370893b9554095664010b635df
2020-02-27 10:54:49 +08:00
Jianqun Xu
a3abe77603 ARM: dts: rockchip: fix rk3288-evb dtsi file
Change-Id: I042ee6c425eaf82c4d73e5a5c911011a9cd1d4d5
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-27 09:35:18 +08:00
Wu Liangqing
b20b529fc1 arm64: rockchip: px30: remove firmware_android and support ddr4 board
Change-Id: I3b73f79f47fc2b3f73cb04ddf76af4e7c055c12a
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-02-27 09:29:18 +08:00
Grey Li
d37bac146e video: rockchip: mpp: add lock when traverse mpp_dma_buffer list
Change-Id: I3002dfce5415b8aebd54bcf3e9617f428e7a196f
Signed-off-by: Grey Li <grey.li@rock-chips.com>
2020-02-26 17:52:59 +08:00
Wang Jie
3efe290bbf arm64: dts: rockchip: otg-port and vbus configure for rk3368 808 evb
Change-Id: I234ba606558ee247c8253705d87df9f37b15fc6e
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2020-02-25 17:58:58 +08:00
Jianqun Xu
83a3514692 ARM: dts: rockchip: rk3288 fix cpu opp table
Change-Id: If8831cb6b23c95d48b3f2f046f766e3f9f42dc2b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-25 16:46:43 +08:00
Al Viro
4b09c29ead UPSTREAM: vfs: fix do_last() regression
commit 6404674acd upstream.

Brown paperbag time: fetching ->i_uid/->i_mode really should've been
done from nd->inode.  I even suggested that, but the reason for that has
slipped through the cracks and I went for dir->d_inode instead - made
for more "obvious" patch.

Analysis:

 - at the entry into do_last() and all the way to step_into(): dir (aka
   nd->path.dentry) is known not to have been freed; so's nd->inode and
   it's equal to dir->d_inode unless we are already doomed to -ECHILD.
   inode of the file to get opened is not known.

 - after step_into(): inode of the file to get opened is known; dir
   might be pointing to freed memory/be negative/etc.

 - at the call of may_create_in_sticky(): guaranteed to be out of RCU
   mode; inode of the file to get opened is known and pinned; dir might
   be garbage.

The last was the reason for the original patch.  Except that at the
do_last() entry we can be in RCU mode and it is possible that
nd->path.dentry->d_inode has already changed under us.

In that case we are going to fail with -ECHILD, but we need to be
careful; nd->inode is pointing to valid struct inode and it's the same
as nd->path.dentry->d_inode in "won't fail with -ECHILD" case, so we
should use that.

Change-Id: I9aa97857bdf3944d67c47a45161465ec1055b41d
Reported-by: "Rantala, Tommi T. (Nokia - FI/Espoo)" <tommi.t.rantala@nokia.com>
Reported-by: syzbot+190005201ced78a74ad6@syzkaller.appspotmail.com
Wearing-brown-paperbag: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@kernel.org
Fixes: d0cb50185a ("do_last(): fetch directory ->i_mode and ->i_uid before it's too late")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 8d7a5100e2)
2020-02-25 16:28:26 +08:00
Wyon Bi
a9b97c9f5e drm/rockchip: analogix_dp: Add support for RK3368
Add eDP controller support for RK3368 SoC.
RK3368 eDP controller is similar to the RK3288.

Change-Id: I738ddf122776081cf41adef2921644ddfc6e07dd
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-02-25 15:42:03 +08:00
Wyon Bi
19d3ef2a43 phy/rockchip: dp: Protect the boot logo
Change-Id: Iee1366d77a0a4d046321b34efaa138d61317bc66
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-02-25 15:41:56 +08:00
Wyon Bi
36156156ae phy/rockchip: dp: Add support for RK3368
Add eDP PHY support for RK3368 SoC. RK3368 eDP PHY is similar to
the RK3288.

Change-Id: Ic2134ba719dadba121dc2fcc944662ef06b2ecfa
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-02-25 15:41:56 +08:00
Ding Wei
b7552b5738 arm64: dts: rockchip: rk3368: fix issue for vdpu_mmu and vepu_mmu
tips: vdpu_mmu and vepu_mmu have the same address, than it will double
map when probe. Thus, merge this to vpu_mmu to avoid it.

Change-Id: I0482e3c9a992aa93a1d28ed389ec3ef63ab4a6ee
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-02-25 15:39:15 +08:00
Ding Wei
d9f21d5208 video: rockchip: mpp: fix issue for ioremap the same register region
tips: In rk3368, hevc and vdpu use the same register region.
      However, devm_ioremap_resource will call function
      devm_request_mem_region to check region whether map.
      Thus, use devm_ioremap instead to avoid it.

Change-Id: I339b7d5a4e02e9f2304a9c40b146057e1ce13817
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-02-25 15:30:42 +08:00
Jianqun Xu
833c00e7b6 ARM: dts: rockchip: rk3288-evb add touchscreen node
Change-Id: If5c3f43d3fca7a0eaf3a772dd85b2ca471a01c1b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-25 15:17:02 +08:00
Jianqun Xu
2d57d60e72 ARM: dts: rockchip: rk3288 evb fix backligh node
Change-Id: Ic80cc027fb21ecee46270a6193614fdec1b3a4c8
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-25 15:14:59 +08:00
Jianqun Xu
211e767ef8 cpufreq: add rockchip,rk3288w to blacklist
Some rk3288 chips have been writen special efuse, and uboot will
overwrite the compatible of dtb from rk3288 to rk3288w.

For cpufreq platdev driver, needs to add rk3288w to blacklist to
aviod generic cpufreq-dt driver work.

Change-Id: Ib079647b0ca483c9fbb729a7f81514a0d6a9931b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-25 15:14:37 +08:00
Tao Huang
e4b4c26451 soc: rockchip: opp_select: Fix compilation warnings when !CONFIG_ROCKCHIP_OPP
include/soc/rockchip/rockchip_opp_select.h: In function 'rockchip_set_opp_prop_name':
include/soc/rockchip/rockchip_opp_select.h:83:9: warning: returning 'int' from a function with return type 'struct opp_table *' makes pointer from integer without a cast [-Wint-conversion]

Change-Id: Id8c0fc331bcece33692ddde2084a7e8d3142bd94
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-02-25 09:27:02 +08:00
Tao Huang
0377fad75a video: rockchip: rga2: Fix compilation when !CONFIG_HIGHMEM
drivers/video/rockchip/rga2/rga2_mmu_info.c: In function 'rga2_dma_flush_page':
drivers/video/rockchip/rga2/rga2_mmu_info.c:69:11: error: implicit declaration of function 'kmap_high_get' [-Werror=implicit-function-declaration]

Change-Id: If389e8b1e61c1dcdffb94eb27d12e612a663193c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-02-25 09:25:34 +08:00
Tao Huang
7fa45d5091 soc: rockchip: system_monitor: Fix compilation when !CONFIG_ROCKCHIP_SYSTEM_MONITOR
Change-Id: Ib7270b6bf9971ef501dd79b87a484af5e0304dec
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-02-24 17:48:18 +08:00
Arnd Bergmann
1a0f1ce0a1 UPSTREAM: mfd: rk808: Mark pm functions __maybe_unused
The newly added suspend/resume functions are only used if CONFIG_PM
is enabled:

drivers/mfd/rk808.c:752:12: error: 'rk8xx_resume' defined but not used [-Werror=unused-function]
drivers/mfd/rk808.c:732:12: error: 'rk8xx_suspend' defined but not used [-Werror=unused-function]

Mark them as __maybe_unused so the compiler can silently drop them
when they are not needed.

Change-Id: I3db25d369f04883988fd934e11e26126de8cc6a4
Fixes: 586c1b4125 ("mfd: rk808: Add RK817 and RK809 support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 5752bc4373)
2020-02-24 17:44:58 +08:00
Liang Chen
eac9158067 cpufreq: interactive: fix: slack timer may resched after governor stop
cpufreq_interactive_idle_end() will hold icpu->enable_sem lock and resched
the slack timer. But cpufreq_interactive_stop() delete slack timer without
lock, then the timer may resched, it will case timer BUG as below, so
hold icpu->enable_sem when delete slack timer.

[21728.659718] kernel BUG at kernel/time/timer.c:1154!
[21728.659731] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[21728.661019] Modules linked in: bcmdhd
[21728.661354] Process cpuhp/3 (pid: 26, stack limit = 0x0000000053b86a60)
[21728.661936] CPU: 3 PID: 26 Comm: cpuhp/3 Not tainted 4.19.80 #74
[21728.662461] Hardware name: Rockchip RK3328 EVB avb (DT)
[21728.662922] pstate: 20400085 (nzCv daIf +PAN -UAO)
[21728.663355] pc : add_timer_on+0x1f8/0x200
[21728.663724] lr : slack_timer_resched+0x9c/0xf8
[21728.766258] Call trace:
[21728.766491]  add_timer_on+0x1f8/0x200
[21728.766823]  slack_timer_resched+0x9c/0xf8
[21728.767196]  cpufreq_interactive_start+0xa8/0x140
[21728.767615]  cpufreq_start_governor+0x4c/0x98
[21728.767999]  cpufreq_offline+0x140/0x218
[21728.768350]  cpuhp_cpufreq_offline+0xc/0x18
[21728.768725]  cpuhp_invoke_callback+0x98/0x770
[21728.769120]  cpuhp_thread_fun+0xd0/0x158
[21728.769471]  smpboot_thread_fn+0x200/0x2a0
[21728.769834]  kthread+0xfc/0x128
[21728.770119]  ret_from_fork+0x10/0x18

Fixes: 5a581cc47a ("RFC: FROMLIST: cpufreq: Add android's 'interactive' governor")
Change-Id: If2771305eb9489c175f5bca4c7be8fa0d8f87b84
Signed-off-by: Liang Chen <cl@rock-chips.com>
2020-02-24 16:50:33 +08:00
Wang Panzhenzhuan
b1a495135b media: i2c: vcm drivers synchronize with kernel 4.4
vcm drivers synchronize with kernel 4.4 & fix compile error

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I7c3650867f0f3c867790dfe017bd89ac6067c2a4
2020-02-24 15:25:51 +08:00
Sandy Huang
a50d5ff77b drm/rockchip: edp: init crtc state from edp
Change-Id: I8ffc3b06b057c91675fc256ccc0866d9721a0b16
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-02-24 15:22:36 +08:00
Sandy Huang
16438cbdd6 ARM: dts: rockchip: fix rk3288 edp panel
Change-Id: I5c7852293c2573f65a86bb4eaaf18f7dc00a4afa
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-02-24 15:22:14 +08:00
Andy Yan
8076fbffea net: can: add rockchip CAN driver
Change-Id: I985eb81f4e06c085be66d2db2cd5c879bda0dd69
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-02-24 10:09:28 +08:00
Elaine Zhang
4d2ad93b5c dt-bindings: can: rockchip_can: add can support for rockchip
This patch add the rockchip can to the device tree bindings
documentation.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I7a15174dda4a6eec6196fca5e2c386a7844b70ee
2020-02-24 10:07:22 +08:00
Jianqun Xu
5d41244299 ARM: dts: rockchip: fix rk3288 dts files
Change-Id: I7d4233dee5ee81166e666f1663793b09e15f5970
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-02-21 18:29:44 +08:00
Ding Wei
372091ab47 arm64: dts: rockchip: rk3368: match new video driver mpp_serivce
Change-Id: I4bfacb3910f5fed42b8fe8f78f7997f0e650e6e9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-02-21 18:02:44 +08:00
Sandy Huang
cf2111c9fe drm/rockchip: fix drm mm operation conflict
the mm operation for logo memory will conflict with userspace
memory operation, so we add mm_lock to guaranteed no conflict.

Change-Id: If02310e3a9e48478124201edd94af38dd900944a
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-02-21 15:31:35 +08:00
Sandy Huang
581c39f3ed drm/rockchip: rgb: Add support srgb and srgb dummy mode
Change-Id: Ie5942b90dccec5cec74d1f1f2cbef835d95bdfd9
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-02-20 14:59:47 +08:00
Wyon Bi
dae8349425 drm/rockchip: lvds: avoid PLL unlock error
We need to enable lvds mode before calling phy_power_on.

Change-Id: I38625c44998bde81bb4c98b70b8be5995d64b477
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2020-02-20 11:32:33 +08:00
Zorro Liu
9d02fc38eb arm64: dts: rockchip: add gpio key and adc key config for rk3368-808 board
Change-Id: I5bc50d63eaddc268b296afce165343f558d43498
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2020-02-20 11:16:16 +08:00
Jianqun Xu
32364c4431 staging: android: add ion_legency driver
Add legency ion driver support, and rockchip ion driver
only(default) used by the legency ion.

Change-Id: I428d856e96033004943ee024e8d280f3e96753a1
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-20 09:52:49 +08:00
Jianqun Xu
1d8f622667 arm64: configs: rockchip_defconfig select ION_LEGENCY
Change-Id: I64663f9b838afeb66e0747c9660836796be1d424
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-02-20 09:50:56 +08:00
Li Huang
b5773585ef dma-buf/sw_sync: Remove staic of sync_timeline_signal
Change-Id: Ie75f872afb41da5f5f8ad233828e939299a406a9
Signed-off-by: Li Huang <putin.li@rock-chips.com>
2020-02-20 09:14:15 +08:00
Tao Huang
94c42cd8e3 dma-buf/sync-file: Introduce sync_file_get and sync_file_put
For RK3368 Imagination PowerVR GPU driver.

Change-Id: I38f439801ee45212b18a619f1d8652d065e84434
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-02-20 09:00:33 +08:00