diff mbox series

[v2,1/3] drm/bridge/lontium-lt9611uxc: fix waiting for EDID to become available

Message ID 20210115110225.127075-2-dmitry.baryshkov@linaro.org
State Superseded
Headers show
Series drm/bridge/lontium-lt9611uxc: fix handling of EDID/HPD | expand

Commit Message

Dmitry Baryshkov Jan. 15, 2021, 11:02 a.m. UTC
- Call wake_up() when EDID ready event is received to wake
  wait_event_interruptible_timeout()

- Increase waiting timeout, reading EDID can take longer than 100ms, so
  let's be on a safe side.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge")
---
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.29.2

Comments

Bjorn Andersson Jan. 15, 2021, 2:58 p.m. UTC | #1
On Fri 15 Jan 05:02 CST 2021, Dmitry Baryshkov wrote:

> - Call wake_up() when EDID ready event is received to wake

>   wait_event_interruptible_timeout()

> 

> - Increase waiting timeout, reading EDID can take longer than 100ms, so

>   let's be on a safe side.

> 


Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>


Regards,
Bjorn

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge")

> ---

>  drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 ++++--

>  1 file changed, 4 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c

> index 0c98d27f84ac..a59e811f1705 100644

> --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c

> +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c

> @@ -145,8 +145,10 @@ static irqreturn_t lt9611uxc_irq_thread_handler(int irq, void *dev_id)

>  

>  	lt9611uxc_unlock(lt9611uxc);

>  

> -	if (irq_status & BIT(0))

> +	if (irq_status & BIT(0)) {

>  		lt9611uxc->edid_read = !!(hpd_status & BIT(0));

> +		wake_up_all(&lt9611uxc->wq);

> +	}

>  

>  	if (irq_status & BIT(1)) {

>  		if (lt9611uxc->connector.dev)

> @@ -465,7 +467,7 @@ static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid

>  static int lt9611uxc_wait_for_edid(struct lt9611uxc *lt9611uxc)

>  {

>  	return wait_event_interruptible_timeout(lt9611uxc->wq, lt9611uxc->edid_read,

> -			msecs_to_jiffies(100));

> +			msecs_to_jiffies(500));

>  }

>  

>  static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len)

> -- 

> 2.29.2

>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index 0c98d27f84ac..a59e811f1705 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -145,8 +145,10 @@  static irqreturn_t lt9611uxc_irq_thread_handler(int irq, void *dev_id)
 
 	lt9611uxc_unlock(lt9611uxc);
 
-	if (irq_status & BIT(0))
+	if (irq_status & BIT(0)) {
 		lt9611uxc->edid_read = !!(hpd_status & BIT(0));
+		wake_up_all(&lt9611uxc->wq);
+	}
 
 	if (irq_status & BIT(1)) {
 		if (lt9611uxc->connector.dev)
@@ -465,7 +467,7 @@  static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid
 static int lt9611uxc_wait_for_edid(struct lt9611uxc *lt9611uxc)
 {
 	return wait_event_interruptible_timeout(lt9611uxc->wq, lt9611uxc->edid_read,
-			msecs_to_jiffies(100));
+			msecs_to_jiffies(500));
 }
 
 static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len)