Commit Graph

1065508 Commits

Author SHA1 Message Date
Gao Xiang
b943d32888 UPSTREAM: erofs: fix unsafe pagevec reuse of hooked pclusters
There are pclusters in runtime marked with Z_EROFS_PCLUSTER_TAIL
before actual I/O submission. Thus, the decompression chain can be
extended if the following pcluster chain hooks such tail pcluster.

As the related comment mentioned, if some page is made of a hooked
pcluster and another followed pcluster, it can be reused for in-place
I/O (since I/O should be submitted anyway):
 _______________________________________________________________
|  tail (partial) page |          head (partial) page           |
|_____PRIMARY_HOOKED___|____________PRIMARY_FOLLOWED____________|

However, it's by no means safe to reuse as pagevec since if such
PRIMARY_HOOKED pclusters finally move into bypass chain without I/O
submission. It's somewhat hard to reproduce with LZ4 and I just found
it (general protection fault) by ro_fsstressing a LZMA image for long
time.

I'm going to actively clean up related code together with multi-page
folio adaption in the next few months. Let's address it directly for
easier backporting for now.

Call trace for reference:
  z_erofs_decompress_pcluster+0x10a/0x8a0 [erofs]
  z_erofs_decompress_queue.isra.36+0x3c/0x60 [erofs]
  z_erofs_runqueue+0x5f3/0x840 [erofs]
  z_erofs_readahead+0x1e8/0x320 [erofs]
  read_pages+0x91/0x270
  page_cache_ra_unbounded+0x18b/0x240
  filemap_get_pages+0x10a/0x5f0
  filemap_read+0xa9/0x330
  new_sync_read+0x11b/0x1a0
  vfs_read+0xf1/0x190

Link: https://lore.kernel.org/r/20211103182006.4040-1-xiang@kernel.org
Fixes: 3883a79abd ("staging: erofs: introduce VLE decompression support")
Cc: <stable@vger.kernel.org> # 4.19+
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Bug: 206904737
Change-Id: Ib34644bf29f3f6dc0369cc51869c8b259f8d0f0a
(cherry picked from commit 86432a6dca)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-11-30 23:37:10 +00:00
Yue Hu
028f7128c4 UPSTREAM: erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
No any behavior to variable occupied in z_erofs_attach_page() which
is only caller to z_erofs_pagevec_enqueue().

Link: https://lore.kernel.org/r/20210419102623.2015-1-zbestahu@gmail.com
Signed-off-by: Yue Hu <huyue2@yulong.com>
Reviewed-by: Gao Xiang <xiang@kernel.org>
Signed-off-by: Gao Xiang <xiang@kernel.org>

Bug: 206904737
Change-Id: I37f5496d89befe7550b63024b1ead4ce531a22a8
(cherry picked from commit 7dea3de7d3)
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
2021-11-30 23:37:04 +00:00
Albert Wang
504b13fb83 UPSTREAM: usb: dwc3: gadget: Fix null pointer exception
[ Upstream commit 2628844812 ]

In the endpoint interrupt functions
dwc3_gadget_endpoint_transfer_in_progress() and
dwc3_gadget_endpoint_trbs_complete() will dereference the endpoint
descriptor. But it could be cleared in __dwc3_gadget_ep_disable()
when accessory disconnected. So we need to check whether it is null
or not before dereferencing it.

Bug: 202829886
Bug: 204052921
Fixes: f09ddcfcb8 ("usb: dwc3: gadget: Prevent EP queuing while stopping transfers")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: Albert Wang <albertccwang@google.com>
Link: https://lore.kernel.org/r/20211109092642.3507692-1-albertccwang@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I767f61f3c8840b7854a467ab6bf18c26c89757c2
Signed-off-by: Albert Wang <albertccwang@google.com>
2021-11-30 21:26:59 +00:00
Eric Biggers
143ac63130 ANDROID: fips140: support "evaluation testing" builds via build.sh
Allow the following command to be run to make a build of fips140.ko
that has CONFIG_CRYPTO_FIPS140_MOD_EVAL_TESTING enabled:

    BUILD_CONFIG=common/build.config.gki.aarch64.fips140_eval_testing ./build/build.sh

Bug: 188620248
Change-Id: I0e0be487974c6ad40f3135fc5fec6aa107aab78c
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-11-30 17:55:05 +00:00
Zefa Chen
f1d87b2a3d media: i2c: ov50c40 change pdaf otp data align to big endian
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I75a099e14c74adb7df13ff5971c702fb3537a4ce
2021-11-30 21:12:37 +08:00
Zefa Chen
1b717058b0 media: i2c: ov50c40 support get spd data type
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I3debaf964b00b0ba8cc4545de1a9e81862d93dd7
2021-11-30 21:02:41 +08:00
Zefa Chen
f7b8afb8b4 include: uapi: rk-camera-module.h: struct channel_info add data type
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I64ca7e16e0048c88938ce4cc77e96c81d14b7601
2021-11-30 21:02:19 +08:00
Elaine Zhang
5119ab44df arm64: dts: rockchip: rk3588: Change the clk link registration sequence
Reduces clock registration time

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I9ff4218e23fe9dde42f7345fc0e4bcd6f42c5d73
2021-11-30 21:01:05 +08:00
Mark Huang
a8d82cff69 arm64: dts: rockchip: rk3588-nvr-demo: enable hdmi1 in vop0 and vop2
Signed-off-by: Mark Huang <huangjc@rock-chips.com>
Change-Id: If5e9452505ccf9d97b81f7ab2b41604d931e2a03
2021-11-30 20:36:20 +08:00
Algea Cao
6680da5e1f drm/rockchip: dw_hdmi: Fix hdmitx0 hpd irq mute by hdmitx1 driver
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ia4b4c977208f925c0f2c2fe6e763f3cd7ecc9db9
2021-11-30 19:40:05 +08:00
Jiajian Wu
d34e75ac1e drm/bridge: synopsys: Add hook_plugged_cb for dw-hdmi-qp reporting connector status
Signed-off-by: Jiajian Wu <jair.wu@rock-chips.com>
Change-Id: I3103df9f379dfe98a4eb54dc5d3ce9f407038d8c
2021-11-30 18:37:26 +08:00
Andy Yan
1966a3328a drm/rockchip: vop2: Report max_input of window as 4096x4320
Make hwc work correct when handle a 8K input source

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I77ee3c13f5c884fbdd9eec72b02998e10bbc3425
2021-11-30 18:37:19 +08:00
Shunqian Zheng
6953760a2a arm64: rockchip_linux_defconfig: enable imx415
IMX415 is supposed to be the default sensor on rk3588 evb boards.

Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Change-Id: I4b2ea0f57c2510d46ea5c0b3416d536a2e7bc898
2021-11-30 18:32:14 +08:00
Cai YiWei
f5b1a62925 media: rockchip: isp: dynamic memory alloc for params and stats function
Change-Id: Iecc3391295e264ac6569c2ace257a023bfa3ed9e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-11-30 18:31:11 +08:00
Wang Jie
5869a2d49e arm64: dts: rockchip: rk3588s-tablet: fix Type-C0 vbus issue
Just as the commit 25e44a6ed98b("bq25700: register otg vbus regulator")
said that there will be some problems with the current vbus control,
and the patch has registered the otg vbus regulator in the charger ic
driver, then the otg vbus regulator can be referenced in the fusb302 node.

Change-Id: Id4c9f866a3d131eee6f732300ff642a7f5489672
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2021-11-30 18:27:12 +08:00
Frank Wang
7790a659ae phy: rockchip: usbdp: tuning ssc modulation rate
Set SSC Modulation rate to 31.2 KHz that can pass the compliance test
and have a better margin.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Iaf82e4803a9ccb196d21d9a02a93293be0dd053e
2021-11-30 18:23:23 +08:00
Mark Rutland
cbd64e25c2 FROMGIT: sched/scs: Reset task stack state in bringup_cpu()
To hot unplug a CPU, the idle task on that CPU calls a few layers of C
code before finally leaving the kernel. When KASAN is in use, poisoned
shadow is left around for each of the active stack frames, and when
shadow call stacks are in use. When shadow call stacks (SCS) are in use
the task's saved SCS SP is left pointing at an arbitrary point within
the task's shadow call stack.

When a CPU is offlined than onlined back into the kernel, this stale
state can adversely affect execution. Stale KASAN shadow can alias new
stackframes and result in bogus KASAN warnings. A stale SCS SP is
effectively a memory leak, and prevents a portion of the shadow call
stack being used. Across a number of hotplug cycles the idle task's
entire shadow call stack can become unusable.

We previously fixed the KASAN issue in commit:

  e1b77c9298 ("sched/kasan: remove stale KASAN poison after hotplug")

... by removing any stale KASAN stack poison immediately prior to
onlining a CPU.

Subsequently in commit:

  f1a0a376ca ("sched/core: Initialize the idle task with preemption disabled")

... the refactoring left the KASAN and SCS cleanup in one-time idle
thread initialization code rather than something invoked prior to each
CPU being onlined, breaking both as above.

We fixed SCS (but not KASAN) in commit:

  63acd42c0d ("sched/scs: Reset the shadow stack when idle_task_exit")

... but as this runs in the context of the idle task being offlined it's
potentially fragile.

To fix these consistently and more robustly, reset the SCS SP and KASAN
shadow of a CPU's idle task immediately before we online that CPU in
bringup_cpu(). This ensures the idle task always has a consistent state
when it is running, and removes the need to so so when exiting an idle
task.

Whenever any thread is created, dup_task_struct() will give the task a
stack which is free of KASAN shadow, and initialize the task's SCS SP,
so there's no need to specially initialize either for idle thread within
init_idle(), as this was only necessary to handle hotplug cycles.

I've tested this on arm64 with:

* gcc 11.1.0, defconfig +KASAN_INLINE, KASAN_STACK
* clang 12.0.0, defconfig +KASAN_INLINE, KASAN_STACK, SHADOW_CALL_STACK

... offlining and onlining CPUS with:

| while true; do
|   for C in /sys/devices/system/cpu/cpu*/online; do
|     echo 0 > $C;
|     echo 1 > $C;
|   done
| done

Fixes: f1a0a376ca ("sched/core: Initialize the idle task with preemption disabled")
Reported-by: Qian Cai <quic_qiancai@quicinc.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Qian Cai <quic_qiancai@quicinc.com>
Link: https://lore.kernel.org/lkml/20211115113310.35693-1-mark.rutland@arm.com/

Bug: 207346964
(cherry picked from commit dce1ca0525
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/urgent)
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
Change-Id: Ia2db6477afddcc01fae00c6eb925fb3ec2791130
2021-11-30 10:19:53 +00:00
Cai YiWei
5dc6645028 media: rockchip: isp: fix bay3d mi no update
Change-Id: I44cdb1fa3bbfcde374ce6747a3b5825b22373c10
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-11-30 17:24:12 +08:00
Wyon Bi
8d3c3e5d41 drm/rockchip: dw-dp: Improve link maintenance
- Only check link retrain in short hpd pulse
- Always do link train in modeset
- Fix link retrain condition
- Add sink count check

Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Ifed1d706dcda5ac79322271ec59c2f1a5a79262b
2021-11-30 15:58:44 +08:00
Wang Jie
25e44a6ed9 power: supply: bq25700: register otg vbus regulator
For Type-C PD driver using the tcpm framework and charger ic
(bq25700) output otg vbus solution. Because the dwc3 driver
cannot know whether the Type-C PD device sends DR_swap and
PR_swap messages, there are some problems with the charger ic
vbus control:
(1) rk3588s as sink, Type-C device sends DR_swap Message, u2phy driver
    will send enable otg vbus notification to charger ic driver;
(2) After the Type-C device sends PR_swap Message to realize the
    Sink->Source or Source->Sink switch, the charge ic driver cannot
    dynamically enable or disable the otg vbus;

Based on the above problems, an otg vbus regulator is registered in
the charge ic driver for use by the fusb302 (Type-C PD controller chip)
driver, the otg vbus control is transferred to the tcpm framework.

In some cases (for example, the hardware does not have a PD chip),
in order to be compatible with switching from a lower version kernel
(kenrel-4.4/4.19) to a higher version kernel(kernel-5.10), dts will not
be modified. the software registration of the otg vbus regulator fails,
the vbus extcon mechanism will be registered.

Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: I721abcb214795c0024e200b10ec3ab1d4a9b790a
2021-11-30 10:59:45 +08:00
Algea Cao
1d2c231dcc arm64: dts: rockchip: Enable hdmitx1 for rk3588 boards
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I4adeeffcd19dd841bcb179f645e811fd9bb64f42
2021-11-30 09:45:40 +08:00
xieliujie
3ed40fb65a ANDROID: dma-buf: heaps: fix dma-buf heap pool pages stat
this critical region should be protected by pool->mutex.

Bug: 207658347
Fixes: e7dac4c323 ("ANDROID: dma-buf: heaps: Add a shrinker controlled page pool")
Signed-off-by: liuhailong <liuhailong@oppo.com>
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I6f129926c96176258a965964c24602fc647db61e
2021-11-29 23:48:28 +00:00
Tao Huang
4fb351ca18 arm64: dts: rockchip: Rename rk3588-rk806-daul.dtsi to rk3588-rk806-dual.dtsi
Fixes: 7534ec9a51 ("arm64: dts: rockchip: rk806: bind the rk806 to the rk3588")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I01cd29ea965fc3a03e68a02f1a6a18ad5c44a73c
2021-11-29 20:40:02 +08:00
Algea Cao
92bdbf29ec drm/rockchip: dw_hdmi: Fix crash when rk3588 hdmitx1 hotplug
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ia75e8cd7ce6f5862f0ae321d9d9265363f2cb533
2021-11-29 20:25:56 +08:00
Wangqiang Guo
31d4d991b7 power: supply: modify bq25703 input voltage calculate
Signed-off-by: Wangqiang Guo <kay.guo@rock-chips.com>
Change-Id: Ie7c257b993b59b1a6c9fafa340d1c351e94c72ba
2021-11-29 19:36:12 +08:00
David Wu
3e76ff28cd net: ethernet: stmmac: Fix loopback at dwmac-ethtool for rk3588
slove following issues:
 - socket buffer is over;
 - store phyaddr;
 - get max delayline value for rk3588;
 - split mac setting and phy setting for loopback to fix flow;
 - add rgmii-rxid interface loopback;
 - enable mtl configuration for multi queue;
 - use phy softreset instead of hard reset.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I8da5a42948b34bf4a256a6f425c0ed98590ddea6
2021-11-29 19:17:12 +08:00
Wyon Bi
2db29d7f51 arm64: dts: rockchip: Remove assigned-clocks from vop node for rk3588 boards
Change-Id: I20d568eb199d34380a4b776742f111adcc3c35b3
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-11-29 18:49:17 +08:00
Wyon Bi
04ae4b0627 arm64: dts: rockchip: rk3588s: assign clock parents for dclk_vop2_src
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I31fb7d3af20479cbfe0f00169be30d56bfaa46ed
2021-11-29 18:48:11 +08:00
Wyon Bi
afd6026f71 drm/rockchip: vop2: Support set clock defaults for vp node
Parse and set assigned clocks configuration at the child node level.

Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I745090ebc2a3531c51557600fdb69867d7216684
2021-11-29 18:48:06 +08:00
Cai YiWei
8510082f3b media: rockchip: isp: fix rawawb with rawlsc no stats
Change-Id: Iccf0745e96532097b7ee8741e0cc9f6e5c4c8a4f
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-11-29 18:38:57 +08:00
Elaine Zhang
dbd5f33301 clk: rockchip: rk3588: Change the clk registration sequence
Reduces clock registration time

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I9ee110dde6cfcae13fbec6604567c930b709d34b
2021-11-29 18:05:42 +08:00
Ding Wei
3b0208b0c2 video: rockchip: mpp: Fix hand writing error
Change-Id: Ie385fd808f667a09396c7280851ba27937f85343
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2021-11-29 16:47:31 +08:00
Andy Yan
dfcff113be drm/rockchip: vop2: Fix a left_src_w calc error in splice mode
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I8900bfd1018dfcd5b47d857007a1d888dbe6c039
2021-11-29 16:26:16 +08:00
ZiHan Huang
dcbe6022af arm64: dts: rockchip: add rk3588-evb1-lp4-v10-6x-linux.dts
rk3588 evb1 add six camera config of imx464

Signed-off-by: ZiHan Huang <zack.huang@rock-chips.com>
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I4adc4a7f9f8f04fad23d9cacf03d7fef48990f53
2021-11-29 16:24:48 +08:00
Cai YiWei
5b28972d97 media: rockchip: isp: fix fbc stop iommu page fault for isp30
Change-Id: I422e99c289c74b14525a21a198d37bbea8337eec
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-11-29 16:06:42 +08:00
Zheng Yang
ca885383eb drm/rockchip: dw-dp: support dynamic binding to different vp port
According to the application scenario, DP0/DP1 may be bind to the
same vp port, or different vp port. The corresponding bit in output_if
needs to be set or cleared correctly.

Change-Id: I880946d0c61a209d5a16ff7d2aada43f87a075c5
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2021-11-29 16:05:47 +08:00
Tao Huang
18a6cae4bb rk: scripts/mkimg: Support Create U-Boot FIT Image use ${BOOT_ITS}
Change-Id: Id878ebf13606f1be324b11d89cb803ec9ed6c209
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-11-29 15:17:46 +08:00
Jianqun Xu
146b4dc1de dma-buf: dma-heap set device max_segment_size to DMA_BIT_MASK(32)
With CONFIG_DMA_API_DEBUG_SG enabled built:

[   14.668444][  T369] ------------[ cut here ]------------
[   14.668476][  T369] DMA-API: dma_heap system-uncached: mapping sg segment longer than device claims to support [len=1048576] [max=65536]
[   14.668508][  T369] WARNING: CPU: 1 PID: 369 at kernel/dma/debug.c:1173 debug_dma_map_sg+0x1d4/0x3f8
[   14.668517][  T369] Modules linked in:
[   14.668533][  T369] CPU: 1 PID: 369 Comm: HwBinder:364_2 Not tainted 5.10.43 #53
[   14.668542][  T369] Hardware name: Rockchip RK3588 EVB2 LP4 V10 Board (DT)
[   14.668553][  T369] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[   14.668564][  T369] pc : debug_dma_map_sg+0x1d4/0x3f8
[   14.668574][  T369] lr : debug_dma_map_sg+0x1d4/0x3f8
[   14.668582][  T369] sp : ffffffc015cb3a90
[   14.668591][  T369] x29: ffffffc015cb3ab0 x28: ffffff8003557000
[   14.668605][  T369] x27: 0000000000000011 x26: 0000000000010000
[   14.668619][  T369] x25: ffffffffffffffff x24: ffffffc015cb3c90
[   14.668632][  T369] x23: ffffff80057fec00 x22: ffffff80055c1c00
[   14.668646][  T369] x21: ffffffc011fbf000 x20: 0000000000000011
[   14.668660][  T369] x19: ffffffc011dd9000 x18: ffffffc015ce5050
[   14.668673][  T369] x17: 0000000000000000 x16: 00000000000000d8
[   14.668686][  T369] x15: 0000000000000004 x14: 0000000000003fff
[   14.668699][  T369] x13: ffffffc011e5c9e8 x12: 0000000000000003
[   14.668712][  T369] x11: 00000000ffffbfff x10: 00000000ffffffff
[   14.668725][  T369] x9 : 20e580535cacc400 x8 : 20e580535cacc400
[   14.668738][  T369] x7 : 3d6e656c5b207472 x6 : ffffffc01205b610
[   14.668751][  T369] x5 : ffffffffffffffff x4 : 0000000000000000
[   14.668765][  T369] x3 : ffffffc011b27378 x2 : 0000000000000000
[   14.668777][  T369] x1 : 0000000000000001 x0 : 0000000000000074
[   14.668791][  T369] Call trace:
[   14.668802][  T369]  debug_dma_map_sg+0x1d4/0x3f8
[   14.668814][  T369]  dma_map_sg_attrs+0x7c/0xcc
[   14.668828][  T369]  system_heap_do_allocate+0x78c/0x7d4
[   14.668839][  T369]  system_uncached_heap_allocate+0x18/0x28
[   14.668850][  T369]  dma_heap_ioctl+0x140/0x1f0
[   14.668862][  T369]  __arm64_sys_ioctl+0x94/0xd0
[   14.668875][  T369]  el0_svc_common+0xa4/0x180
[   14.668885][  T369]  do_el0_svc+0x28/0x88
[   14.668897][  T369]  el0_svc+0x14/0x24
[   14.668906][  T369]  el0_sync_handler+0x88/0xec
[   14.668917][  T369]  el0_sync+0x1a8/0x1c0
[   14.668925][  T369] ---[ end trace acb8f73633a08943 ]---

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I551ae9da257c1337e857de8a21931594f8d25d3c
2021-11-29 15:13:17 +08:00
Alex Wang
abf624145e arm64: dts: rockchip: add rk3588-nvr-demo-v10-android dts
Change-Id: I02b79559265d714c49292029a02ee83de0be1136
Signed-off-by: Alex Wang <alex.wang@rock-chips.com>
2021-11-29 12:01:48 +08:00
Wangqiang Guo
fbf26729da arm64: dts: rockchip: Modify battery curve for rk3588s tablet
Signed-off-by: Wangqiang Guo <kay.guo@rock-chips.com>
Change-Id: I7d4696eef302b59e633430b4347a17bead62751b
2021-11-29 12:00:03 +08:00
William Wu
17e122ec97 arm64: dts: rockchip: rk3588-nvr-demo: remove hs limit for usb3_0
Because the usb3_0 super-speed phy driver is ready, let's
remove the maximum-speed limit for usb3_0 on nvr demo board.
Add also enable the usbdp_phy1_u3 to force usb3_1 to u2 only.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: If8835a667ad9e561d0291130b8fd1fbbe0fc6206
2021-11-29 11:57:26 +08:00
Wyon Bi
ffd1c1b1d6 drm/rockchip: dw-dp: Register aux channel
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I3bd76c5ba249901179d56db29661ef195839ae3a
2021-11-29 11:56:52 +08:00
Wyon Bi
307b981a4e arm64: configs: rockchip_defconfig: Enable CONFIG_DRM_DP_AUX_CHARDEV
DPCD read:
dd if=/dev/drm_dp_aux0 bs=1 skip=$((0x200)) count=1 status=none | od -tx1

DPCD write:
echo -e -n "\x80" | dd of=/dev/drm_dp_aux0 bs=1 seek=$((0x10a)) count=1 status=none

Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I2a81b94b466d0e77b8608ea55e5ff91d18931956
2021-11-29 11:53:14 +08:00
Cai YiWei
bc6d4938a4 media: rockchip: isp: fix bigmode for multi device
Change-Id: I5debe62ea15fa8d5f01931aea643f2c982c57f6b
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-11-29 10:44:19 +08:00
Andy Yan
edf7edcdee drm/rockchip: vop2: Check PMU_BISR_STATUS register for pd status when bisr enabled
We should check PMU_BISR_STATUS register for
pd on/off status when bisr memory repair is
enabled.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: If1d0927551ddea9757c70b3a948367132a83ed5c
2021-11-29 10:35:44 +08:00
Zhang Yubing
a1663d7e8a phy: rockchip: usbdp: Fix aux channel polarity setting
It's too late to set the aux channel polarity. Some
sink device will not  send attention cmd to indicate
hpd plug event. Setting the aux channel polarity earlier.
When detecting the connected status is disconnected,
Setting the gpio status to low.

Fixes: 8081c70a82: ("phy: rockchip: usbdp-phy: add pointer check, avoid NULL pointer")
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Ie653a043f9d3cecf489846d7edbd6eca73f5ee28
2021-11-27 16:56:15 +08:00
Wyon Bi
e3093cade8 drm/rockchip: dw-dp: Check hpd status before power down link
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I3a05b3520d71ef5f0429a2c33933db62f3a2fffc
2021-11-27 11:07:47 +08:00
Jindong Yue
851990cc99 ANDROID: ABI: Add several spi_mem related symbols
Add several spi_mem related symbols required by
spi-nxp-fspi.ko and spi-nor.ko

Leaf changes summary: 11 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 11 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

11 Added functions:

  [A] 'function spi_mem_dirmap_desc* devm_spi_mem_dirmap_create(device*, spi_mem*, const spi_mem_dirmap_info*)'
  [A] 'function int spi_mem_adjust_op_size(spi_mem*, spi_mem_op*)'
  [A] 'function bool spi_mem_default_supports_op(spi_mem*, const spi_mem_op*)'
  [A] 'function ssize_t spi_mem_dirmap_read(spi_mem_dirmap_desc*, u64, size_t, void*)'
  [A] 'function ssize_t spi_mem_dirmap_write(spi_mem_dirmap_desc*, u64, size_t, void*)'
  [A] 'function int spi_mem_driver_register_with_owner(spi_mem_driver*, module*)'
  [A] 'function void spi_mem_driver_unregister(spi_mem_driver*)'
  [A] 'function bool spi_mem_dtr_supports_op(spi_mem*, const spi_mem_op*)'
  [A] 'function int spi_mem_exec_op(spi_mem*, const spi_mem_op*)'
  [A] 'function const char* spi_mem_get_name(spi_mem*)'
  [A] 'function bool spi_mem_supports_op(spi_mem*, const spi_mem_op*)'

Bug: 207737303
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: I6637737f5076cb87fe2180680fd5a3e507b10bc6
2021-11-26 21:43:45 +08:00
Pratyush Yadav
be30f0ce33 UPSTREAM: spi: spi-mem: add spi_mem_dtr_supports_op()
spi_mem_default_supports_op() rejects DTR ops by default to ensure that
the controller drivers that haven't been updated with DTR support
continue to reject them. It also makes sure that controllers that don't
support DTR mode at all (which is most of them at the moment) also
reject them.

This means that controller drivers that want to support DTR mode can't
use spi_mem_default_supports_op(). Driver authors have to roll their own
supports_op() function and mimic the buswidth checks. See
spi-cadence-quadspi.c for example. Or even worse, driver authors might
skip it completely or get it wrong.

Add spi_mem_dtr_supports_op(). It provides a basic sanity check for DTR
ops and performs the buswidth requirement check. Move the logic for
checking buswidth in spi_mem_default_supports_op() to a separate
function so the logic is not repeated twice.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20210204141218.32229-1-p.yadav@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 207737303
(cherry picked from commit 539cf68cd5)
Change-Id: Iaa3951c2e3f51f265b9bea583a3c8bd4fed80bb7
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
2021-11-26 21:42:47 +08:00
Jindong Yue
e5dfa89138 ANDROID: gki_defconfig: enable CONFIG_SPI_MEM
Enable SPI memory extension to provide high-level
interface to send memory-like commands, which are
used by vendor SPI controllers, like spi-nxp-fspi.

Bug: 207737303
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: I9ea58edc1407bead42970c4cc74c5d4a93c99d13
2021-11-26 21:42:46 +08:00