when we create a kthread with ktrhead_create_on_cpu(),the child thread
entry is ktread.c:ktrhead() which will be preempted by the parent after
call complete(done) while schedule() is not called yet,then the parent
will call wait_task_inactive(child) but the child is still on the runqueue,
so the parent will schedule_hrtimeout() for 1 jiffy,it will waste a lot of
time,especially on startup.
parent child
ktrhead_create_on_cpu()
wait_fo_completion(&done) -----> ktread.c:ktrhead()
|----- complete(done);--wakeup and preempted by parent
kthread_bind() <------------| |-> schedule();--dequeue here
wait_task_inactive(child) |
schedule_hrtimeout(1 jiffy) -|
So we hope the child just wakeup parent but not preempted by parent, and the
child is going to call schedule() soon,then the parent will not call
schedule_hrtimeout(1 jiffy) as the child is already dequeue.
The same issue for ktrhead_park()&&kthread_parkme().
This patch can save 120ms on rk312x startup with CONFIG_HZ=300.
Change-Id: I2ae4edb538ea6f55cf5b8f8b5dc6311d1811a4ae
Signed-off-by: Liang Chen <cl@rock-chips.com>
The rockchip pinctrl creates an irq domain by irq_domain_add_linear,
but it not means all pins' irq are in linear.
Such as rk808 interrupt, it defines in node:
rk808 {
interrupt-parent = <&gpio1>;
interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
}
then i2c core driver will get virq by
irq = of_irq_get(dev->of_node, 0);
->irq_create_of_mapping(&oirq);
finally the rk808 irq is mapping in DOMAIN_BUS_WIRED irq domain.
It's better to get virq by irq_find_mapping.
Change-Id: Ib416ace5c2212c9a704b01e78f77d3425dc8d21b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
It takes time to create irq mapping for all pins in probe, remove
it since the mapping will be created in gpio_to_irq.
Change-Id: Idec03ea43711335190cf440fa30f9f4c654e4540
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Since all pins have been created mapping in probe, the create
mapping operation in gpio_to_irq will never happen, the issue
is hidened.
The patch add clk_enable/disable for gpio_to_irq.
Change-Id: I50c945f95f9f66ed3ab83a8c332893151272e9f6
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
The INNO MIPI D-PHY is built in witch a standard digital interface
to talk to any third part Host controller.That is part of Rockchip SoCs,
like rk3368.
Change-Id: I9806882e0e3fb6b20348015d0f34923d1bc46b89
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
This reverts commit 4ef2449889.
The description for CRU_EMMC/SDMMC/SDIO_CON[0/1] is jumble on
chapters, make it clear that the correct shift is 1 that from
IC engineer.
Change-Id: I48dce293ec6ef82a5c78db38efc083227776ea99
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
ov13850 camera module used by rk3288 evb board
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I23ad3dcb06a9f5c748a9399f5d4e9e9b1936ca52
We have removed the driver dwc3-rockchip-inno, and the hclk_usb_peri
is controlled by clock system framework instead of USB driver.
This reverts commit 24992130f2.
Change-Id: I947342389a0f85bb7f322c3481349a3ee2d56298
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
We have removed the driver dwc3-rockchip-inno, and the hclk_usb_peri
is controlled by clock system framework instead of USB driver.
This reverts commit 00c75f4839.
Change-Id: I4184b074f1946f4ee8bd68c4dac5ff725272dfe7
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
1.Fixup memleak on pvr_create_pt_fence
2.Fixup crash on pvr_sync_has_signal
Change-Id: I999c8e96d0cab2814f5fdfbd8ea57ae6c30cd961
Signed-off-by: Li Huang <putin.li@rock-chips.com>
1、Change Android sync to sync_file
2、Fixup compile error on 4.19
3、Fixup some crash on 4.19
4、Fixup some clang waring
5、Fixup clang warning
Change-Id: Ie59a9252116f6e7cc97f5f9b9a25ae6d5d5f82b1
Signed-off-by: Li Huang <putin.li@rock-chips.com>
If a configs function sets bind_deactivated flag, upon removal it will be
left with an unbalanced deactivation. Let's make sure that we conditionally
call usb_function_activate() from purge_configs_funcs() and make sure
purge_configs_funcs() is called from configfs_composite_unbind().
Change-Id: Ibe91837fdb7754f8af343a18138556901a0e089f
Signed-off-by: William Wu <william.wu@rock-chips.com>
Fix the following build warnings in configfs driver instead of
scripts/gcc-wrapper.py.
"configfs.c:1488", # drivers/usb/gadget/configfs.c:1488:12: warning: 'configfs_composite_setup' defined but not used
"configfs.c:1513", # drivers/usb/gadget/configfs.c:1513:13: warning: 'configfs_composite_disconnect' defined but not used
Fixes: a77196fc01 ("ANDROID: usb: gadget: configfs: Add Uevent to notify userspace")
Change-Id: I58ef495d6e84af8000d0bd7a3ce3a2ed7947b71f
Signed-off-by: William Wu <william.wu@rock-chips.com>
1.When the system starts, enable vcc_lcd.
2.when the System sleep, disable vcc_lcd.
Change-Id: I29afc3e98a8cbe7ded65a8b9de1990fa2ea26b53
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
merge cmd:
MPP_CMD_SET_REG -->
MPP_CMD_SET_VEPU22_CFG -->
MPP_CMD_SET_RKVENC_OSD_PLT --> MPP_CMD_SET_REG_WRITE
MPP_CMD_SET_RKVENC_L2_REG -->
change cmd:
MPP_CMD_GET_REG --> MPP_CMD_SET_REG_READ
tips:
1. the xx_WRITE cmd is to write register, while xx_READ cmd is to
read register.
2. move MPP_CMD_GET_REG to MPP_CMD_SET_REG_READ, then it can set
output when input.
Change-Id: Iee1d5c6aafdfea5e0d02d1865cd06079ef5f716b
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
If the USB cable is unplugged when powered on or connected to PC,
it will cause the system to freeze. The final log is as follows:
[ 5.109122] read descriptors
[ 5.109180] read strings
[ 5.113205] udc fe800000.dwc3: registering UDC driver [g1]
The crash is caused by visit registers of dwc3 when PD is off. the
function dwc3_gadget_set_speed is added in udc_bind_to_driver in
kernel 4.19 update. We need jump of this function when dwc3 is
suspended.
Change-Id: Ie0337aaf225543b4e9e05ee57a5eb7416797d56e
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
To avoid the potential parent PLL clock of display being
closed when PD is shutdown, excute protect loader clocks
earlier.
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I5125590aac51b423e7e9fdc0032da9185c450be1
Add IOMMU_TLB_SHOT_ENTIRE prot for iommu_map_sg, this shoot down entire
iommu tlb one time after iommu_map_sg.This may save about 5ms when DRM
mapping 12MB buffer.
Change-Id: I618aff1b3928bd1ec1dd3d896db746e09e96acdc
Signed-off-by: Simon Xue <xxm@rock-chips.com>
This patch is used by android 8+ system on RK3368 SoCs.
When drm to free object, it needs map sg again when alloc it next
time. For RK3368 SoCs' system, one dma buffer may used by ion and
drm devices together, it spend time to map sg, this patch remove
the destroy object and do it after final dma_buf_put.
Change-Id: Ia39a3d4691f0b545039efb880c999a35886178a0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This patch is required by system on RK3368 SoCs.
Since its system used ion and drm drivers together, one dma-buf
may used by two devices, if one device deattached buffer, then
the other one need to map sg again, that takes time several ms.
The patch fix it by set buffer release operation in a list, and
do release after final dma_buf_put.
Change-Id: Ibfb4ffe3d97fae0a27f20032fdfbc3cc561aa375
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>