Commit Graph

865453 Commits

Author SHA1 Message Date
Tao Huang
77dd1a64ea media: rockchip: cif: build depends on CPU config
When build with rv1126_defconfig:

before:
   text    data     bss     dec     hex filename
   7820	    144	      0	   7964	   1f1c	drivers/media/platform/rockchip/cif/hw.o

after:
   text    data     bss     dec     hex filename
   4301	    144	      0	   4445	   115d	drivers/media/platform/rockchip/cif/hw.o

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I0dee5f7f43da3eb58a65342319ccb77b5501e0ce
2021-09-16 10:55:21 +08:00
Tao Huang
1a0176f009 net: stmmac: dwmac-rk: build depends on CPU config
When build with rv1126_defconfig:

before:
   text	   data	    bss	    dec	    hex	filename
  17063	    144	      0	  17207	   4337	drivers/net/ethernet/stmicro/stmmac/dwmac-rk.o

after:
   text	   data	    bss	    dec	    hex	filename
   7387	    144	      0	   7531	   1d6b	drivers/net/ethernet/stmicro/stmmac/dwmac-rk.o

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I941f79357f686f5d35e727abea2fe26c4ea0dafa
2021-09-16 10:55:21 +08:00
Tao Huang
5fa24759c0 soc: rockchip: pvtm: build depends on CPU config
When build with rv1126_defconfig:

before:
   text	   data	    bss	    dec	    hex	filename
   8796	    156	      4	   8956	   22fc	drivers/soc/rockchip/rockchip_pvtm.o

after:
   text	   data	    bss	    dec	    hex	filename
   4508	    156	      4	   4668	   123c	drivers/soc/rockchip/rockchip_pvtm.o

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I8c49713ebc48586aa4f08fb3ec965890c2beb1a2
2021-09-16 10:55:21 +08:00
Meiyou Chen
c6fc171e09 arm64: dts: rockchip: rk3399-ind: tc358749x use dummy codec
Signed-off-by: Meiyou Chen <cmy@rock-chips.com>
Change-Id: Id6213f44e64cd92b0369f8dfdb411bba9b108930
2021-09-16 10:49:06 +08:00
Douglas Anderson
6c37d44def BACKPORT: usb: dwc2: bus suspend/resume for hosts with DWC2_POWER_DOWN_PARAM_NONE
This is an attempt to rehash commit 0cf884e819 ("usb: dwc2: add bus
suspend/resume for dwc2") on ToT.  That commit was reverted in commit
b0bb9bb6ce ("Revert "usb: dwc2: add bus suspend/resume for dwc2"")
because apparently it broke the Altera SOCFPGA.

With all the changes that have happened to dwc2 in the meantime, it's
possible that the Altera SOCFPGA will just magically work with this
change now.  ...and it would be good to get bus suspend/resume
implemented.

This change is a forward port of one that's been living in the Chrome
OS 3.14 kernel tree.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Iba408750729ce6c8f1cb0c94a5e8891c7b240014
(cherry picked from commit 6f6d70597c)
2021-09-16 10:48:40 +08:00
Finley Xiao
0d97d2220b arm64: dts: rockchip: rk3308b-evb-v10: Remove invalid configuration for tsadc
Change-Id: I9eecd97f7a4df74f696fa6c8e337829800d3fcd0
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2021-09-16 09:28:52 +08:00
Wang Panzhenzhuan
955acd592f media: i2c: nvp6158: add workqueue & more resolution support
1. add workqueue to detect ahd state.
2. add following resolution support:
    AHD30_3M_18P //2048 x 1536@18
    AHD30_4M_15P //2560x1440@15
    AHD30_4M_30P //2560x1440@30
    AHD30_5M_12_5P //2592x 1944 @12.5
    AHD30_5M_20P //2592x 1944 @20
    AHD30_8M_7_5P //3840x2160 @7.5
    AHD30_8M_15P //3840x2160 @15

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I6c7b762cacefe7de473a63cb275e1861c9ef096b
2021-09-15 16:31:59 +08:00
Wyon Bi
5b1eeee089 drm/bridge: analogix_dp: Fix display corruption in low temperature environment
Change-Id: I46b3dbc57c1f2b8482559d4ba44bd7f339657ccd
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-09-15 15:15:59 +08:00
Cai YiWei
b45203862c media: rockchip: isp: remove associated of cproc and ie
Change-Id: Ic4d6171398322e24993e4a0419fd43fae85672b8
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:52:31 +08:00
Cai YiWei
dedc22f3ee media: rockchip: ispp: add frame loss info to procfs
Change-Id: I413608060c2245809a4b1f9d908511531901608d
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:46:07 +08:00
Cai YiWei
066b913603 media: rockchip: isp: add frame loss info to procfs
Change-Id: Idecd94535da352fcde5f2a462d4596316f9ea049
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:43:03 +08:00
Cai YiWei
75d5fa521c media: rockchip: ispp: frame start to check stream output buffer
Change-Id: I8ca95767705ffd705c90e22ab5d067fe7d79ad9e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-15 11:31:12 +08:00
Zorro Liu
70c1ef2a9e drm/rockchip: ebc_dev: release version v2.11
register /dev/waveform for hwc with eink regal lib

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I4a1db7199015f48423cd79905562b29dd28a8696
2021-09-14 11:46:17 +08:00
Zorro Liu
74414eb68e drm/rockchip: ebc_dev: release version v2.10
protect auto buf by rw lock

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I27b09e1c2e72f6d86e17b2b42365b37fccc4be56
2021-09-14 09:04:13 +08:00
Weixin Zhou
57c7a7ae08 regulator: xz3216: add mode setting support
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
Change-Id: I523b87bbf33a63d794cec7b99d443388f3a36f96
2021-09-13 11:43:56 +08:00
Tao Huang
cc34f814c9 clk: rockchip: rk3308: Call rockchip_soc_id_init() on init
clk init on time_init() which is before pure_initcall.
So call rockchip_soc_id_init() before call soc_is_rk3308b().

Change-Id: Iece3673bc7309ef9193df99f2a95e4b930613a3e
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-09-10 18:25:17 +08:00
Tao Huang
f5542b312a soc: rockchip: cpuinfo: Export rockchip_soc_id_init() function
Allow rockchip_soc_id_init() called before pure_initcall.

Change-Id: Ie0d3a18e96df02c2d6ab4aa3e17ea102685cd0c4
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-09-10 18:23:58 +08:00
Wang Panzhenzhuan
d3f9f64847 media: i2c: add camera driver hm5040
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Icaaf459fe4ee87c88405be079b15d203ec7bb4f1
2021-09-09 11:47:44 +08:00
Kyle Tso
1e1aad4a82 UPSTREAM: usb: typec: tcpm: Do not finish VDM AMS for retrying Responses
If the VDM responses couldn't be sent successfully, it doesn't need to
finish the AMS until the retry count reaches the limit.

Fixes: 0908c5aca3 ("usb: typec: tcpm: AMS and Collision Avoidance")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable <stable@vger.kernel.org>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210606081452.764032-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: Ida18c423bcc587bb217a61522ff5a4212f92ce2c
(cherry picked from commit 5ab14ab1f2)
2021-09-08 19:44:05 +08:00
Badhri Jagan Sridharan
f8b664eac2 UPSTREAM: usb: typec: tcpm: Skip sink_cap query only when VDM sm is busy
When port partner responds "Not supported" to the DiscIdentity command,
VDM state machine can remain in NVDM_STATE_ERR_TMOUT and this causes
querying sink cap to be skipped indefinitely. Hence check for
vdm_sm_running instead of checking for VDM_STATE_DONE.

Change-Id: Ie73eed677050a4ef15f2d36e159bf7e9c3879bfb
Fixes: 8dc4bd0736 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210318064805.3747831-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 2b8c956ea6)
2021-09-08 19:42:40 +08:00
Kyle Tso
8c71e3ffce BACKPORT: usb: typec: tcpm: Respond Wait if VDM state machine is running
Port partner could send PR_SWAP/DR_SWAP/VCONN_SWAP/Request just after it
enters Ready states. This will cause conficts if the port is going to
send DISC_IDENT in the Ready states of TCPM. Set a flag indicating that
the state machine is processing VDM and respond Wait messages until the
VDM state machine stops.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210114145053.1952756-4-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: I5d0c8106e5ed0c8cfeb65db6771a6a113972475f
(cherry picked from commit 8d3a0578ad)
2021-09-08 19:42:00 +08:00
Kyle Tso
b593b3e65c BACKPORT: usb: typec: tcpm: AMS and Collision Avoidance
This patch provides the implementation of Collision Avoidance introduced
in PD3.0. The start of each Atomic Message Sequence (AMS) initiated by
the port will be denied if the current AMS is not interruptible. The
Source port will set the CC to SinkTxNG if it is going to initiate an
AMS, and SinkTxOk otherwise. Meanwhile, any AMS initiated by a Sink port
will be denied in TCPM if the port partner (Source) sets SinkTxNG except
for HARD_RESET and SOFT_RESET.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210114145053.1952756-2-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: Id0531c88ab8612745e042699a60f8a794415db36
(cherry picked from commit 0908c5aca3)
2021-09-08 19:39:02 +08:00
XiaoTan Luo
e877670daa ASoC: rockchip: rk817-codec: enable dac when play
In this case playback_path set to ON, and then play music.
when playback close, stream mute power off the dac,
but the playback_path do not be set to OFF, so we must
power on the dac again.

Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: I7baa8518ccbb567cb146c5739f9a125da320e674
2021-09-08 14:38:36 +08:00
Xing Zheng
20d8a7925f ASoC: rockchip: rk817-codec: add support recover playback/capture path after resume
[Fix and using new sound APIs (snd_soc_kcontrol_component()/snd_soc_component_get_drvdata())]

Change-Id: I52487370ce33b057d9cf774b7c0cef06f2c98bca
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2021-09-08 14:38:31 +08:00
Xing Zheng
ee10e96cd6 ASoC: rockchip: rk817-codec: clean up and wrap playback and capture path configurations
[Fix and using new sound APIs (snd_soc_kcontrol_component()/snd_soc_component_get_drvdata())]

Change-Id: I6bc36626a8952ef28789dfacf57c2b27580a3467
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2021-09-08 14:38:26 +08:00
Simon Xue
1d569a020b iommu: rockchip: optimise getting clocks
Use devm_clk_bulk_get_all instead of devm_clk_bulk_get. So we don't need
the complicated operation.

Change-Id: Idbe7668bd26b744f8d8b7d79d5eb99fa891bd0be
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-09-07 19:12:36 +08:00
Kyle Tso
f860d75d3b UPSTREAM: usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events
When receiving FRS and Sourcing_Vbus events from low-level drivers, keep
other events which come a bit earlier so that they will not be ignored
in the event handler.

Change-Id: Ibb4a2ccd2bbb34e53d4fbe44803aad521bb7029f
Fixes: 8dc4bd0736 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Cc: stable <stable@vger.kernel.org>
Cc: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210803091314.3051302-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 43ad944cd7)
2021-09-07 19:01:02 +08:00
Li Jun
60612bbd90 UPSTREAM: usb: typec: tcpm: cancel frs hrtimer when unregister tcpm port
Like the state_machine_timer, we should also cancel possible pending
frs hrtimer when unregister tcpm port.

Change-Id: I9a651304c9a3c0be8475773c119d000b5cddfa0f
Fixes: 8dc4bd0736 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1622627829-11070-2-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 7ade4805e2)
2021-09-07 18:57:06 +08:00
Badhri Jagan Sridharan
8dd1e02217 UPSTREAM: usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)
PD 3.0 spec defines a new mechanism for power role swap called
Fast role swap. This change enables TCPM to support FRS when
acting as sink.

Once the explicit contract is negotiated, sink port is
expected to query the source port for sink caps to
determine whether the source is FRS capable.
Bits 23 & 24 of fixed pdo of the sink caps from the source, when
set, indicates the current needed by the source when fast role
swap is in progress(Implicit contract phasae). 0 indicates that
the source does not support Fast Role Swap.

Upon receiving the FRS signal from the source,
TCPC(TCPM_FRS_EVENT) informs TCPM to start the Fast role swap sequence.

1. TCPM sends FRS PD message: FR_SWAP_SEND
2. If response is not received within the expiry of
   SenderResponseTimer, Error recovery is triggered.:
   FR_SWAP_SEND_TIMEOUT
3. Upon receipt of the accept message, TCPM waits for
   PSSourceOffTimer for PS_READY message from the partner:
   FR_SWAP_SNK_SRC_NEW_SINK_READY.

TCPC is expected to autonomously turn on vbus once the FRS
signal is received and vbus voltage falls below vsafe5v within
tSrcFrSwap. This is different from traditional power role swap
where the vbus sourcing is turned on by TCPM.

4. By this time, TCPC most likely would have started to
   source vbus, TCPM waits for tSrcFrSwap to see  if the
   lower level TCPC driver signals TCPM_SOURCING_VBUS event:
   FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED.
5. When TCPC signals sourcing vbus, TCPM sends PS_READY msg and
   changes the CC pin from Rd to Rp. This is the end of fast
   role swap sequence and TCPM initiates the sequnce to negotiate
   explicit contract by transitioning into SRC_STARTUP after
   SwapSrcStart.

The code is written based on the sequence described in "Figure 8-107:
Dual-role Port in Sink to Source Fast Role Swap State Diagram" of
USB Power Delivery Specification Revision 3.0, Version 1.2.

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201008061556.1402293-7-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: I1316c4498187dc67a5d652341ddb48118a201acf
(cherry picked from commit 8dc4bd0736)
2021-09-07 18:34:14 +08:00
Caesar Wang
7dd3d86021 scripts/mkimg: fixes the realpath for io-domain.sh
This issue found on yocto builing the kernel.

yocto/build/tmp/work-shared/rockchip-rk3568-evb/kernel-source/scripts/mkimg:
line 227:./scripts/io-domain.sh: No such file or directory
arch/arm64/Makefile:203: recipe for target 'rk3568-evb1-ddr4-v10-linux.img' failed
make[2]: *** [rk3568-evb1-ddr4-v10-linux.img] Error 127
Makefile:146: recipe for target 'sub-make' failed

Fixes: b25c12a00a ("scripts: add io-domain.sh for rk356x io-domain check")

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: Id6d496fe886ce79c9efee30a5f4d2cd270d34efd
2021-09-07 17:47:59 +08:00
Wang Jie
0e9176d1fc usb: dwc3: core: fix pm runtime issue for rockchip platforms
The rockchip platforms, such as RK3399 and RK3568
otg port enable pm runtime to swith peripheral and
host mode. During dwc3 core probe, there are two
place which may call pm_runtime_put_sync_suspend(),
one is in dwc3_rockchip_async_probe(), the other one
is in the drd_work called from dwc3_core_init_mode().
The dwc3_rockchip_async_probe() and drd_work are
scheduled asynchronously, and the order of their
execution is randomly.

If the drd_work is handled prior to the async probe,
there's no problem, but if the async probe is handled
firstly, the pm_runtime_put_sync_suspend() will be
duplicated twice. If this issue happens, the value of
dwc3 power.usage_count is -1, in other words, the
runtime put/suspend operations is unbalanced, and
fail to do dwc3_runtime_suspend/resume.

This patch avoids do pm_runtime_put_sync_suspend()
in the drd_work if no usb connected.

Fixes: bb4c791a42 ("usb: dwc3: core: add pm runtime for drd mode")
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I088a7ddb60eb817093810fe874d5fdb242c73ca7
2021-09-07 16:17:10 +08:00
Andy Yan
e05d38ded5 drm/rockchip: vop2: Use macro for window phys_id
Change-Id: Icca89acb0397781c64538c68cc40530e1104455e
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-07 15:44:57 +08:00
Dingxian Wen
023dbce94d arm64: configs: rockchip_defconfig: enable LT8619C
Enable lt8619c HDMI to BT656/BT1120 bridge driver for hdmi-in
application. Which found on rk3568-evb6-ddr3-v10.

Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: Idd8bdfd2f2d2cc4af9e1d47e3002ebcee1252df5
2021-09-07 15:44:20 +08:00
Dingxian Wen
cd0c2a18da arm64: dts: rockchip: rk3568-evb6: add lt8619c configuration
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I9bff56d2cddd1d8d16bac0ffd09bd48167dd58ed
2021-09-07 15:44:20 +08:00
Dingxian Wen
32d6a552bb media: i2c: lt8619c: add lt8619c HDMI to BT656/BT1120 bridge driver
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I894dc4822d4a9efb6cf3b6d5b6c12b4f03c3ae92
2021-09-07 15:44:20 +08:00
Yu Qiaowei
c0b26710c9 video/rockchip: rga2: Add RGA debugger.
1. Support procfs, both debugfs and procfs.
2. Modify the debug node name:
   /sys/kernel/debug/rga2_debug/rga2
   -> /sys/kernel/debug/rkrga/debug
   -> /proc/rkrga/debug (add)
3. Add a node to view the driver version number: driver_version.
4. Add CONFIG_ROCKCHIP_RGA2_PROC_FS/ROCKCHIP_RGA2_DEBUG_FS/
   ROCKCHIP_RGA2_DEBUGGER, Where CONFIG_ROCKCHIP_RGA2_PROC_FS
   defaults to n, CONFIG_ROCKCHIP_RGA2_DEBUGGER defaults to y.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I89a971f18301ffa9cc7ac1962ebeee5e97d209aa
2021-09-07 15:42:36 +08:00
Badhri Jagan Sridharan
14fd077fca UPSTREAM: usb: typec: tcpci: update ROLE_CONTROL for DRP
ROLE_CONTROL register would not have the actual CC terminations
unless the port does not set ROLE_CONTROL.DRP. For DRP ports,
CC_STATUS.cc1/cc2 indicates the final terminations applied
when TCPC enters potential_connect_as_source/_sink.
For DRP ports, infer port role from CC_STATUS and set corresponding
CC terminations before setting the orientation.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20200901025927.3596190-4-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: I108119eb0d9accf5697b9d69f1188766c2bdb0b9
(cherry picked from commit 57ce64668f)
2021-09-07 11:19:03 +08:00
Li Jun
ef9dc469db UPSTREAM: usb: typec: tcpm: cancel vdm and state machine hrtimer when unregister tcpm port
A pending hrtimer may expire after the kthread_worker of tcpm port
is destroyed, see below kernel dump when do module unload, fix it
by cancel the 2 hrtimers.

[  111.517018] Unable to handle kernel paging request at virtual address ffff8000118cb880
[  111.518786] blk_update_request: I/O error, dev sda, sector 60061185 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[  111.526594] Mem abort info:
[  111.526597]   ESR = 0x96000047
[  111.526600]   EC = 0x25: DABT (current EL), IL = 32 bits
[  111.526604]   SET = 0, FnV = 0
[  111.526607]   EA = 0, S1PTW = 0
[  111.526610] Data abort info:
[  111.526612]   ISV = 0, ISS = 0x00000047
[  111.526615]   CM = 0, WnR = 1
[  111.526619] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000041d75000
[  111.526623] [ffff8000118cb880] pgd=10000001bffff003, p4d=10000001bffff003, pud=10000001bfffe003, pmd=10000001bfffa003, pte=0000000000000000
[  111.526642] Internal error: Oops: 96000047 [#1] PREEMPT SMP
[  111.526647] Modules linked in: dwc3_imx8mp dwc3 phy_fsl_imx8mq_usb [last unloaded: tcpci]
[  111.526663] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc4-00927-gebbe9dbd802c-dirty #36
[  111.526670] Hardware name: NXP i.MX8MPlus EVK board (DT)
[  111.526674] pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO BTYPE=--)
[  111.526681] pc : queued_spin_lock_slowpath+0x1a0/0x390
[  111.526695] lr : _raw_spin_lock_irqsave+0x88/0xb4
[  111.526703] sp : ffff800010003e20
[  111.526706] x29: ffff800010003e20 x28: ffff00017f380180
[  111.537156] buffer_io_error: 6 callbacks suppressed
[  111.537162] Buffer I/O error on dev sda1, logical block 60040704, async page read
[  111.539932]  x27: ffff00017f3801c0
[  111.539938] x26: ffff800010ba2490 x25: 0000000000000000 x24: 0000000000000001
[  111.543025] blk_update_request: I/O error, dev sda, sector 60061186 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[  111.548304]
[  111.548306] x23: 00000000000000c0 x22: ffff0000c2a9f184 x21: ffff00017f380180
[  111.551374] Buffer I/O error on dev sda1, logical block 60040705, async page read
[  111.554499]
[  111.554503] x20: ffff0000c5f14210 x19: 00000000000000c0 x18: 0000000000000000
[  111.557391] Buffer I/O error on dev sda1, logical block 60040706, async page read
[  111.561218]
[  111.561222] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[  111.564205] Buffer I/O error on dev sda1, logical block 60040707, async page read
[  111.570887] x14: 00000000000000f5 x13: 0000000000000001 x12: 0000000000000040
[  111.570902] x11: ffff0000c05ac6d8
[  111.583420] Buffer I/O error on dev sda1, logical block 60040708, async page read
[  111.588978]  x10: 0000000000000000 x9 : 0000000000040000
[  111.588988] x8 : 0000000000000000
[  111.597173] Buffer I/O error on dev sda1, logical block 60040709, async page read
[  111.605766]  x7 : ffff00017f384880 x6 : ffff8000118cb880
[  111.605777] x5 : ffff00017f384880
[  111.611094] Buffer I/O error on dev sda1, logical block 60040710, async page read
[  111.617086]  x4 : 0000000000000000 x3 : ffff0000c2a9f184
[  111.617096] x2 : ffff8000118cb880
[  111.622242] Buffer I/O error on dev sda1, logical block 60040711, async page read
[  111.626927]  x1 : ffff8000118cb880 x0 : ffff00017f384888
[  111.626938] Call trace:
[  111.626942]  queued_spin_lock_slowpath+0x1a0/0x390
[  111.795809]  kthread_queue_work+0x30/0xc0
[  111.799828]  state_machine_timer_handler+0x20/0x30
[  111.804624]  __hrtimer_run_queues+0x140/0x1e0
[  111.808990]  hrtimer_interrupt+0xec/0x2c0
[  111.813004]  arch_timer_handler_phys+0x38/0x50
[  111.817456]  handle_percpu_devid_irq+0x88/0x150
[  111.821991]  __handle_domain_irq+0x80/0xe0
[  111.826093]  gic_handle_irq+0xc0/0x140
[  111.829848]  el1_irq+0xbc/0x154
[  111.832991]  arch_cpu_idle+0x1c/0x2c
[  111.836572]  default_idle_call+0x24/0x6c
[  111.840497]  do_idle+0x238/0x2ac
[  111.843729]  cpu_startup_entry+0x2c/0x70
[  111.847657]  rest_init+0xdc/0xec
[  111.850890]  arch_call_rest_init+0x14/0x20
[  111.854988]  start_kernel+0x508/0x540
[  111.858659] Code: 910020e0 8b0200c2 f861d884 aa0203e1 (f8246827)
[  111.864760] ---[ end trace 308b9a4a3dcb73ac ]---
[  111.869381] Kernel panic - not syncing: Oops: Fatal exception in interrupt
[  111.876258] SMP: stopping secondary CPUs
[  111.880185] Kernel Offset: disabled
[  111.883673] CPU features: 0x00001001,20000846
[  111.888031] Memory Limit: none
[  111.891090] ---[ end Kernel panic - not syncing: Oops: Fatal exception in interrupt ]---

Change-Id: I4fae27939edca3a9c09020e6252c96ae373eaaf2
Fixes: 3ed8e1c2ac ("usb: typec: tcpm: Migrate workqueue to RT priority for processing events")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1622627829-11070-1-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 3a13ff7ef4)
2021-09-07 11:14:07 +08:00
Badhri Jagan Sridharan
14d6da04a6 UPSTREAM: usb: typec: tcpm: Migrate workqueue to RT priority for processing events
"tReceiverResponse 15 ms Section 6.6.2
The receiver of a Message requiring a response Shall respond
within tReceiverResponse in order to ensure that the
sender’s SenderResponseTimer does not expire."

When the cpu complex is busy running other lower priority
work items, TCPM's work queue sometimes does not get scheduled
on time to meet the above requirement from the spec.
Moving to kthread_work apis to run with real time priority.

Further, as observed in 1ff688209e, moving to hrtimers to
overcome scheduling latency while scheduling the delayed work.

TCPM has three work streams:
1. tcpm_state_machine
2. vdm_state_machine
3. event_work

tcpm_state_machine and vdm_state_machine both schedule work in
future i.e. delayed. Hence each of them have a corresponding
hrtimer, tcpm_state_machine_timer & vdm_state_machine_timer.

When work is queued right away kthread_queue_work is used.
Else, the relevant timer is programmed and made to queue
the kthread_work upon timer expiry.

kthread_create_worker only creates one kthread worker thread,
hence single threadedness of workqueue is retained.

Change-Id: Iafd9ca68a00b61e39cc9de2609eaef2c277eabb0
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20200818192758.2562908-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
(cherry picked from commit 3ed8e1c2ac)
2021-09-07 11:10:25 +08:00
Badhri Jagan Sridharan
79ba1940b3 UPSTREAM: usb: typec: tcpm: Ignore CC and vbus changes in PORT_RESET change
After PORT_RESET, the port is set to the appropriate
default_state. Ignore processing CC changes here as this
could cause the port to be switched into sink states
by default.

echo source > /sys/class/typec/port0/port_type

Before:
[  154.528547] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
[  154.528560] CC1: 0 -> 0, CC2: 3 -> 0 [state PORT_RESET, polarity 0, disconnected]
[  154.528564] state change PORT_RESET -> SNK_UNATTACHED

After:
[  151.068814] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  151.072440] CC1: 3 -> 0, CC2: 0 -> 0 [state PORT_RESET, polarity 0, disconnected]
[  151.172117] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  151.172136] pending state change PORT_RESET_WAIT_OFF -> SRC_UNATTACHED @ 870 ms [rev3 NONE_AMS]
[  152.060106] state change PORT_RESET_WAIT_OFF -> SRC_UNATTACHED [delayed 870 ms]
[  152.060118] Start toggling

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200402215947.176577-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
Change-Id: Ic8a06dafdd4583cba12c7b66b1c9faf8ca830200
(cherry picked from commit 901789745a)
2021-09-07 11:03:13 +08:00
Cai YiWei
4a7a52e98c media: rockchip: isp: compiled with differe hardware version
Change-Id: Ic18a8ba5005e14f9676716fc9b089ed81bdd38b0
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-07 10:50:23 +08:00
Cai YiWei
acfebbb68f media: rockchip: isp: selfpath bytesperline 16 align
Change-Id: I39b36e7e3a8c483f5c77ddbea0f6bebb4e1a0b0a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-09-06 19:17:40 +08:00
Andy Yan
39f12dae1f drm/rockchip: vop2: Remove prepare_fb/cleanup_fb callback
According to commit 9bde4e671f ("drm/rockchip: vop: fix iommu crash
with async atomic")
These two callback were added to avoid iommu crash on async
commit caused by drm_atomic_clean_old_fb after drm_atomic_async_commit.

drm_atomic_clean_old_fb was removed after commit
e00fb8564e ("drm: Stop updating plane->crtc/fb/old_fb on atomic drivers")

So we can remove them to make life  simpler.

Change-Id: Iea1f2dbadd9bcfad5b8447831c0d31068d4fa97b
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-06 09:51:42 +08:00
Andy Yan
bcd4aed392 drm/rockchip: vop2: Use macro for window phys_id
Change-Id: I91ff9d169f5713e38c994f56980dfcf0cba0fe40
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-03 19:23:29 +08:00
Andy Yan
55462060b2 drm/rockchip: vop2: No need to check active vp in layer_map_initial
We assign window between vp by plane_mask now, no
need to check which vp is activated from register.

Change-Id: I89d22f253dcd26898dc79304d51b8a8d9e802bb2
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-03 19:23:29 +08:00
Shawn Lin
9d60286b72 mmc: sdhci-of-dwcmshc: Remove HS200 and HS400 at low speed for rockchip
Rockchip platforms don't support HS200 or HS400 at low speed, so
we must limit it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I40eb9f117fd83789b6ab7a16d44049e16786698b
2021-09-03 17:45:07 +08:00
Zefa Chen
80fe73c741 media: rockchip: cif: add module exit to fix the failure of rmmod video_rkcif
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I97fc14eb411339796dfc58b28460ed00cd898814
2021-09-03 11:02:21 +08:00
Shawn Lin
c18fd2aea2 arm64: dts: rockchip: rk3568: Set SDHCI core clk to 200MHz
As we mask our SDHCI controller as SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
host->max_clk is derived from core clock in the first place. Then
f_max works together with it.

If we adjust loader's core clk setting, such as 50MHz, we will get
50MHz for host->max_clk, because .get_max_clock() reads core clk
when probing driver. That will lead f_max be set to 50MHz as well,
no matter if max-frequency is set higher than 50MHz.

We can simple solve this problem by assigning core clk as 200MHz
in the first place and then let max-frequency property takes over
it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Idb2fdb8f68881d0286d977dc3718b74c30d3bc67
2021-09-03 10:05:27 +08:00
Jon Lin
2ecea59132 drivers: rkflash: Support new SPI Nand devices
GD5F1GQ4UExxH, W25N512GVEIG, SGM7000I-S24W1GH

Change-Id: Ib9e5422c3f57ef80e60fc6847d0ba9e1dd55dc3b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-02 16:36:04 +08:00
Jon Lin
abce936f23 drivers: rkflash: Add mutex for deinit ops.
Change-Id: I477c161cb22f58263963a4d8e0d08eaeda676f69
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-09-02 15:18:29 +08:00