Commit Graph

853414 Commits

Author SHA1 Message Date
Ilias Apalodimas
ea9df2edfc UPSTREAM: net: stmmac: fix ptp timestamping on Rx on gmac4
The current driver only enables Pdelay_Req and Pdelay_Resp when
HWTSTAMP_FILTER_PTP_V2_EVENT, HWTSTAMP_FILTER_PTP_V1_L4_EVENT or
HWTSTAMP_FILTER_PTP_V2_L4_EVENT is requested. This results in ptp sync on
slave mode to report 'received SYNC without timestamp' when using ptp4l.

Although the hardware can support Sync, Pdelay_Req and Pdelay_resp by
setting bit14 annd bits 17/16 to 01 this leaves Delay_Req timestamps out.

Fix this by enabling all event and general messages timestamps.
This includes SYNC, Follow_Up, Delay_Req, Delay_Resp, Pdelay_Req,
Pdelay_Resp and Pdelay_Resp_Follow_Up messages.

Change-Id: Id5e4c22bff9742d21a1ef8011e3bde77e689b830
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jose Abreu <joabreu@synopsys.com>
Tested-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry picked from commit 7d8e249f39)
2020-04-07 19:27:31 +08:00
Artem Panfilov
fc779a7bec UPSTREAM: net: stmmac: implement the SIOCGHWTSTAMP ioctl
This patch adds support for the SIOCGHWTSTAMP ioctl which enables user
processes to read the current hwtstamp_config settings
non-destructively.

Change-Id: I26dec7bdd16332f6427ac6ec3096e3283d9ed8d1
Signed-off-by: Artem Panfilov <panfilov.artyom@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry picked from commit d6228b7cdd)
2020-04-07 19:27:31 +08:00
David Wu
238b00ba90 ARM: dts: rv1108: Remove "rockchip,grf" property except i2c2
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I0ca4699e2a031dbe53e77cbceba61a5a47257048
2020-04-07 19:27:30 +08:00
David Wu
14c0308516 i2c: busses: rk3x: Fix i2c grf special bit setting
When the property "rockchip,grf" of i2c DTS node exists and
the GRF offset is also valid, special bit needs to be configured.

Change-Id: If7ea4185b940ad026ed822b44cfb0c8acda83500
Signed-off-by: David Wu <david.wu@rock-chips.com>
2020-04-07 19:27:30 +08:00
Tao Huang
a8baa34ace f2fs: fix memory leak in f2fs_try_convert_inline_dir()
If fscrypt_setup_filename() successful, fscrypt_free_filename()
must be called later to clean up.

Change-Id: I761472d605a1a3c64307fc997210ca2007bd8932
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-04-07 19:27:30 +08:00
Ding Wei
6e73c8cad0 video: rockchip: mpp: fix issue about kill user process
If user process killed:
1. kernel should not to alloc task, and wait all task done in session,
   then release session.
2. fd in user space is closed, then kernel space can not use dma_buf_get
   to get dma handle, so kernel will crash.

crash:

[   35.677648 ] [<b022b098>] (__fget) from [<b0467134>]
(dma_buf_get+0x8/0x40)
[   35.678261 ] [<b0467134>] (dma_buf_get) from [<b0397848>]
(mpp_dma_find_buffer_fd+0x14/0x94)
[   35.679004 ] [<b0397848>] (mpp_dma_find_buffer_fd) from [<b03978fc>]
(mpp_dma_release_fd+0x34/0xa0)
[   35.679799 ] [<b03978fc>] (mpp_dma_release_fd) from [<b0395b2c>]
(mpp_task_finalize+0x68/0xbc)
[   35.680561 ] [<b0395b2c>] (mpp_task_finalize) from [<b0398614>]
(rkvdec_free_task+0xc/0x1c)
[   35.681290 ] [<b0398614>] (rkvdec_free_task) from [<b03963e4>]
(mpp_wait_result+0xd4/0x400)
[   35.682020 ] [<b03963e4>] (mpp_wait_result) from [<b0396940>]
(mpp_dev_release+0x230/0x244)
[   35.682750 ] [<b0396940>] (mpp_dev_release) from [<b020f30c>]
(__fput+0x88/0x1c4)
[   35.683415 ] [<b020f30c>] (__fput) from [<b0140cac>]
(task_work_run+0x90/0xb0)
[   35.684059 ] [<b0140cac>] (task_work_run) from [<b0128b38>]
(do_exit+0x3c4/0xac4)
[   35.684722 ] [<b0128b38>] (do_exit) from [<b0129f54>]
(do_group_exit+0x3c/0xbc)
[   35.685366 ] [<b0129f54>] (do_group_exit) from [<b0133b50>]
(get_signal+0xe4/0x6ac)
[   35.686040 ] [<b0133b50>] (get_signal) from [<b010b09c>]
(do_signal+0x2a0/0x494)
[   35.686690 ] [<b010b09c>] (do_signal) from [<b010b454>]
(do_work_pending+0xb4/0xd0)
[   35.687364 ] [<b010b454>] (do_work_pending) from [<b0101064>]
(slow_work_pending+0xc/0x20)

Change-Id: I8decec8ff4c356b315fe511128c5b67c5b349932
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-04-03 10:00:03 +08:00
Jianing Ren
4b5336a3bb usb: dwc3: core: enable runtime for rockchip platform
Change-Id: I49e3fa207db8aea0355a797b69c9c8a791d2eaa3
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-04-02 20:05:35 +08:00
Christoph Hellwig
b64974825a UPSTREAM: mm/swapfile.c: move inode_lock out of claim_swapfile
claim_swapfile() currently keeps the inode locked when it is successful,
or the file is already swapfile (with -EBUSY).  And, on the other error
cases, it does not lock the inode.

This inconsistency of the lock state and return value is quite confusing
and actually causing a bad unlock balance as below in the "bad_swap"
section of __do_sys_swapon().

This commit fixes this issue by moving the inode_lock() and IS_SWAPFILE
check out of claim_swapfile().  The inode is unlocked in
"bad_swap_unlock_inode" section, so that the inode is ensured to be
unlocked at "bad_swap".  Thus, error handling codes after the locking now
jumps to "bad_swap_unlock_inode" instead of "bad_swap".

    =====================================
    WARNING: bad unlock balance detected!
    5.5.0-rc7+ #176 Not tainted
    -------------------------------------
    swapon/4294 is trying to release lock (&sb->s_type->i_mutex_key) at: __do_sys_swapon+0x94b/0x3550
    but there are no more locks to release!

    other info that might help us debug this:
    no locks held by swapon/4294.

    stack backtrace:
    CPU: 5 PID: 4294 Comm: swapon Not tainted 5.5.0-rc7-BTRFS-ZNS+ #176
    Hardware name: ASUS All Series/H87-PRO, BIOS 2102 07/29/2014
    Call Trace:
     dump_stack+0xa1/0xea
     print_unlock_imbalance_bug.cold+0x114/0x123
     lock_release+0x562/0xed0
     up_write+0x2d/0x490
     __do_sys_swapon+0x94b/0x3550
     __x64_sys_swapon+0x54/0x80
     do_syscall_64+0xa4/0x4b0
     entry_SYSCALL_64_after_hwframe+0x49/0xbe
    RIP: 0033:0x7f15da0a0dc7

Change-Id: I02a0fcfc63c3dcc4c4cdaf8b2500f5253e648649
Fixes: 1638045c36 ("mm: set S_SWAPFILE on blockdev swap devices")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Qais Youef <qais.yousef@arm.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/20200206090132.154869-1-naohiro.aota@wdc.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit d795a90e2b)
2020-04-02 17:25:08 +08:00
Kever Yang
63275236b7 ARM: dts: rockchip: add build rk3229-evb-android-avb.dtb
This is the only dts tested with android 10.

Change-Id: I444f7832beec8ec6ed599acdd745abc9d5b430f2
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2020-04-02 15:47:08 +08:00
Jianqun Xu
5e2bcd8c9f pinctrl: rockchip: support mux route flags
Create a new flag to indicate mux route is from topgrf or pmugrf.
 * INVALID: means do not need to set mux route
 * DEFAULT: means same regmap as pin iomux
 * TOPGRF: means mux route setting in topgrf
 * PMUGRF: means mux route setting in pmugrf

Change-Id: Iff57f3649d09751ff846560bd8a1599f6ef7ef04
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-04-02 15:44:58 +08:00
Ding Wei
c7377b7be5 video: rockchip: mpp: reset osd plt clock config before setting register
rkvenc: osd plt clock should reset, othterwise, osd setting will not work

Change-Id: I47752b735b6f63303e9b12f4616510f2701970bd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-04-02 12:23:37 +08:00
Sandy Huang
0f7832c079 drm/rockchip: rgb: Add supoort bt656 and bt1120
Change-Id: I9a0fe7933979e58dc76f6a12611ff539086ba04a
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-04-01 18:11:51 +08:00
David Wu
e289cdfa5e net: ethernet: stmmac: dwmac-rk: Make the phy clock could be used for external phy
Use the phy_clk to prepare_enable and unprepare_disable related phy clock.

Change-Id: Idcf3ee00c03b4a5009a6a9385077b0a421dbc601
Signed-off-by: David Wu <david.wu@rock-chips.com>
2020-04-01 17:10:50 +08:00
Sandy Huang
53f64c98a7 drm/rockchip: vop: add bt656 and bt1120
Change-Id: Ic1d8f613a3dbeeefa77815693d450d5d10011526
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-04-01 16:59:31 +08:00
Sandy Huang
4492caa259 drm/modes: add dclk invert config parse
Change-Id: I386159201bc44f02c3aa6862f222910c801cfbac
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-04-01 16:39:59 +08:00
Benjamin Gaignard
95ba31ac86 UPSTREAM: drm/modes: tag unused variables to avoid warnings
Some variables are set but never used. To avoid warning when compiling
with W=1 and keep the algorithm like it is tag theses variables
with _maybe_unused macro.

Change-Id: I93c3056ba0f7d7ef5969d04c41de00da09f7764a
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210102437.19377-1-benjamin.gaignard@st.com
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
(cherry picked from commit f199af0018)
2020-04-01 16:12:12 +08:00
William Wu
017ed08206 usb: gadget: uvc: add a new attribute streaming_intf
This patch adds a new uvc attribute "streaming_intf" to
show the number of streaming interface. The uvc application
program may needs to query the information.

Change-Id: I4554e204ab4457f67f35d2e7bfec2902196f79d3
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-04-01 11:00:12 +08:00
Ding Wei
2ba042367a video: rockchip: mpp: time diff precision ms -> us
Change-Id: I14b61da7f16873d5bf6f90b7e6e9eadeac630e12
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-04-01 10:47:22 +08:00
Ding Wei
ded8280b49 video: rockchip: mpp: fix issue about setting hevc cabac clock
1. add video_hevc_cabac to clock list
2. set default hevc cabac clock
3. set clock for each task

Change-Id: Ic09dcc2267d8ca7c745fdbc70f079de06fde90e9
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-03-31 19:44:55 +08:00
Tao Huang
e1a14c1f6d net: wireless: rockchip: rkwifi: bcmdhd: fix gcc warning
Fix gcc 9 warning:

drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c: In function 'dhd_attach':
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux.c:9494:4: warning: 'strncat' specified bound 2 equals source length [-Wstringop-overflow=]
 9494 |    strncat(if_name, "%d", 2);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmutils.c: In function 'bcm_format_flags':
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmutils.c:2140:3: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
 2140 |   strncpy(p, name, nlen + 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmutils.c: In function 'bcm_format_field':
drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/bcmutils.c:2097:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
 2097 |     strncpy(buf, name, slen+1);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Iab941c1789cfa0e3a1322cdbf64fcfbb75bd9c7c
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-03-31 19:04:37 +08:00
Tao Huang
c76d3b11d8 soc/rockchip: remove unused rk_camera driver
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I3f5a7b6c2dddaf00d8a598d4836ecb56ce0f03ef
2020-03-31 16:32:32 +08:00
David Wu
3d0ef1aecd net: stmmac: dwmac-rk: Fix the following error
ERROR: "dwmac_rk_create_loopback_sysfs" [drivers/net/ethernet/stmicro/stmmac/dwmac-rk.ko] undefined!
ERROR: "stmmac_mdio_reset" [drivers/net/ethernet/stmicro/stmmac/dwmac-rk-tool.ko] undefined!

Fixes: a442177046 ("net: ethernet: stmicro: stmmac: Add loopback interface for rockchip")
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I493902ea828a81b49cb364959495634c39d7e307
2020-03-31 15:47:51 +08:00
Finley Xiao
a74a2368f8 clk: rockchip: Fix mask for clk_register_mux_table()
Change-Id: Ic9312fa4a6feed19206e966e97c54c4d47e11f47
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-03-30 21:43:50 +08:00
Jianqun Xu
d9ed60476f dt-bindings: pinctrl: rockchip support RK_FUNC_{5,15}
Change-Id: Ic328589e110c5968b67742d055cdb18269153954
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-30 14:11:06 +08:00
Jack Mitchell
e50c6a6518 UPSTREAM: watchdog: dw_wdt: ping watchdog to reset countdown before start
Currently on an rk3288 SoC when trying to use the watchdog the SoC will
instantly reset. This is due to the watchdog countdown counter being set
to its initial value of 0x0. Reset the watchdog counter before start in
order to correctly start the countdown timer from the right position.

Change-Id: I127b1b83ff6d459a45139847092ddbfa56c60bcd
Signed-off-by: Jack Mitchell <ml@embed.me.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200107155155.278521-1-ml@embed.me.uk
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit e7046df873)
2020-03-30 11:37:12 +08:00
Jon Lin
c3fb2a45a6 spi: rockchip-test: make spi configurable
Change-Id: Ib108ff43db462b6cbd2a2b87641169e0e36f1dc0
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-03-30 10:52:28 +08:00
Jon Lin
003cda69a2 drivers: rkflash: fix compile error
1.more undefined references to `__memzero' follow
2.fix to MTD return value

Change-Id: I1adf89873db1e85568deaf2941867b8d45252eff
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-03-30 10:29:36 +08:00
Tao Huang
67df1daf88 rfkill: Introduce Rockchip RFKILL driver
Allow rfkill-bt.c and rfkill-wlan.c build as module.
Add CONFIG_RFKILL_RK which default y.

Change-Id: I1d399641587124d2291b5b49e5538e7e490a843a
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-03-28 17:17:28 +08:00
Tao Huang
8561febee7 mmc: pwrseq: export mmc_pwrseq_power_off()
net/rfkill/rfkill-wlan.c use mmc_pwrseq_power_off()

Change-Id: I761788f58418604c43f367b48dfe4bb2ff971d48
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-03-28 17:17:28 +08:00
Jianqun Xu
2cf509da1d ASoC: codecs: rk817 fix shut down crash issue
Requesting system reboot
[    7.936347] Unable to handle kernel NULL pointer dereference at virtual address 00000044
[    7.937081] pgd = (ptrval)
[    7.937332] [00000044] *pgd=3d817835, *pte=00000000, *ppte=00000000
[    7.937917] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[    7.938402] Modules linked in:
[    7.938699] CPU: 0 PID: 631 Comm: init Not tainted 4.19.111 #100
[    7.939238] Hardware name: Generic DT based system
[    7.939686] PC is at snd_soc_component_update_bits+0x8/0x70
[    7.940203] LR is at rk817_codec_power_down+0x170/0x1cc

Change-Id: I68bb761346322750214f9fae8537d825d72f4a44
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-03-28 16:04:15 +08:00
Sugar Zhang
b35ceabc94 dt-bindings: sound: rockchip: Add spk-ctl for audiopwm
Change-Id: I4b0149397ffb5e9054ea94ee39ce45182f997604
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-03-28 12:01:11 +08:00
Sugar Zhang
7fb3fa1531 ASoC: rockchip: Add spk-ctl for audiopwm
Change-Id: I052f04b8d9ccd0b476051a04e7183e23d4126131
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-03-28 12:01:06 +08:00
David Wu
a442177046 net: ethernet: stmicro: stmmac: Add loopback interface for rockchip
Add some user interface for usage, for example at RK3399:

  - scan rgmii delayline:

    echo (speed:10 100 1000) > /sys/devices/platform/fe300000.ethernet/phy_lb_scan

  - loopback test:

    echo (speed:10 100 1000) > /sys/devices/platform/fe300000.ethernet/phy_lb
    echo (speed:10 100 1000) > /sys/devices/platform/fe300000.ethernet/mac_lb

  - set/show delayline

    cat /sys/devices/platform/fe300000.ethernet/rgmii_delayline
    echo (tx delayline) (rx delayline) > /sys/devices/platform/fe300000.ethernet/rgmii_delayline

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ic38d7f4e12987d5ebc1d81f693f955e8105657ac
2020-03-28 11:01:39 +08:00
Yifeng Zhao
57e97b7aba drivers: mtd: nand: rockchip: fix the problem of wrong configuration for the timing
FMWAIT configured with a wrong value to cause timing error.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: Ib09b79b5702bdff3010a578a50fc0d97854c03f1
2020-03-27 18:03:40 +08:00
Huibin Hong
ba92445d02 Revert "soc: rockchip: rk_fiq_debugger: clear time out interrupt but no data ready"
This reverts commit 08cb05ec40.

Change-Id: Ic8ffa074edcf5720cd1db55b9bf3db83db1b08cd
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2020-03-27 17:37:03 +08:00
Binyuan Lan
d5193532d9 arm64: dts: rockchip: update rk3326 ai-va dts for android q and add v12 board
Change-Id: I24a26df8d08ff3e4351c25b3a0d10b5174b88e2b
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2020-03-27 14:52:08 +08:00
Binyuan Lan
f2febff69b ASoC: bt-sco: Compatible stereo format
Although stereo transmission, actually only 1ch data,
just to adapt the controller of only support stereo and above.

Change-Id: I0f2d6d1b43954080a980d4e4b8ea8f3ca8207d7b
Signed-off-by: Binyuan Lan <lby@rock-chips.com>
2020-03-27 11:23:12 +08:00
Sandy Huang
260b32e594 drm/bridge: synopsys: dw-hdmi: destroy connector and encoder
connector and encoder should be removed when bind failed, otherwise will
lead to system panic when enable SLUB and SLUB_DEBUG:

[    1.071801] rockchip-drm display-subsystem: failed to bind ff960000.dsi (ops dw_mipi_dsi_ops): -517
[    1.073943] Unable to handle kernel paging request at virtual address 006b6b6b6b6b6b73
……
[    1.442300] pc : drm_mode_config_cleanup+0x4c/0x2f8
[    1.447179] lr : rockchip_drm_bind+0x610/0x1c38

after enable KASAN, we can see the UAF error:

[    3.862556] BUG: KASAN: use-after-free in rockchip_drm_bind+0x474/0x2b58
[    3.862611] Read of size 4 at addr ffffffc00a21f55c by task swapper/0/1
[    3.862691] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 4.19.101 #1820
[    3.862737] Hardware name: Rockchip rk3368 808 evb board (DT)
[    3.862782] Call trace:
[    3.862853]  dump_backtrace+0x0/0x240
[    3.862905]  show_stack+0x14/0x20
[    3.863146]  kasan_report+0xc/0x18
[    3.863265]  rockchip_drm_bind+0x474/0x2b58
……
[    3.864314] Allocated by task 1:
[    3.864376]  __kasan_kmalloc.isra.0+0x100/0x1b8
[    3.864435]  kasan_slab_alloc+0x14/0x20
[    3.864493]  __kmalloc_track_caller+0x154/0x368
[    3.864550]  devm_kmalloc+0x30/0xb0
[    3.864611]  dw_hdmi_rockchip_bind+0xcc/0xa28
[    3.864668]  component_bind_all+0x1d8/0x450
[    3.864728]  rockchip_drm_bind+0x450/0x2b58
……
[    3.865787] Freed by task 1:
[    3.865851]  __kasan_slab_free+0x118/0x220
[    3.865897]  kasan_slab_free+0x10/0x18
[    3.865952]  kfree+0x7c/0x308
[    3.866012]  release_nodes+0x248/0x4a0
[    3.866070]  devres_release_group+0xd4/0x148
[    3.866127]  component_unbind.isra.7+0x98/0xc8
[    3.866183]  component_bind_all+0x3b0/0x450
[    3.866247]  rockchip_drm_bind+0x450/0x2b58

Change-Id: I6378bf34d8b953fb770badfafdd3fe44628505f7
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-03-27 10:24:34 +08:00
Chao Yu
830390b363 FROMGIT: f2fs: fix potential .flags overflow on 32bit architecture
f2fs_inode_info.flags is unsigned long variable, it has 32 bits
in 32bit architecture, since we introduced FI_MMAP_FILE flag
when we support data compression, we may access memory cross
the border of .flags field, corrupting .i_sem field, result in
below deadlock.

To fix this issue, let's expand .flags as an array to grab enough
space to store new flags.

Call Trace:
 __schedule+0x8d0/0x13fc
 ? mark_held_locks+0xac/0x100
 schedule+0xcc/0x260
 rwsem_down_write_slowpath+0x3ab/0x65d
 down_write+0xc7/0xe0
 f2fs_drop_nlink+0x3d/0x600 [f2fs]
 f2fs_delete_inline_entry+0x300/0x440 [f2fs]
 f2fs_delete_entry+0x3a1/0x7f0 [f2fs]
 f2fs_unlink+0x500/0x790 [f2fs]
 vfs_unlink+0x211/0x490
 do_unlinkat+0x483/0x520
 sys_unlink+0x4a/0x70
 do_fast_syscall_32+0x12b/0x683
 entry_SYSENTER_32+0xaa/0x102

Change-Id: I2777d32fd64e55514549fe82be397fdd671beaf6
Fixes: 4c8ff7095b ("f2fs: support data compression")
Tested-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 7de5ad45b809b5043fb12c3e280ceffe9a6a13d4
 git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs dev)
2020-03-26 16:41:53 +08:00
Wu Liangqing
e0326ce757 BACKPORT: r8152: sync code to support usb net
latest commit in master:
d64c7a0803 ("r8152: check disconnect status after long sleep")

Change-Id: Id67ff7cd238342b8b8bef7c39c63cd397d81ee30
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-03-26 15:45:49 +08:00
Herman Chen
2ff453e141 video/rockchip: mpp: add clock && reset for hevc cabac
new version rkvdec has extra clock and reset for cabac module.

Change-Id: I24c82ad57e382d3f2b8fcde11c149f9cf50ffb15
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2020-03-26 15:17:39 +08:00
Frank Wang
d5b5b27e27 mailbox: rockchip: fix to null pointer dereference
Delivery message to upper only when mailbox client is existed.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I2fbfc3ecd110fe26d0ffed5ee90d1e4877450ef9
2020-03-26 11:09:19 +08:00
Ding Wei
f64385665a arm64: dts: rockchip: px30: update compatible suit for px30
Change-Id: If478a544f08b5d9fad3b42249405e04b58bdd289
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-03-26 10:45:12 +08:00
Herman Chen
0c65f573a4 video: rockchip: mpp: deal with issue for px30 264/265 switch
px30 grf switch method:
    a) ensure clk on
    b) ensure power on
    c) disable all iommu
    d) switch grf
    e) enable current iommu

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I1015ea9df6d8745f0a4922a1f684082660fac314
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-03-26 10:45:12 +08:00
Ding Wei
87fbf38547 dt-bindings: video: add px30 codec properties
Change-Id: I9bc50a2494801782149a62d2892e4bf66b06406e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-03-26 10:45:12 +08:00
Li Huang
728b7bea7c RK3368 GPU: Fixup memory out of bounds on pvr_sync_open && pvr_sync_pt_create
Signed-off-by: Li Huang <putin.li@rock-chips.com>
Change-Id: If64b979cb1d76fefd190e6862499dd7c9fb6454f
2020-03-25 15:52:55 +08:00
Wu Liangqing
6a4fe55f35 arm64: dts: rockchip: rk3399-ind: changed rk809_codec i2s0 to i2s1
for v12 hareware board

Change-Id: I44f27c5f075b2c543206d1c1fa0473796677d12b
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-03-24 19:37:19 +08:00
Jianing Ren
cd60d2b861 usb: dwc3: fix slow connection in gadget mode
This patch fix the bug that if the property maximum-speed of dwc3 is
configured to high-speed in DTS, gadget connection will be slow.

Before gadget connection, it is necessary to write register DCFG to set
maximum speed, if you don't, dwc3 will generate Erratic Error Event many
times and results to slow connection. Actually, maximum speed will be
set when Android layer call udc_bind_to_driver but it will fail when
dwc3 runtime-suspended. For Rockchip SoCs, dwc3 will be suspended as long
as USB cable is unplugged, so we add udc_set_speed before dwc3 runtime
resume.

Change-Id: I261c2cf9a36179a8d600f223fc8fd4757c7f622d
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-03-24 14:09:23 +08:00
William Wu
cb3db5f6a5 usb: dwc3: gadget: fix isoc in transfer issue
When I test the uvc gadget function, I find that the uvc
gadget can only transfer the first frame image and then
stop unexpectedly.

Without this patch, the isochronous endpoints doesn't wait
for a XferNotReady event to start the next frame image, and
fail to transfer data. In this case, we will get an endpoint
event DWC3_DEPEVT_XFERINPROGRESS and the event status is
DEPEVT_STATUS_MISSED_ISOC, and the original code try to
issue an EndTransfer command if the started_list is empty.
However, the started_list is never empty, so it doesn't issue
an EndTransfer command and not XferNotReady event happens.

To fix this problem, this patch firstly checks if the event
status is DEPEVT_STATUS_MISSED_ISOC and then unmap the isoc
request and move the request to the pending list. Then it
issue an EndTransfer command if the started_list is empty.
After the EndTransfer is completed, we will get a XferNotReady
event and it can start the isoc requests again.

Change-Id: Ieac3ca9a177bc7599b29ae30bee243e47b3ba7c9
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-03-24 09:10:54 +08:00
Wang Panzhenzhuan
d693b4487f media: i2c: ov13850: fix take photo stresstest issue
use fast standby mode && mipi clk non-continue mode
to fix take photo stresstest issue

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Idf9ff7e509d77cb78764ba5f97f14ff402172363
2020-03-24 09:04:39 +08:00