When reset the dp controller, if a DP device is connected, the dp
controller will generate a hotplug irq, which is a unexpected hotplug
event.
To filter this hotplug event, disable irq before reset the DP
controller. After dp controller reset, wait the first hotpulg event
then clearing the hotplug interrupt status bit and enable dp
controller irq.
Fixed:
commit f14693316b ("drm/rockchip: dw-dp: reset dp controller status")
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Ic4cabd3b816121b2d1109a5bbfe608f615971953
1. Platforms without MMU do not alloc buffer for mmu_base.
2. Fix deregister using wrong miscdevice structure.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I46613530dd32e6a21abbedc5df31342ab335c607
rk356x cluster:
rgb/yuv format: support non-linear mode only
rk3588 cluster:
rgb format: support linear and non-linear mode
yuv format: support non-linear mode only
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ic5cc4690280ba3974301dfd831b445a8a0f9d6b0
The early fixup for cma reserved memory will do dma contiguous memory
remap, which makes the pages from cma enable to be activated into buddy
system. But the buddy system requires a page must in one pageblock for
possible migrate or compact operation, the pageblock size is usually to
be more than 1 MiB, then the cma size must to be 1 MiB aligned.
On mini kernel, the CMA_INACTIVE makes the cma area not to be activated
into the buddy system, no migrate or compact will happen to pages from
the cma area, in this case, it possible to drop the early fixup to make
the cma base and size align to PAGE_SIZE only. Also it will save several
pages which used to be pte memory for these pages when remap.
Reviewed-by: Simon Xue <xxm@rock-chips.com>
Tested-by: Zhichao Yu <zhichao.yu@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I307e27aaa6e9bcb9cd86414ae7de0f7cfef7b706
If usb gadget isochronous run in a high load and high bus latency
system, it may fail to start a transfer for isochronous endpoint,
and retry 5 times is not enough. This patch increases the retry
times to 50.
Change-Id: Id95a2b4fb09c3103a1da456b6ccb54ed24d03197
Signed-off-by: William Wu <william.wu@rock-chips.com>
The Rockchip DWC3 controllers are LPM capable, but we find
that the UVC function compatibility issue on some Windows PCs
if enable LPM capable. And refer to the Logitech USB Cameras,
they're usually disable LPM capable. Considering that the
benefit form LPM capable is insignificant on RV1106 platforms
with USB Gadget funcitons (UVC & UAC...), so we disable the
LPM capable by default.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I61dadbf7685a0952f5ac82d617e9e95bf7f38123
This patch add the reset/disconnect event info for USB developer
to find that whether the USB is reset or disconnted from USB PHY.
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I889867edc6fd4b4d2fb2927c80d55a850556a8ad
If dwc3 failed to init ep0 in __dwc3_gadget_start(), the ep0state will
be uninitialized, aka, ep0state is EP0_UNCONNECTED, in this case, we
don't need to wait for control transfer completion when stop gadget
because no usb control transfer in process. This patch can help to avoid
the following warning in RK356x Boards during shutdown process.
[ 30.735323] usb ffs open D 0 309 1 0x0400002d
[ 30.735330] Call trace:
[ 30.735336] __switch_to+0xe4/0x138
[ 30.735348] __schedule+0x2f4/0x930
[ 30.735358] schedule+0x38/0xa0
[ 30.735368] schedule_timeout+0x194/0x478
[ 30.735378] wait_for_common+0x130/0x1e8
[ 30.735388] wait_for_completion_timeout+0x10/0x18
[ 30.735399] dwc3_gadget_pullup+0x68/0xc8
[ 30.735411] usb_gadget_disconnect+0xf0/0x110
[ 30.735422] usb_gadget_remove_driver+0x24/0x70
[ 30.735431] usb_gadget_unregister_driver+0xd0/0x120
[ 30.735441] unregister_gadget+0x20/0x50
[ 30.735450] unregister_gadget_item+0x24/0x38
[ 30.735461] ffs_data_clear+0x120/0x130
[ 30.735471] ffs_data_reset+0x14/0x58
[ 30.735480] ffs_data_closed+0x88/0xd8
[ 30.735490] ffs_ep0_release+0x10/0x20
[ 30.735501] __fput+0x88/0x1b8
[ 30.735510] ____fput+0xc/0x18
[ 30.735521] task_work_run+0x94/0xb0
[ 30.735531] do_exit+0x334/0xa28
[ 30.735540] do_group_exit+0x34/0x98
[ 30.735550] get_signal+0xe4/0x828
[ 30.735557] do_signal+0x1c0/0x298
[ 30.735563] do_notify_resume+0xd0/0x118
[ 30.735568] work_pending+0x8/0x10
[ 30.735602] sysrq: Kill All Tasks
Change-Id: I3534b710804e099d857149b0b0b58a7a7236b8fc
Signed-off-by: William Wu <william.wu@rock-chips.com>
When we use /sys/class/udc/<udc>/soft_connect to do
a logical disconnection from the USB Host on RK3399
Excavator Board, it dumps the warning log:
Trying to free already-free IRQ 231
WARNING: CPU: 2 PID: 1308 at kernel/irq/manage.c:1628 __free_irq+0xa0/0x2e0
Modules linked in:
CPU: 2 PID: 1308 Comm: adbd Not tainted 4.19.80 #49
Hardware name: Rockchip RK3399 Excavator Board edp avb (Android) (DT)
pstate: 40400085 (nZcv daIf +PAN -UAO)
pc : __free_irq+0xa0/0x2e0
lr : __free_irq+0xa0/0x2e0
...
Call trace:
__free_irq+0xa0/0x2e0
free_irq+0x38/0x90
dwc3_gadget_stop+0x58/0x80
usb_gadget_remove_driver+0x50/0x70
usb_gadget_unregister_driver+0xc0/0x110
unregister_gadget+0x20/0x50
unregister_gadget_item+0x24/0x38
ffs_data_clear+0x120/0x130
ffs_data_reset+0x14/0x50
ffs_data_closed+0x88/0xd8
ffs_epfile_release+0x20/0x30
To solve the problem, don't call free_irq() in
dwc3_gadget_stop() if dwc->gadget_driver is NULL.
Change-Id: I9d5b5b354612c3ce3677b3d15cf6af1fcbf3f399
Signed-off-by: William Wu <william.wu@rock-chips.com>
Copy a description from the ARCH_DMA_MINALIGN definition:
--
Some archs want to perform DMA into kmalloc caches and need a guaranteed
alignment larger than the alignment of a 64-bit integer.
Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
For a specific product, which can make sure that the kmalloc won't used
by DMA, then it can set the kmalloc min size lower than arch dma min
alignment.
For ROCKCHIP_MINI_KERNEL, we can try to do it.
Before this patch:
Name Objects Objsize Loss Slabs/Part/Cpu
kmalloc-8 2419 8 155.6 37/1/1
kmalloc-16 2669 16 180.2 43/3/1
kmalloc-32 1726 32 110.5 26/1/1
kmalloc-64 1013 64 69.6 16/4/1
kmalloc-96 658 96 86 20/2/1
kmalloc-128 352 128 45 10/0/1
kmalloc-192 567 192 110.5 26/0/1
kmalloc-256 140 256 36.8 8/1/1
kmalloc-512 311 512 172 41/5/1
kmalloc-1k 104 1024 139.2 16/5/1
kmalloc-2k 40 2048 81.9 4/0/1
kmalloc-4k 590 4096 2458 73/1/1
kmalloc-8k 8 8192 65.5 1/0/1
With this patch:
kmalloc-8 2560 8 20.4 4/0/1
kmalloc-16 2811 16 57.3 13/5/1
kmalloc-32 1791 32 57.3 13/1/1
kmalloc-64 1017 64 65.5 15/2/1
kmalloc-96 660 96 65.5 15/3/1
kmalloc-128 352 128 45 10/0/1
kmalloc-192 567 192 110.5 26/0/1
kmalloc-256 140 256 36.8 8/1/1
kmalloc-512 311 512 172 41/5/1
kmalloc-1k 105 1024 139.2 16/5/1
kmalloc-2k 40 2048 81.9 4/0/1
kmalloc-4k 590 4096 2458 73/1/1
kmalloc-8k 8 8192 65.5 1/0/1
Save about 300K.
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ifa2a7ab13481180cc45c7b59e3a744f68f46aab5
When both cores are used on encoding and the first task on core 0 is
finished the next task on core 0 may use the same txid as the finished
task. It will delay the running task on core 1.
So we have to find a unused txid to remap the txid in logic. And the
both logical id and remap id should be record for each dchs status.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I35e6a05bb879d9f389f308ad87bf62b0f20f3c6c
Fixes: 7bb3c2ecbd ("soc: rockchip: cpuinfo: Support building as module")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I7841dffd35b49571578dbfd8787741a2cd504bc5
Fixes: 697bbdf85b ("drm/panel: simple: Add support loader protect and power invert")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I60cec15818adc26f8c7dbb8867426fafddcd365a
NOR flash erase takes more than tens of milliseconds, so msleep can
better avoid frequent IO waiting actions.
Change-Id: I0c10ddd33dd3d3d34b0fb5d662be67a4549d0da2
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>