Commit Graph

1072263 Commits

Author SHA1 Message Date
Wang Panzhenzhuan
30a25af28f media: i2c: add s5kjn1 sensor driver
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Ic8a6639edadd9cecb0c49556d3be64a343828b76
2022-04-28 16:57:57 +08:00
Jianqun Xu
915a3a82ee soc: rockchip: restruct the rk_dmabuf procfs
This patch add a DMABUF_DEBUG_ADVANCED to try to attach and map
dmabufs who have no valid scatter list table.

Update the rk_dmabuf_procfs node to be a directory tree as:

/proc/rk_dmabuf/
  /proc/rk_dmabuf/dev
  /proc/rk_dmabuf/sgt
  /proc/rk_dmabuf/size

The "dev" to show all attached devices, such as:
ffffff816f8bb600 (null)           system-uncached        8288 KiB display-subsystem fb000000.gpu fb000000.gpu

The "sgt" to show scatter list table address range, such as
ffffff8124856200 (null)           system-uncached          52 KiB   0: 0x00000001712d0000..0x00000001712d0fff (         4 KiB)
                                                                    1: 0x00000001712d2000..0x00000001712d2fff (         4 KiB)
                                                                    2: 0x00000001712c6000..0x00000001712c6fff (         4 KiB)
                                                                    3: 0x00000001712c8000..0x00000001712c8fff (         4 KiB)
                                                                    4: 0x00000001712ca000..0x00000001712cafff (         4 KiB)
                                                                    5: 0x00000001712cc000..0x00000001712ccfff (         4 KiB)
                                                                    6: 0x00000001712ce000..0x00000001712cefff (         4 KiB)
                                                                    7: 0x00000001712d1000..0x00000001712d1fff (         4 KiB)
                                                                    8: 0x00000001712c7000..0x00000001712c7fff (         4 KiB)
                                                                    9: 0x00000001712c9000..0x00000001712c9fff (         4 KiB)
                                                                   10: 0x00000001712cb000..0x00000001712cbfff (         4 KiB)
                                                                   11: 0x00000001712cd000..0x00000001712cdfff (         4 KiB)
                                                                   12: 0x00000001712cf000..0x00000001712cffff (         4 KiB)

The "size" to show total dmabuf size, such as:
Total: 79836 KiB

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I62292094407696e410e2ce2973a60f569964e8bd
2022-04-28 16:43:53 +08:00
Jianqun Xu
aa907e7134 dma-buf: support to debug dmabuf via procfsnode
This patch add a DMABUF_DEBUG to switch on/off the debug codes for
dmabuf, including set a name for each dmabuf.

Support to set a name with pid+taskname for a exported dmabuf, this is
enabled depends on DMABUF_DEBUG.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I84f2c3c66d407d7af29df1d7d85d62d0679d2218
2022-04-28 16:41:45 +08:00
Yiqing Zeng
2f7b112401 media: i2c: sc530ai change mipi clk to continuous mode
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
Change-Id: If1b9d1b62d61a73a499ca7a15725f0e67156da0b
2022-04-28 14:21:13 +08:00
David Wu
fad85a74d2 ARM: dts: rockchip: rv1106: Add status "okay" property at queue for gmac
The queue nodes will be deleted, the driver cannot get it, add
status "okay" attributes to avoid deletion.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ia0a62d14b3a769e6cc3a631389a54c1190d9d6e2
2022-04-28 12:04:46 +08:00
William Wu
319371ca08 phy: rockchip: inno-usb2: support usb wakeup for rk3568
RK3568 usb phy0 and phy1 linestate irq can be set as
wakeup source, but the default linestate filter time
is based on the usb phy grf pclk 100MHz. So it needs
to reconfigure the linestate filter time base on 32KHz
clk when enter deep sleep.

In addition, it needs to enable the host port (usb3
host1 and usb2 host1) wakeup irq because of legacy
reason.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I9151d49721e8e9d917fdb51228f3ca2627090156
2022-04-28 11:59:34 +08:00
William Wu
c7bcfa4a88 usb: dwc3: gadget: properly handle miss isoc event
If miss isoc event happens, the current code just set
the req status to -EXDEV and giveback the req to the usb
gadget driver, and then stop the active transfer with the
cmd DWC3_DEPCMD_ENDTRANSFER and wait for a XferNotReady
event to restart a transfer again. However, for isoc
ep in transfer, it cause to lost the isoc data of the
req.

This patch moves the miss isoc req to pending_list in
order to restart transfer immediately instead of give
back the req to the usb gadget driver.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Idf38d9fd4d483854473c18f792d1996fb5fcab4b
2022-04-28 11:38:15 +08:00
William Wu
2007d5815e usb: dwc3: gadget: properly skip over trbs on ep_dequeue
The commit a7027ca69d ("usb: dwc3: gadget: Give back
staled requests") move all started request to cancelled
list and expect to give back all the started requests.
However, it fails to give back the started requests
if the dep->flags isn't set to DWC3_EP_TRANSFER_STARTED,
in this case, we need to skip the trbs and giveback the
req. And we also need to skip the trbs of the req in the
pending_list to make the dequeue pointers useless.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I123ff779d5e2933449581f8b570e2e6ad6b75458
2022-04-28 10:00:56 +08:00
Yandong Lin
f673a58a7b video: rockchip: mpp: fix some 8k av1 video crash issue
1.Some 8K frames took more than 200ms to decode,causing software timeout.
Solution:
Increase the software timeout threshold to 500ms

2.After power off av1dec, read/write reg in cache irq causing kernel
crash.
Solution:
There are two irq for av1:
    a. vcd_irq is decode irq what we need to care about.
    b. cache irq what we do not need to care about.
  So disable the cache irq  temporarily.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I282b8e0614321b5adf0fac5f31bb88e2bdb2bf6c
2022-04-28 09:11:35 +08:00
Zhenke Fan
032b9a6afe ARM: dts: rockchip: rv1106-evb-cam: compatible to jx_k17
Signed-off-by: Zhenke Fan <fanzy.fan@rock-chips.com>
Change-Id: Id6aa4dba93669b4cde79d75569946b2a28b025b7
2022-04-28 09:05:20 +08:00
Jiazi Li
2e3c211e7e BACKPORT: dm: fix NULL pointer issue when free bio
dm_io_dec_pending call end_io_acct first, will dec md in-flight
pending count. If a task is swapping table at same time.
task1                             task2
do_resume
 ->do_suspend
  ->dm_wait_for_completion
                                  bio_endio
				   ->clone_endio
				    ->dm_io_dec_pending
				     ->end_io_acct
				      ->wakeup task1
 ->dm_swap_table
  ->__bind
   ->__bind_mempools
    ->bioset_exit
     ->mempool_exit
                                     ->free_io
mempool->elements is NULL, and lead to following crash:
[ 67.330330] Unable to handle kernel NULL pointer dereference at virtual
address 0000000000000000
......
[ 67.330494] pstate: 80400085 (Nzcv daIf +PAN -UAO)
[ 67.330510] pc : mempool_free+0x70/0xa0
[ 67.330515] lr : mempool_free+0x4c/0xa0
[ 67.330520] sp : ffffff8008013b20
[ 67.330524] x29: ffffff8008013b20 x28: 0000000000000004
[ 67.330530] x27: ffffffa8c2ff40a0 x26: 00000000ffff1cc8
[ 67.330535] x25: 0000000000000000 x24: ffffffdada34c800
[ 67.330541] x23: 0000000000000000 x22: ffffffdada34c800
[ 67.330547] x21: 00000000ffff1cc8 x20: ffffffd9a1304d80
[ 67.330552] x19: ffffffdada34c970 x18: 000000b312625d9c
[ 67.330558] x17: 00000000002dcfbf x16: 00000000000006dd
[ 67.330563] x15: 000000000093b41e x14: 0000000000000010
[ 67.330569] x13: 0000000000007f7a x12: 0000000034155555
[ 67.330574] x11: 0000000000000001 x10: 0000000000000001
[ 67.330579] x9 : 0000000000000000 x8 : 0000000000000000
[ 67.330585] x7 : 0000000000000000 x6 : ffffff80148b5c1a
[ 67.330590] x5 : ffffff8008013ae0 x4 : 0000000000000001
[ 67.330596] x3 : ffffff80080139c8 x2 : ffffff801083bab8
[ 67.330601] x1 : 0000000000000000 x0 : ffffffdada34c970
[ 67.330609] Call trace:
[ 67.330616] mempool_free+0x70/0xa0
[ 67.330627] bio_put+0xf8/0x110
[ 67.330638] dec_pending+0x13c/0x230
[ 67.330644] clone_endio+0x90/0x180
[ 67.330649] bio_endio+0x198/0x1b8
[ 67.330655] dec_pending+0x190/0x230
[ 67.330660] clone_endio+0x90/0x180
[ 67.330665] bio_endio+0x198/0x1b8
[ 67.330673] blk_update_request+0x214/0x428
[ 67.330683] scsi_end_request+0x2c/0x300
[ 67.330688] scsi_io_completion+0xa0/0x710
[ 67.330695] scsi_finish_command+0xd8/0x110
[ 67.330700] scsi_softirq_done+0x114/0x148
[ 67.330708] blk_done_softirq+0x74/0xd0
[ 67.330716] __do_softirq+0x18c/0x374
[ 67.330724] irq_exit+0xb4/0xb8
[ 67.330732] __handle_domain_irq+0x84/0xc0
[ 67.330737] gic_handle_irq+0x148/0x1b0
[ 67.330744] el1_irq+0xe8/0x190
[ 67.330753] lpm_cpuidle_enter+0x4f8/0x538
[ 67.330759] cpuidle_enter_state+0x1fc/0x398
[ 67.330764] cpuidle_enter+0x18/0x20
[ 67.330772] do_idle+0x1b4/0x290
[ 67.330778] cpu_startup_entry+0x20/0x28
[ 67.330786] secondary_start_kernel+0x160/0x170

Move end_io_acct after free_io to fix this issue.

Bug: 228982905
Link: https://lore.kernel.org/dm-devel/1632916768-22379-1-git-send-email-lijiazi@xiaomi.com/T/#u
[Akilesh: Resolved merge conflict in drivers/md/dm.c]
Signed-off-by: Jiazi Li <lijiazi@xiaomi.com>
Signed-off-by: Akilesh Kailash <akailash@google.com>
(cherry picked from commit d208b89401)
Change-Id: I9f122cab2af3b961c472b8cf2087399c63c28de1
2022-04-27 22:40:43 +00:00
Marco Elver
aed2e27d51 UPSTREAM: kfence, x86: fix preemptible warning on KPTI-enabled systems
On systems with KPTI enabled, we can currently observe the following
warning:

  BUG: using smp_processor_id() in preemptible
  caller is invalidate_user_asid+0x13/0x50
  CPU: 6 PID: 1075 Comm: dmesg Not tainted 5.12.0-rc4-gda4a2b1a5479-kfence_1+ #1
  Hardware name: Hewlett-Packard HP Pro 3500 Series/2ABF, BIOS 8.11 10/24/2012
  Call Trace:
   dump_stack+0x7f/0xad
   check_preemption_disabled+0xc8/0xd0
   invalidate_user_asid+0x13/0x50
   flush_tlb_one_kernel+0x5/0x20
   kfence_protect+0x56/0x80
   ...

While it normally makes sense to require preemption to be off, so that
the expected CPU's TLB is flushed and not another, in our case it really
is best-effort (see comments in kfence_protect_page()).

Avoid the warning by disabling preemption around flush_tlb_one_kernel().

Link: https://lore.kernel.org/lkml/YGIDBAboELGgMgXy@elver.google.com/
Link: https://lkml.kernel.org/r/20210330065737.652669-1-elver@google.com
Signed-off-by: Marco Elver <elver@google.com>
Reported-by: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Jann Horn <jannh@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit 6a77d38efc)

Bug: 229863099
Signed-off-by: Colin Downs-Razouk <colindr@google.com>
Change-Id: Ia917b052ffbb267254f281f55141c34ad193c78e
2022-04-27 11:12:09 -07:00
Ryun Park
e0513ed978 ANDROID: ABI: Update allowed list for galaxy
Leaf changes summary: 7 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 7 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

7 Added functions:

  [A] 'function int gpiochip_irqchip_add_key(gpio_chip*, irq_chip*, unsigned int, irq_flow_handler_t, unsigned int, bool, lock_class_key*, lock_class_key*)'
  [A] 'function void gpiochip_set_nested_irqchip(gpio_chip*, irq_chip*, unsigned int)'
  [A] 'function usb_request* gs_alloc_req(usb_ep*, unsigned int, gfp_t)'
  [A] 'function void gs_free_req(usb_ep*, usb_request*)'
  [A] 'function void gserial_free_line(unsigned char)'
  [A] 'function void gserial_resume(gserial*)'
  [A] 'function void gserial_suspend(gserial*)'

Bug: 230572486
Change-Id: Ie85627ba247c5bc7f5e9da90934064f9ce5d9ba9
Signed-off-by: Ryun Park <ryun.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2022-04-27 12:54:35 +02:00
Greg Kroah-Hartman
6ed058a9bf ANDROID: abi_gki_aarch64.xml: update based on proper LTO=full setting
Commit 3628acf6b8 ("ANDROID: GKI: Update symbols to
abi_gki_aarch64_oplus") updated the .xml file, but did not do so with
LTO=full so future changes to the symbol list will generate huge churn
in the .xml file masking out any new symbols from the diffstat.

Regenerate the .xml file in order to help clean this up.

Bug: 220957464
Cc: wuzhe <wuzhe@oppo.com>
Fixes: 3628acf6b8 ("ANDROID: GKI: Update symbols to abi_gki_aarch64_oplus")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6784f0414df7af0e6d00d454e47c44c931d529f4
2022-04-27 12:54:28 +02:00
Lei Chen
90d509fc73 drm/bridge: add ite-it6161 driver
Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I19f6aa405978d557bf1f98da7cc5532edd8c94a4
2022-04-27 18:44:13 +08:00
Tony Xie
909476ac67 firmware: rockchip_sip: support cpu on/off for amp os.
Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Change-Id: I723e20cb088063e8f9525b3d64e37090e0a10adf
2022-04-27 18:21:50 +08:00
Steven Liu
53d05c0005 soc: rockchip: amp: support amp driver
1.Protect clock and iomux resources used by AMP.
2.Support AMP cpu on/off.

Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: If53e893fac916217bfa5618350b1706b742b34e7
2022-04-27 18:20:34 +08:00
Lin Jinhan
9044c677ec crypto: rockchip: Optimized the DMA_FD cache flushing policy
Reduce unnecessary DMA_FD flusher to improve performance.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I22f9a7c8373419b74e2e250517b5743034043728
2022-04-27 18:16:08 +08:00
Steven Liu
813cc8110a arm64: dts: rockchip: rk3568: add rk3568-amp.dtsi
Signed-off-by: Steven Liu <steven.liu@rock-chips.com>
Change-Id: I93e64854e053866b6faca68107f6a496f22aa864
2022-04-27 16:47:07 +08:00
Lin Jinhan
16e4dcadf2 crypto: rockchip: rv1126 add gcm support
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I2ef6eec840a3a30547d61253ab1a50b96476d703
2022-04-27 16:45:21 +08:00
Sugar Zhang
6a0cd6ef6d dmaengine: pl330: Improve dma cyclic transfers efficiency
Currently, the driver implements cyclic transfers by desc list.
Each desc describes one period and started by CPU after last
one done(tasklet), which maybe delayed due to schedule or
heavy system load, which will cause device FIFO xrun.

Now, We introduced infinitely cyclic without CPU intervention
to fix this case: each period buffer elapsed, just throwing one
irq to CPU, and keep going transfer without CPU.

e.g. aplay with period-size: 1024, buffer-size: 4096

/# aplay -D hw:0,0 --period-size=1024 --buffer-size=4096 -r 48000
-c 2 -f s16_le /dev/zero

Dump MCGEN:

+ #define PL330_DEBUG_MCGEN

Before:

 916000:  DMAMOV CCR 0x9d0275
 916006:  DMAMOV SAR 0xa34000
 91600c:  DMAMOV DAR 0xffae8030
 916012:  DMALP_1 127
 916014:  DMAFLUSHP 22
 916016:  DMAWFPB 22
 916018:  DMALDB
 916019:  DMASTPB 22
 91601b:  DMALPENDA_1 bjmpto_7
 91601d:  DMASEV 0
 91601f:  DMAEND

 916100:  DMAMOV CCR 0x9d0275
 916106:  DMAMOV SAR 0xa35000
 91610c:  DMAMOV DAR 0xffae8030
 916112:  DMALP_1 127
 916114:  DMAFLUSHP 22
 916116:  DMAWFPB 22
 916118:  DMALDB
 916119:  DMASTPB 22
 91611b:  DMALPENDA_1 bjmpto_7
 91611d:  DMASEV 0
 91611f:  DMAEND

 916000:  DMAMOV CCR 0x9d0275
 916006:  DMAMOV SAR 0xa36000
 91600c:  DMAMOV DAR 0xffae8030
 916012:  DMALP_1 127
 916014:  DMAFLUSHP 22
 916016:  DMAWFPB 22
 916018:  DMALDB
 916019:  DMASTPB 22
 91601b:  DMALPENDA_1 bjmpto_7
 91601d:  DMASEV 0
 91601f:  DMAEND

 916100:  DMAMOV CCR 0x9d0275
 916106:  DMAMOV SAR 0xa37000
 91610c:  DMAMOV DAR 0xffae8030
 916112:  DMALP_1 127
 916114:  DMAFLUSHP 22
 916116:  DMAWFPB 22
 916118:  DMALDB
 916119:  DMASTPB 22
 91611b:  DMALPENDA_1 bjmpto_7
 91611d:  DMASEV 0
 91611f:  DMAEND

 916000:  DMAMOV CCR 0x9d0275
 916006:  DMAMOV SAR 0xa34000
 91600c:  DMAMOV DAR 0xffae8030
 916012:  DMALP_1 127
 916014:  DMAFLUSHP 22
 916016:  DMAWFPB 22
 916018:  DMALDB
 916019:  DMASTPB 22
 91601b:  DMALPENDA_1 bjmpto_7
 91601d:  DMASEV 0
 91601f:  DMAEND

 ...

After:

 916000:  DMAMOV CCR 0x9d0275
 916006:  DMAMOV SAR 0xa34000
 91600c:  DMAMOV DAR 0xffae8030
 916012:  DMALP_0 3
 916014:  DMALP_1 127
 916016:  DMAFLUSHP 22
 916018:  DMAWFPB 22
 91601a:  DMALDB
 91601b:  DMASTPB 22
 91601d:  DMALPENDA_1 bjmpto_7
 91601f:  DMASEV 0
 916021:  DMALPENDA_0 bjmpto_d
 916023:  DMALPFEA_1 bjmpto_1d

Change-Id: Ibbc92c416d0a9dd58633e7991176c86300c3da98
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2022-04-27 16:37:01 +08:00
Jianqun Xu
eb21d6476e video: rockchip: mpp: print err if mpp_task_attach_fd fail
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I0eacd83fb14cc9123a0ab150d93736b11d8f4b67
2022-04-27 16:13:09 +08:00
Jianqun Xu
de3a995b83 scripts/dtc: Support delete unused nodes when CONFIG_ROCKCHIP_MINI_KERNEL=y
Delete nodes in case of:
* node is null, without any property and children node
* node with 'status' property but not "okay" or "ok"

Change-Id: Ic7d2ba1cb60350c21fa6a46222c20870c74359d4
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-04-27 14:47:48 +08:00
Tao Huang
1a11b0aed4 clk: rockchip: rv1106: Support driver probe only when build as module
before:
   text	   data	    bss	    dec	    hex	filename
   6301	  23000	      8	  29309	   727d	drivers/clk/rockchip/clk-rv1106.o
after:
   text	   data	    bss	    dec	    hex	filename
   5483	  22892	      8	  28383	   6edf	drivers/clk/rockchip/clk-rv1106.o

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ibb023c4353fa3bbd85b15d415c46d70774f4fcca
2022-04-27 14:46:48 +08:00
Cai YiWei
94b7ed76f1 media: rockchip: isp: limit bay3d bwsaving config for isp32
Change-Id: Ibf65867506128309076871f682f652021495d641
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-04-27 14:33:27 +08:00
Yu Qiaowei
a29facebc2 video: rockchip: rga3: Fix physical continuous dma_fd not working
Use the driver's mmu configuration to replace the user's mmu configuration.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ib6c535bf0f8d714e6535c27cc0181f5c3a39d7ae
2022-04-27 09:17:53 +08:00
Wang Panzhenzhuan
fd1ab46714 media: i2c: otp_eeprom: fix table_size
1. fix table_size.
2. fix ioctl return value.
3. add version control.

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: Ie6c77d359c1b6c3308b339d129e719eeeae2ddee
2022-04-27 09:15:25 +08:00
Xie Yongji
46f414b1c2 BACKPORT: virtio-blk: Use blk_validate_block_size() to validate block size
The block layer can't support a block size larger than
page size yet. And a block size that's too small or
not a power of two won't work either. If a misconfigured
device presents an invalid block size in configuration space,
it will result in the kernel crash something like below:

[  506.154324] BUG: kernel NULL pointer dereference, address: 0000000000000008
[  506.160416] RIP: 0010:create_empty_buffers+0x24/0x100
[  506.174302] Call Trace:
[  506.174651]  create_page_buffers+0x4d/0x60
[  506.175207]  block_read_full_page+0x50/0x380
[  506.175798]  ? __mod_lruvec_page_state+0x60/0xa0
[  506.176412]  ? __add_to_page_cache_locked+0x1b2/0x390
[  506.177085]  ? blkdev_direct_IO+0x4a0/0x4a0
[  506.177644]  ? scan_shadow_nodes+0x30/0x30
[  506.178206]  ? lru_cache_add+0x42/0x60
[  506.178716]  do_read_cache_page+0x695/0x740
[  506.179278]  ? read_part_sector+0xe0/0xe0
[  506.179821]  read_part_sector+0x36/0xe0
[  506.180337]  adfspart_check_ICS+0x32/0x320
[  506.180890]  ? snprintf+0x45/0x70
[  506.181350]  ? read_part_sector+0xe0/0xe0
[  506.181906]  bdev_disk_changed+0x229/0x5c0
[  506.182483]  blkdev_get_whole+0x6d/0x90
[  506.183013]  blkdev_get_by_dev+0x122/0x2d0
[  506.183562]  device_add_disk+0x39e/0x3c0
[  506.184472]  virtblk_probe+0x3f8/0x79b [virtio_blk]
[  506.185461]  virtio_dev_probe+0x15e/0x1d0 [virtio]

So let's use a block layer helper to validate the block size.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://lore.kernel.org/r/20211026144015.188-5-xieyongji@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 57a13a5b81)
[keirf@: Implement missing error path]
Bug: 226679849
Signed-off-by: Keir Fraser <keirf@google.com>
Change-Id: I78cde1101baf8da2f68d0b9f942a0f1ec89fb30e
(cherry picked from commit 588affc843)
2022-04-26 09:42:49 +00:00
Yandong Lin
4f110adae7 media: rockchip: isp: Refine 1/4 notification msg
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ibf29ecc480458739b6a12a39f7219c81ab3a9db5
2022-04-26 17:33:23 +08:00
Yandong Lin
6c87036e08 video: rockchip: dvbm: Optimize notify frame info to vepu
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib15aed541efdcc4ff1230c7be9e9fa30d816f706
2022-04-26 17:33:23 +08:00
Yu Qiaowei
dfdd460a14 video: rockchip: rga3: initialize temporary ctx
Update driver version to 1.2.10

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I1132b9d7c7d5fc8817c211dc938a6ca5da7c0cfe
2022-04-26 16:36:26 +08:00
Yu Qiaowei
4214a1b887 video: rockchip: rga3: Remove useless structures
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I28e8843c8fc181bdc5652f226e905edd65ba5e6b
2022-04-26 16:36:19 +08:00
Yu Qiaowei
59483bb7f3 video: rockchip: rga3: Refactor rga2_mmu_info.c
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Iee7c73e388c05079d7713e1575dc34a589a7190a
2022-04-26 16:36:11 +08:00
Yu Qiaowei
9985c89e5f video: rockchip: rga3: Remove duplicate logic code in rga_dma_buf.c
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I02f28d80438564a082c691a4116f4a15f161e0db
2022-04-26 16:36:11 +08:00
Yu Qiaowei
0a016e48a9 video: rockchip: rga3: Added YUV420 10bit support in rga_mm
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0ae7f1015cecae24492e3719a4772985eee9333b
2022-04-26 16:36:11 +08:00
Yu Qiaowei
66a7f7e972 video: rockchip: rga3: Switching single-task mode memory processing to rga_mm
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I53a405ca5b9a72e3dc34fc9493a7e89c47e62fad
2022-04-26 16:36:11 +08:00
Shaoxing Chen
49ef86deb9 arm64: dts: rockchip: Change i2c0 pinctrl to i2c0m2 for rk3588-evb4
Signed-off-by: Shaoxing Chen <csx@rock-chips.com>
Change-Id: I7c7baa71a0f7588d4d6a1e758b53210166971ee4
2022-04-26 16:17:44 +08:00
Jianqun Xu
6cc665a643 dma-buf: rk_heaps: rk-cma-heap replace orig_alloc by dmabuf->name
For dmabuf, owner has set a name for the buffer, use the dmabuf->name to
replace orig_alloc to save several memory.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ifad14ed886580d2a9f3000900e1849b0b5a3858e
2022-04-26 15:59:54 +08:00
William Wu
b0cf5382ef usb: gadget: uvc: prepare buffer with data offset for rockchip platform
For some Rockchip platforms (e.g. RV1106 UVC), it needs to
get the offset in the plane which used for the start of data
in the uvc buffer.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I0144709f33b1d3ca955779be487134901468923f
2022-04-26 15:45:19 +08:00
William Wu
f93c20fa43 media: videobuf2: add plane data offset function
Add a new helper function to get the offset in the plane
to the start of data for the usb gadget uvc function.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Id2d2c928a531d0272e6241b967fb0deaf3f3e122
2022-04-26 15:45:01 +08:00
Algea Cao
dbad11d42f drm/bridge: synopsys: dw-hdmi-qp: Support multiple HDMI debugfs nodes
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ib7be546cba2130a84fe4a82194800d143cdb61d9
2022-04-26 15:43:24 +08:00
Zhang Yubing
0e3de5a3c2 drm/rockchip: dw-dp: add hsync limit less than 32
For DPTX controller, It may be work abnormal when hsync less
than 32. Filtering the display mode whose hsyncd is less
than 32.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I857b1f7af51f7c04633526ae9239917e75e3e0d0
2022-04-26 15:19:05 +08:00
Algea Cao
9aeea00e3d phy: rockchip-samsung-hdptx-hdmi: Improve signal quality
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I079521615373b508502e90bf24fea4b7e79815ae
2022-04-26 15:18:11 +08:00
Shawn Lin
3eefc7e584 mmc: dw_mmc: Move FIFO check to other upcoming request for rv1106 sdmmc
We now don't wait FIFO status at the end of request but
at the beginning of upcoming request, which is the same way
we did for unbusy check in the past. By doing that, we can
hand out cpu.

Fixes: 6eca689b99 ("mmc: dw_mmc: Workaround for RV1106/1103 sdmmc")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Ie5934b49d2babada81cc447763bb8f980b4884ec
2022-04-26 14:39:48 +08:00
William Wu
9d8c6e4254 usb: dwc2: hcd: only allow to write packet into TxFIFO in slave mode
The dwc2_queue_transaction() do data transfer for DMA
mode if both the params.host_dma and chan->qh are true.
In a test-case with an otg cable hot plug stress test
in DMA mode, if the chan->qh is NULL, it is possible to
do dwc2_hc_write_packet() which should only be called
in Slave mode and cause a crash:

[  633.852937] usb 1-1: reset high-speed USB device number 71 using dwc2
[  633.853115] Unable to handle kernel read from unreadable memory at virtual address 0000000000000000
...
[  633.974040] Call trace:
[  633.974289]  dwc2_hc_write_packet.isra.6+0xfc/0x128
[  633.974734]  dwc2_queue_transaction+0xc4/0x1f0
[  633.975142]  dwc2_hcd_queue_transactions+0x10c/0x4b8
[  633.975595]  dwc2_release_channel+0x12c/0x2a8
[  633.975992]  dwc2_complete_non_periodic_xfer.isra.5+0x2c/0x48
[  633.976514]  dwc2_hc_xfercomp_intr+0x370/0x488
[  633.976921]  dwc2_hc_n_intr+0x2c8/0x840
[  633.977282]  dwc2_handle_hcd_intr+0x424/0x7e0
[  633.977677]  _dwc2_hcd_irq+0x10/0x18
[  633.978018]  usb_hcd_irq+0x2c/0x48

Change-Id: I33f7976710d6cdceb1b4758655dba7890488585d
Signed-off-by: William Wu <william.wu@rock-chips.com>
2022-04-26 14:15:25 +08:00
Ziyuan Xu
9c7320f123 ARM: dts: rockchip: rv1106g-evb2: change sfc_max_freq to 125MHz
The parent clock of sclk_sfc are 500m_300m_200m_24m, so that can't set
sclk_sfc to 118.8MHz.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I71b60000a465c23e88155ac9da95cf046717a6d8
2022-04-26 14:08:50 +08:00
Zhichao Yu
fc1c261cff ARM: dts: rockchip: rv1103g-38x38-ipc: enable pwm3 for ir led control
Signed-off-by: Zhichao Yu <zhichao.yu@rock-chips.com>
Change-Id: Ife211a219f5e2d0f2bd3a289bd60afd776e45999
2022-04-25 21:04:16 +08:00
Zhichao Yu
b13eeab04d ARM: dts: rockchip: rv1103g-38x38 include rv1103.dtsi
Signed-off-by: Zhichao Yu <zhichao.yu@rock-chips.com>
Change-Id: Ib853a00d11e30eb622f42da29169f2b5fe422fb0
2022-04-25 21:03:25 +08:00
Ziyuan Xu
4337390cb4 ARM: configs: rockchip: rv1106-tb.config: add CONFIG_INITRD_ASYNC
Guarantee that initramfs been mounted until hardware decompress is
completed.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I58fb197040d0c1880e4dd710e99161e19dee26da
2022-04-25 20:58:53 +08:00
Xing Zheng
e116be010f ASoC: codecs: rv1106_codec: fix some acodec handlings
- Remove disable/enable ADC after put ADC mode
- Makes the unity name for ACODEC_ADC_L(R)_DIG_VOL
- Fixes ACODEC_ADC_L_WORK to ACODEC_ADC_R_WORK for right channel

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Change-Id: I21912c96d9ed6954556983745f94ea0e1dbb6283
2022-04-25 20:27:43 +08:00