In following scenario(diagram), when one thread X running dev_coredumpm()
adds devcd device to the framework which sends uevent notification to
userspace and another thread Y reads this uevent and call to
devcd_data_write() which eventually try to delete the queued timer that
is not initialized/queued yet.
So, debug object reports some warning and in the meantime, timer is
initialized and queued from X path. and from Y path, it gets reinitialized
again and timer->entry.pprev=NULL and try_to_grab_pending() stucks.
To fix this, introduce mutex and a boolean flag to serialize the behaviour.
cpu0(X) cpu1(Y)
dev_coredump() uevent sent to user space
device_add() ======================> user space process Y reads the
uevents writes to devcd fd
which results into writes to
devcd_data_write()
mod_delayed_work()
try_to_grab_pending()
del_timer()
debug_assert_init()
INIT_DELAYED_WORK()
schedule_delayed_work()
debug_object_fixup()
timer_fixup_assert_init()
timer_setup()
do_init_timer()
/*
Above call reinitializes
the timer to
timer->entry.pprev=NULL
and this will be checked
later in timer_pending() call.
*/
timer_pending()
!hlist_unhashed_lockless(&timer->entry)
!h->pprev
/*
del_timer() checks h->pprev and finds
it to be NULL due to which
try_to_grab_pending() stucks.
*/
Bug: 235577024
Change-Id: I5e86abf72e8dff6952ba493fd9f43a26b2b40352
Link: https://lore.kernel.org/lkml/2e1f81e2-428c-f11f-ce92-eb11048cb271@quicinc.com/
Link: https://lore.kernel.org/lkml/1653660220-19197-1-git-send-email-quic_mojha@quicinc.com/
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
The rknpu driver creates a sg without page link, so sg_phys(sg) will
crash due to page null.
Fixes: 33b98bf612 ("dma-buf: system_heap: do force sync only if attachment list empty")
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I679122dd4c1663d0520429638565c6cc8b5a2c90
The memory volt may be different from vdd voltage, for example the dmc.
Fixes: eb910e20ee ("soc: rockchip_system_monitor: Add support to change mem volt when low temp")
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I4485d4218e3e1fb22aaba0f0ce388036e50d52ff
Modify the dts for the combophy:
1. assign clock to 100MHz
2. add "rockchip,ext-refclk"
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I72c125ac6aa42dcf00761f32e20b10042fd9985d
scatterlist nents would change to 1 after dma_map_sg if iommu enabled.
So invalid or clean should use orig_nents to indicate the scatterlist
true nents if user miss the callback prepare and finish of struct vb2_mem_ops.
Change-Id: Iabb4c140d64e79eb16b93cab0fee488fe4ba4b68
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Make slub sysfs interface selectable.
Save about 4.8ms of boot time on RK1808 EVB if unselected.
Change-Id: I2587cc259c3c31a209604d99640d8e84a4ba78f4
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Kernel image size and bootup time are almost unchanged
because the drivers are compiled as modules.
Signed-off-by: Elon Zhang <zhangzj@rock-chips.com>
Change-Id: I2aa77be64be0a96b7a944ded07922de073aa6d60
The current limitation of possible number of requests being handled is
dependent on the gadget speed. It makes more sense to depend on the
typical frame size when calculating the number of requests. This patch
is changing this and is using the previous limits as boundaries for
reasonable minimum and maximum number of requests.
For a 1080p jpeg encoded video stream with a maximum imagesize of
e.g. 800kB with a maxburst of 8 and an multiplier of 1 the resulting
number of requests is calculated to 49.
800768 1
nreqs = ------ * -------------- ~= 49
2 (1024 * 8 * 1)
Tested-by: Dan Vacura <w36195@motorola.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20220529223848.105914-2-m.grzeschik@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 234757296
(cherry picked from commit 87d76b5f1dhttps://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Change-Id: I0228cbaa56d4e75bed33e1ef721ae3127d779faf
Signed-off-by: Dan Vacura <w36195@motorola.com>
The hardware (except for the ROCKCHIP_SPI_VER2_TYPE2 version) does not
support active-high native chip selects. However if such a CS is configured
the core does not error as it normally should, because the
'ctlr->use_gpio_descriptors = true' line in rockchip_spi_probe() makes the
core set SPI_CS_HIGH in ctlr->mode_bits.
In such a case the spi-rockchip driver operates normally but produces an
active-low chip select signal without notice.
There is no provision in the current core code to handle this
situation. Fix by adding a check in the ctlr->setup function (similarly to
what spi-atmel.c does).
This cannot be done reading the SPI_CS_HIGH but in ctlr->mode_bits because
that bit gets always set by the core for master mode (see above).
Fixes: eb1262e3cc ("spi: spi-rockchip: use num-cs property and ctlr->enable_gpiods")
Change-Id: I3e1065973cd5f3deac486bbc9a3bad230ace4971
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://lore.kernel.org/r/20220421213251.1077899-1-luca.ceresoli@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit d5d933f09a)
The tracing_is_on interface has been exported, add it to the symbol table so that we can use it in the external module.
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable
1 Added function:
[A] 'function int tracing_is_on()'
Bug: 193384408
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: If9f923850ab1db76214240efd8337211972d3a67
Startup time : increase about 1ms (test on RMSL_V10 board).
Firmware size : increase about 4KByte.
Signed-off-by: Wang Xiaobin <xb.wang@rock-chips.com>
Change-Id: I9627eb7491ff58cb9be060d978d4568963703cb3
Startup time : increase about 1ms.
Firmware size : increase about 1KByte.
Signed-off-by: Wang Xiaobin <xb.wang@rock-chips.com>
Change-Id: Idbc7828cf89eec88dc7b50483c51536dda46036d
volt will be used as start_volt in next loop, so ensure volt is not
greater than volt_max.
Fixes: b6c7d8fb46 (soc: rockchip: opp_select: calibrate opp-table by pvtpll)
Change-Id: Ifc8f75075ad137483d1c8f603423b2d5f2e119ce
Signed-off-by: Liang Chen <cl@rock-chips.com>
Add force clear before each task to avoid pagefault which is caused by
invalid fbc header data.
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Signed-off-by: Siyong Chen <sayon.chen@rock-chips.com>
Change-Id: Idb81e3aa4875e890afa3ec7aecfd25da84e618ae
sc132gs is an IR sensor that no need to process by isp.
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I43eadf141556e607f81e281030b1bf292b711bc1
Use its own RK3588_PLLCON(), maybe RK3399_PLLCON() was
brought when copy RK3399 code.
Fixes: 58c1fa2ef2 ("clk: rockchip: add pll type for RK3588")
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I551c1d39073f2eba4837bd702f9c2172bfecbd65
isp_raw_clk auto-gate and lsc ram config need lsc enable
Change-Id: Id257c40bea4fea0bf89b799bbcb127a4827d5394
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
Don't set the frequency to 1.25 times in hdptx_phy_clk_set_rate,
hdptx_ropll_cmn_config has already done this.
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ic9728308ca88edb158f11f70af6d9d7b95825ef9
ISP's parents are CLK_339M_SRC and CLK_200M_SRC, 4M/30fps requires
264M for better power and performance. But it can only get 200M as
CLK_200M_SRC is the closest clk src than CLK_339M_SRC.
CLK_339M_SRC only outputs for ISP and VICAP modules, it's fine to
change CLK_339M_SRC to 264MHz.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I9d349ec7e1dc29f2f6ecdda954a6c0419b9b7d89
Startup time : almost unchanged (<1ms).
Firmware size : reduce about 7KByte.
Signed-off-by: Wang Xiaobin <xb.wang@rock-chips.com>
Change-Id: I6b744b3069c4bdda4714c9674735e68a057e1b2d