From: Greg Kroah-Hartman Date: Fri, 8 Sep 2017 07:25:11 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.13.1~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d25cd8d4f575091bf9a989a2995c4275d80500c8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: drm-bridge-adv7511-switch-to-using-drm_kms_helper_hotplug_event.patch drm-bridge-adv7511-use-work_struct-to-defer-hotplug-handing-to-out-of-irq-context.patch --- diff --git a/queue-4.9/drm-bridge-adv7511-switch-to-using-drm_kms_helper_hotplug_event.patch b/queue-4.9/drm-bridge-adv7511-switch-to-using-drm_kms_helper_hotplug_event.patch new file mode 100644 index 00000000000..0927ba4ca30 --- /dev/null +++ b/queue-4.9/drm-bridge-adv7511-switch-to-using-drm_kms_helper_hotplug_event.patch @@ -0,0 +1,64 @@ +From 6d5104c5a6b56385426e15047050584794bb6254 Mon Sep 17 00:00:00 2001 +From: John Stultz +Date: Mon, 16 Jan 2017 16:52:48 -0800 +Subject: drm/bridge: adv7511: Switch to using drm_kms_helper_hotplug_event() + +From: John Stultz + +commit 6d5104c5a6b56385426e15047050584794bb6254 upstream. + +In chasing down a previous issue with EDID probing from calling +drm_helper_hpd_irq_event() from irq context, Laurent noticed +that the DRM documentation suggests that +drm_kms_helper_hotplug_event() should be used instead. + +Thus this patch replaces drm_helper_hpd_irq_event() with +drm_kms_helper_hotplug_event(), which requires we update the +connector.status entry and only call _hotplug_event() when the +status changes. + +Cc: David Airlie +Cc: Archit Taneja +Cc: Wolfram Sang +Cc: Lars-Peter Clausen +Cc: Laurent Pinchart +Cc: dri-devel@lists.freedesktop.org +Reviewed-by: Laurent Pinchart +Tested-by: Laurent Pinchart +Signed-off-by: John Stultz +Signed-off-by: Archit Taneja +Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-3-git-send-email-john.stultz@linaro.org +Signed-off-by: Thong Ho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c ++++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +@@ -405,8 +405,22 @@ static bool adv7511_hpd(struct adv7511 * + static void adv7511_hpd_work(struct work_struct *work) + { + struct adv7511 *adv7511 = container_of(work, struct adv7511, hpd_work); ++ enum drm_connector_status status; ++ unsigned int val; ++ int ret; + +- drm_helper_hpd_irq_event(adv7511->connector.dev); ++ ret = regmap_read(adv7511->regmap, ADV7511_REG_STATUS, &val); ++ if (ret < 0) ++ status = connector_status_disconnected; ++ else if (val & ADV7511_STATUS_HPD) ++ status = connector_status_connected; ++ else ++ status = connector_status_disconnected; ++ ++ if (adv7511->connector.status != status) { ++ adv7511->connector.status = status; ++ drm_kms_helper_hotplug_event(adv7511->connector.dev); ++ } + } + + static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd) diff --git a/queue-4.9/drm-bridge-adv7511-use-work_struct-to-defer-hotplug-handing-to-out-of-irq-context.patch b/queue-4.9/drm-bridge-adv7511-use-work_struct-to-defer-hotplug-handing-to-out-of-irq-context.patch new file mode 100644 index 00000000000..10bf497dae9 --- /dev/null +++ b/queue-4.9/drm-bridge-adv7511-use-work_struct-to-defer-hotplug-handing-to-out-of-irq-context.patch @@ -0,0 +1,88 @@ +From 518cb7057a59b9441336d2e88a396d52b6ab0cce Mon Sep 17 00:00:00 2001 +From: John Stultz +Date: Mon, 16 Jan 2017 16:52:47 -0800 +Subject: drm/bridge: adv7511: Use work_struct to defer hotplug handing to out of irq context + +From: John Stultz + +commit 518cb7057a59b9441336d2e88a396d52b6ab0cce upstream. + +I was recently seeing issues with EDID probing, where +the logic to wait for the EDID read bit to be set by the +IRQ wasn't happening and the code would time out and fail. + +Digging deeper, I found this was due to the fact that +IRQs were disabled as we were running in IRQ context from +the HPD signal. + +Thus this patch changes the logic to handle the HPD signal +via a work_struct so we can be out of irq context. + +With this patch, the EDID probing on hotplug does not time +out. + +Cc: David Airlie +Cc: Archit Taneja +Cc: Wolfram Sang +Cc: Lars-Peter Clausen +Cc: Laurent Pinchart +Cc: dri-devel@lists.freedesktop.org +Reviewed-by: Laurent Pinchart +Tested-by: Laurent Pinchart +Signed-off-by: John Stultz +Signed-off-by: Archit Taneja +Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-2-git-send-email-john.stultz@linaro.org +Signed-off-by: Thong Ho +Signed-off-by: Nhan Nguyen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/bridge/adv7511/adv7511.h | 2 ++ + drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 11 ++++++++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/bridge/adv7511/adv7511.h ++++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h +@@ -315,6 +315,8 @@ struct adv7511 { + bool edid_read; + + wait_queue_head_t wq; ++ struct work_struct hpd_work; ++ + struct drm_bridge bridge; + struct drm_connector connector; + +--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c ++++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +@@ -402,6 +402,13 @@ static bool adv7511_hpd(struct adv7511 * + return false; + } + ++static void adv7511_hpd_work(struct work_struct *work) ++{ ++ struct adv7511 *adv7511 = container_of(work, struct adv7511, hpd_work); ++ ++ drm_helper_hpd_irq_event(adv7511->connector.dev); ++} ++ + static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd) + { + unsigned int irq0, irq1; +@@ -419,7 +426,7 @@ static int adv7511_irq_process(struct ad + regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1); + + if (process_hpd && irq0 & ADV7511_INT0_HPD && adv7511->bridge.encoder) +- drm_helper_hpd_irq_event(adv7511->connector.dev); ++ schedule_work(&adv7511->hpd_work); + + if (irq0 & ADV7511_INT0_EDID_READY || irq1 & ADV7511_INT1_DDC_ERROR) { + adv7511->edid_read = true; +@@ -1006,6 +1013,8 @@ static int adv7511_probe(struct i2c_clie + goto err_i2c_unregister_edid; + } + ++ INIT_WORK(&adv7511->hpd_work, adv7511_hpd_work); ++ + if (i2c->irq) { + init_waitqueue_head(&adv7511->wq); + diff --git a/queue-4.9/series b/queue-4.9/series index 8507817795f..1fc97b6f93a 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -28,3 +28,5 @@ workqueue-fix-flag-collision.patch cs5536-add-support-for-ide-controller-variant.patch scsi-sg-protect-against-races-between-mmap-and-sg_set_reserved_size.patch scsi-sg-recheck-mmap_io-request-length-with-lock-held.patch +drm-bridge-adv7511-use-work_struct-to-defer-hotplug-handing-to-out-of-irq-context.patch +drm-bridge-adv7511-switch-to-using-drm_kms_helper_hotplug_event.patch