Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1700732 > unrolled thread
| Started by | Mark Yao <mark.yao@rock-chips.com> |
|---|---|
| First post | 2017-08-01 10:20 +0200 |
| Last post | 2017-08-04 05:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v1.1] drm/rockchip: fix race with kms hotplug and fbdev Mark Yao <mark.yao@rock-chips.com> - 2017-08-01 10:20 +0200
Re: [PATCH v1.1] drm/rockchip: fix race with kms hotplug and fbdev Sandy Huang <sandy.huang@rock-chips.com> - 2017-08-04 05:30 +0200
| From | Mark Yao <mark.yao@rock-chips.com> |
|---|---|
| Date | 2017-08-01 10:20 +0200 |
| Subject | [PATCH v1.1] drm/rockchip: fix race with kms hotplug and fbdev |
| Message-ID | <u9Azf-Lh-7@gated-at.bofh.it> |
According to the kerneldoc[0], should do fbdev setup before calling drm_kms_helper_poll_init(), otherwise, Kms hotplug event may race into fbdev helper initial, and fb_helper->dev may be NULL pointer, that would cause the bug: [ 0.735411] [00000200] *pgd=00000000f6ffe003, *pud=00000000f6ffe003, *pmd=0000000000000000 [ 0.736156] Internal error: Oops: 96000005 [#1] PREEMPT SMP [ 0.736648] Modules linked in: [ 0.736930] CPU: 2 PID: 20 Comm: kworker/2:0 Not tainted 4.4.41 #20 [ 0.737480] Hardware name: Rockchip RK3399 Board rev2 (BOX) (DT) [ 0.738020] Workqueue: events cdn_dp_pd_event_work [ 0.738447] task: ffffffc0f21f3100 ti: ffffffc0f2218000 task.ti: ffffffc0f2218000 [ 0.739109] PC is at mutex_lock+0x14/0x44 [ 0.739469] LR is at drm_fb_helper_hotplug_event+0x30/0x114 [ 0.756253] [<ffffff8008a344f4>] mutex_lock+0x14/0x44 [ 0.756260] [<ffffff8008445708>] drm_fb_helper_hotplug_event+0x30/0x114 [ 0.756271] [<ffffff8008473c84>] rockchip_drm_output_poll_changed+0x18/0x20 [ 0.756280] [<ffffff8008439fcc>] drm_kms_helper_hotplug_event+0x28/0x34 [ 0.756286] [<ffffff800846c444>] cdn_dp_pd_event_work+0x394/0x3c4 [ 0.756295] [<ffffff80080b2b38>] process_one_work+0x218/0x3e0 [ 0.756302] [<ffffff80080b3538>] worker_thread+0x2e8/0x404 [ 0.756308] [<ffffff80080b7e70>] kthread+0xe8/0xf0 [ 0.756316] [<ffffff8008082690>] ret_from_fork+0x10/0x40 [0]: https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms-helpers.html Signed-off-by: Mark Yao <mark.yao@rock-chips.com> --- Changes in v1.1: - According to the kerneldoc, fix the race bug in generic way. drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 848edcf..c41f48a 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -161,22 +161,21 @@ static int rockchip_drm_bind(struct device *dev) */ drm_dev->irq_enabled = true; - /* init kms poll for handling hpd */ - drm_kms_helper_poll_init(drm_dev); - ret = rockchip_drm_fbdev_init(drm_dev); if (ret) - goto err_kms_helper_poll_fini; + goto err_unbind_all; + + /* init kms poll for handling hpd */ + drm_kms_helper_poll_init(drm_dev); ret = drm_dev_register(drm_dev, 0); if (ret) - goto err_fbdev_fini; + goto err_kms_helper_poll_fini; return 0; -err_fbdev_fini: - rockchip_drm_fbdev_fini(drm_dev); err_kms_helper_poll_fini: drm_kms_helper_poll_fini(drm_dev); + rockchip_drm_fbdev_fini(drm_dev); err_unbind_all: component_unbind_all(dev, drm_dev); err_mode_config_cleanup: -- 1.9.1
[toc] | [next] | [standalone]
| From | Sandy Huang <sandy.huang@rock-chips.com> |
|---|---|
| Date | 2017-08-04 05:30 +0200 |
| Message-ID | <uaBtf-1rM-7@gated-at.bofh.it> |
| In reply to | #1700732 |
Hi Mark, 在 2017/8/1 16:11, Mark Yao 写道: > According to the kerneldoc[0], should do fbdev setup before calling > drm_kms_helper_poll_init(), otherwise, Kms hotplug event may race > into fbdev helper initial, and fb_helper->dev may be NULL pointer, > that would cause the bug: > [ 0.735411] [00000200] *pgd=00000000f6ffe003, *pud=00000000f6ffe003, *pmd=0000000000000000 > [ 0.736156] Internal error: Oops: 96000005 [#1] PREEMPT SMP > [ 0.736648] Modules linked in: > [ 0.736930] CPU: 2 PID: 20 Comm: kworker/2:0 Not tainted 4.4.41 #20 > [ 0.737480] Hardware name: Rockchip RK3399 Board rev2 (BOX) (DT) > [ 0.738020] Workqueue: events cdn_dp_pd_event_work > [ 0.738447] task: ffffffc0f21f3100 ti: ffffffc0f2218000 task.ti: ffffffc0f2218000 > [ 0.739109] PC is at mutex_lock+0x14/0x44 > [ 0.739469] LR is at drm_fb_helper_hotplug_event+0x30/0x114 > [ 0.756253] [<ffffff8008a344f4>] mutex_lock+0x14/0x44 > [ 0.756260] [<ffffff8008445708>] drm_fb_helper_hotplug_event+0x30/0x114 > [ 0.756271] [<ffffff8008473c84>] rockchip_drm_output_poll_changed+0x18/0x20 > [ 0.756280] [<ffffff8008439fcc>] drm_kms_helper_hotplug_event+0x28/0x34 > [ 0.756286] [<ffffff800846c444>] cdn_dp_pd_event_work+0x394/0x3c4 > [ 0.756295] [<ffffff80080b2b38>] process_one_work+0x218/0x3e0 > [ 0.756302] [<ffffff80080b3538>] worker_thread+0x2e8/0x404 > [ 0.756308] [<ffffff80080b7e70>] kthread+0xe8/0xf0 > [ 0.756316] [<ffffff8008082690>] ret_from_fork+0x10/0x40 > > [0]: https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms-helpers.html > > Signed-off-by: Mark Yao <mark.yao@rock-chips.com> > --- > Changes in v1.1: > - According to the kerneldoc, fix the race bug in generic way. > > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > Reviewed-by: Sandy huang <sandy.huang@rock-chips.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web