mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
927ec427493fb894ed3ca7a17174cb7ddcbc7dba
In the past, the flag &rockchip_pwm_chip.oneshot_en may not represent
the accurate enabled status for oneshot mode, because the oneshot mode
should be active after setting the 'pwm_en' bit. Therefore, we add the
&rockchip_pwm_chip.oneshot_valid to represent the validity of oneshot
configurations, and &rockchip_pwm_chip.oneshot_en does what it should
do.
In addition, the disabling of oneshot mode does not need to delay one
period(related commit 42e759004f ("pwm: rockchip: add one period
delay before disabling the dclk")). It will end after the last period
sent.
What's more serious, the disabling process may be done in interrupt
handler for oneshot mode(The handler is flexible for user as designed),
so it is unreasonable to call fsleep() in the interrupt handler, which
may cause the following error with 100000ns period:
[ 6.517981] BUG: scheduling while atomic: swapper/0/0/0x00010000
[ 6.518045] Modules linked in:
[ 6.518060] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.1.118 #944
[ 6.518069] Hardware name: Rockchip RK3576 EVB1 V10 Board (DT)
[ 6.518078] Call trace:
[ 6.518085] dump_backtrace+0xd8/0x130
[ 6.518108] show_stack+0x1c/0x30
[ 6.518118] dump_stack_lvl+0x64/0x7c
[ 6.518132] dump_stack+0x14/0x2c
[ 6.518141] __schedule_bug+0x58/0x70
[ 6.518155] __schedule+0x6f0/0x7c0
[ 6.518164] schedule+0x54/0xe0
[ 6.518172] schedule_hrtimeout_range_clock+0xa8/0x144
[ 6.518184] schedule_hrtimeout_range+0x18/0x20
[ 6.518193] usleep_range_state+0x7c/0xb0
[ 6.518204] rockchip_pwm_enable_v4+0xc8/0x104
[ 6.518219] rockchip_pwm_apply+0x80/0x190
[ 6.518229] pwm_apply_state+0x68/0x190
[ 6.518239] rockchip_pwm_irq_v4+0x7c/0x1b0
[ 6.518250] __handle_irq_event_percpu+0x58/0x1d0
[ 6.518265] handle_irq_event+0x4c/0x110
[ 6.518276] handle_fasteoi_irq+0xc0/0x24c
[ 6.518290] generic_handle_domain_irq+0x30/0x44
[ 6.518302] gic_handle_irq+0x60/0x90
[ 6.518312] call_on_irq_stack+0x24/0x34
[ 6.518323] do_interrupt_handler+0x80/0x94
[ 6.518333] el1_interrupt+0x44/0xa0
[ 6.518345] el1h_64_irq_handler+0x14/0x20
[ 6.518357] el1h_64_irq+0x74/0x78
[ 6.518366] cpuidle_enter_state+0xbc/0x434
[ 6.518382] cpuidle_enter+0x3c/0x50
[ 6.518393] do_idle+0x228/0x2b0
[ 6.518405] cpu_startup_entry+0x38/0x40
[ 6.518416] kernel_init+0x0/0x12c
[ 6.518425] arch_post_acpi_subsys_init+0x0/0x18
[ 6.518439] start_kernel+0x6b0/0x6ec
[ 6.518450] __primary_switched+0xb4/0xbc
This patch will also help to avoid the above abnormal situation.
Change-Id: I0df715921d79803f06329a71b966a4ae40876f33
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
…
…
…
…
…
…
…
…
…
…
Linux kernel
============
There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.
In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``. The formatted documentation can also be read online at:
https://www.kernel.org/doc/html/latest/
There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
Languages
C
97.7%
Assembly
1.6%
Makefile
0.3%
Perl
0.1%