The issue is that sun4i_pwm_apply() calls sun4i_pwm_calculate() which calls clk_get_rate() while holding a spinlock and clk_get_rate() may sleep.
It's a bug in pwm-sun4i driver. On Wed, Jan 8, 2020 at 4:19 PM @lex <[email protected]> wrote: > > I am doing some experiments with LCD7" with the kernel 5.4.8 and occasionally > i get this crash. > Can someone explain or give some directions on how to find the offending > error based on the crash log? Any idea what could be causing this? > > Jan 8 23:49:43 pine64-plus kernel: [ 5144.681388] BUG: scheduling while > atomic: gsd-backlight-h/3978/0x00000002 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688221] Modules linked in: fuse > rfkill dw_hdmi_i2s_audio snd_soc_hdmi_codec panel_feiyang_fy07024di26a30d > sunxi_cedrus(C) v4l2_mem2mem crct10dif_ce sun8i_drm_hdmi videobuf2_dma_contig > snd_soc_spdif_tx dw_hdmi videobuf2_memops axp20x_adc cec videobuf2_v4l2 > snd_soc_simple_card sunxi_cir axp20x_usb_power axp20x_ac_power > snd_soc_simple_card_utils pinctrl_axp209 axp20x_battery phy_sun6i_mipi_dphy > rc_core videobuf2_common mali(O) sun6i_mipi_dsi sun50i_codec_analog videodev > sun8i_adda_pr_regmap crc_ccitt goodix sun8i_codec sun4i_i2s mc sun4i_drm > sun4i_frontend sun4i_tcon sun8i_mixer sun8i_tcon_top pwm_bl ip_tables > x_tables ipv6 nf_defrag_ipv6 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688331] CPU: 3 PID: 3978 Comm: > gsd-backlight-h Tainted: G C O 5.4.8 #1 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688334] Hardware name: Pine64+ (DT) > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688339] Call trace: > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688357] dump_backtrace+0x0/0x150 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688364] show_stack+0x14/0x20 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688374] dump_stack+0xb4/0xd8 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688384] __schedule_bug+0x50/0x70 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688392] __schedule+0x4bc/0x510 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688397] schedule+0x40/0xd0 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688403] > schedule_preempt_disabled+0x20/0x38 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688410] > __mutex_lock.isra.10+0x150/0x568 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688416] > __mutex_lock_slowpath+0x10/0x18 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688422] mutex_lock+0x38/0x40 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688430] clk_prepare_lock+0x40/0xa0 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688437] clk_get_rate+0x1c/0x70 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688446] sun4i_pwm_apply+0xb4/0x450 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688453] pwm_apply_state+0x64/0x1e8 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688464] > pwm_backlight_update_status+0xb8/0x198 [pwm_bl] > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688473] > backlight_device_set_brightness+0x64/0xb8 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688480] brightness_store+0x78/0x90 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688488] dev_attr_store+0x14/0x28 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688496] sysfs_kf_write+0x3c/0x50 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688501] > kernfs_fop_write+0x144/0x230 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688511] __vfs_write+0x18/0x38 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688517] vfs_write+0xb4/0x1e0 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688524] ksys_write+0x68/0xf8 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688530] > __arm64_sys_write+0x18/0x20 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688540] > el0_svc_common.constprop.2+0x64/0x160 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688547] el0_svc_handler+0x20/0x80 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688552] el0_svc+0x8/0xc > Jan 8 23:49:43 pine64-plus kernel: [ 5144.688694] BUG: scheduling while > atomic: gsd-backlight-h/3978/0x00000000 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695480] Modules linked in: fuse > rfkill dw_hdmi_i2s_audio snd_soc_hdmi_codec panel_feiyang_fy07024di26a30d > sunxi_cedrus(C) v4l2_mem2mem crct10dif_ce sun8i_drm_hdmi videobuf2_dma_contig > snd_soc_spdif_tx dw_hdmi videobuf2_memops axp20x_adc cec videobuf2_v4l2 > snd_soc_simple_card sunxi_cir axp20x_usb_power axp20x_ac_power > snd_soc_simple_card_utils pinctrl_axp209 axp20x_battery phy_sun6i_mipi_dphy > rc_core videobuf2_common mali(O) sun6i_mipi_dsi sun50i_codec_analog videodev > sun8i_adda_pr_regmap crc_ccitt goodix sun8i_codec sun4i_i2s mc sun4i_drm > sun4i_frontend sun4i_tcon sun8i_mixer sun8i_tcon_top pwm_bl ip_tables > x_tables ipv6 nf_defrag_ipv6 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695558] CPU: 3 PID: 3978 Comm: > gsd-backlight-h Tainted: G WC O 5.4.8 #1 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695561] Hardware name: Pine64+ (DT) > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695564] Call trace: > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695579] dump_backtrace+0x0/0x150 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695583] show_stack+0x14/0x20 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695591] dump_stack+0xb4/0xd8 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695600] __schedule_bug+0x50/0x70 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695605] __schedule+0x4bc/0x510 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695610] schedule+0x40/0xd0 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695615] > do_notify_resume+0x1e0/0x398 > Jan 8 23:49:43 pine64-plus kernel: [ 5144.695620] work_pending+0x8/0x10 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.894318] BUG: scheduling while > atomic: gsd-backlight-h/3987/0x00000002 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901147] Modules linked in: fuse > rfkill dw_hdmi_i2s_audio snd_soc_hdmi_codec panel_feiyang_fy07024di26a30d > sunxi_cedrus(C) v4l2_mem2mem crct10dif_ce sun8i_drm_hdmi videobuf2_dma_contig > snd_soc_spdif_tx dw_hdmi videobuf2_memops axp20x_adc cec videobuf2_v4l2 > snd_soc_simple_card sunxi_cir axp20x_usb_power axp20x_ac_power > snd_soc_simple_card_utils pinctrl_axp209 axp20x_battery phy_sun6i_mipi_dphy > rc_core videobuf2_common mali(O) sun6i_mipi_dsi sun50i_codec_analog videodev > sun8i_adda_pr_regmap crc_ccitt goodix sun8i_codec sun4i_i2s mc sun4i_drm > sun4i_frontend sun4i_tcon sun8i_mixer sun8i_tcon_top pwm_bl ip_tables > x_tables ipv6 nf_defrag_ipv6 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901246] CPU: 0 PID: 3987 Comm: > gsd-backlight-h Tainted: G WC O 5.4.8 #1 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901250] Hardware name: Pine64+ (DT) > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901254] Call trace: > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901271] dump_backtrace+0x0/0x150 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901277] show_stack+0x14/0x20 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901286] dump_stack+0xb4/0xd8 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901296] __schedule_bug+0x50/0x70 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901303] __schedule+0x4bc/0x510 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901307] schedule+0x40/0xd0 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901313] > schedule_preempt_disabled+0x20/0x38 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901319] > __mutex_lock.isra.10+0x150/0x568 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901324] > __mutex_lock_slowpath+0x10/0x18 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901330] mutex_lock+0x38/0x40 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901337] clk_prepare_lock+0x40/0xa0 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901343] clk_get_rate+0x1c/0x70 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901352] sun4i_pwm_apply+0xb4/0x450 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901357] pwm_apply_state+0x64/0x1e8 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901368] > pwm_backlight_update_status+0xb8/0x198 [pwm_bl] > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901375] > backlight_device_set_brightness+0x64/0xb8 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901381] brightness_store+0x78/0x90 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901389] dev_attr_store+0x14/0x28 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901396] sysfs_kf_write+0x3c/0x50 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901401] > kernfs_fop_write+0x144/0x230 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901409] __vfs_write+0x18/0x38 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901415] vfs_write+0xb4/0x1e0 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901421] ksys_write+0x68/0xf8 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901427] > __arm64_sys_write+0x18/0x20 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901435] > el0_svc_common.constprop.2+0x64/0x160 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901441] el0_svc_handler+0x20/0x80 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901446] el0_svc+0x8/0xc > Jan 8 23:49:45 pine64-plus kernel: [ 5146.901612] BUG: scheduling while > atomic: gsd-backlight-h/3987/0x00000000 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908388] Modules linked in: fuse > rfkill dw_hdmi_i2s_audio snd_soc_hdmi_codec panel_feiyang_fy07024di26a30d > sunxi_cedrus(C) v4l2_mem2mem crct10dif_ce sun8i_drm_hdmi videobuf2_dma_contig > snd_soc_spdif_tx dw_hdmi videobuf2_memops axp20x_adc cec videobuf2_v4l2 > snd_soc_simple_card sunxi_cir axp20x_usb_power axp20x_ac_power > snd_soc_simple_card_utils pinctrl_axp209 axp20x_battery phy_sun6i_mipi_dphy > rc_core videobuf2_common mali(O) sun6i_mipi_dsi sun50i_codec_analog videodev > sun8i_adda_pr_regmap crc_ccitt goodix sun8i_codec sun4i_i2s mc sun4i_drm > sun4i_frontend sun4i_tcon sun8i_mixer sun8i_tcon_top pwm_bl ip_tables > x_tables ipv6 nf_defrag_ipv6 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908479] CPU: 0 PID: 3987 Comm: > gsd-backlight-h Tainted: G WC O 5.4.8 #1 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908482] Hardware name: Pine64+ (DT) > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908486] Call trace: > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908500] dump_backtrace+0x0/0x150 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908507] show_stack+0x14/0x20 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908517] dump_stack+0xb4/0xd8 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908526] __schedule_bug+0x50/0x70 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908533] __schedule+0x4bc/0x510 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908538] schedule+0x40/0xd0 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908545] > do_notify_resume+0x1e0/0x398 > Jan 8 23:49:45 pine64-plus kernel: [ 5146.908551] work_pending+0x8/0x10 > > > > B.R > > -- > You received this message because you are subscribed to the Google Groups > "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web, visit > https://groups.google.com/d/msgid/linux-sunxi/91a0725f-5ce3-4244-ba98-88c1ea7e7574%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/CA%2BE%3DqVfvgH7%2BhZL_rPkRUuSXoTvPShOQdcDyHxOeL53kH%2B1L-g%40mail.gmail.com.
