All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, mark.yao@rock-chips.com,
	zyw@rock-chips.com, groeck@chromium.org,
	Sean Paul <seanpaul@chromium.org>
Subject: [PATCH 2/3] drm/rockchip: cdn-dp: Load firmware if no monitor connected
Date: Tue, 22 Nov 2016 15:50:06 -0500	[thread overview]
Message-ID: <1479847815-30750-3-git-send-email-seanpaul@chromium.org> (raw)
In-Reply-To: <1479847815-30750-1-git-send-email-seanpaul@chromium.org>

From: Guenter Roeck <groeck@chromium.org>

If no monitor is connected, suspend/resume cycles result in firmware
load errors because the driver attempts to load the firmware while
the system is in suspend state. This results in a kernel warning and
traceback.

Loading the firmware during boot fixes the problem. Note that we can not
just call schedule_work conditionally in cdn_dp_pd_event() if the insertion
status changed. The problem would still be seen if a monitor is connected
for the first time during suspend.

Signed-off-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index 8644fd0..f78cdaf 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -1021,7 +1021,6 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data)
 	struct cdn_dp_port *port;
 	struct drm_device *drm_dev = data;
 	int ret, i;
-	bool schedule_event = false;
 
 	ret = cdn_dp_parse_dt(dp);
 	if (ret < 0)
@@ -1083,15 +1082,11 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data)
 				      "register EXTCON_DISP_DP notifier err\n");
 			goto err_free_connector;
 		}
-
-		if (extcon_get_state(port->extcon, EXTCON_DISP_DP))
-			schedule_event = true;
 	}
 
 	pm_runtime_enable(dev);
 
-	if (schedule_event)
-		schedule_work(&dp->event_work);
+	schedule_work(&dp->event_work);
 
 	return 0;
 
-- 
2.8.0.rc3.226.g39d4020

WARNING: multiple messages have this Message-ID (diff)
From: Sean Paul <seanpaul@chromium.org>
To: dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org
Cc: zyw@rock-chips.com, groeck@chromium.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] drm/rockchip: cdn-dp: Load firmware if no monitor connected
Date: Tue, 22 Nov 2016 15:50:06 -0500	[thread overview]
Message-ID: <1479847815-30750-3-git-send-email-seanpaul@chromium.org> (raw)
In-Reply-To: <1479847815-30750-1-git-send-email-seanpaul@chromium.org>

From: Guenter Roeck <groeck@chromium.org>

If no monitor is connected, suspend/resume cycles result in firmware
load errors because the driver attempts to load the firmware while
the system is in suspend state. This results in a kernel warning and
traceback.

Loading the firmware during boot fixes the problem. Note that we can not
just call schedule_work conditionally in cdn_dp_pd_event() if the insertion
status changed. The problem would still be seen if a monitor is connected
for the first time during suspend.

Signed-off-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/rockchip/cdn-dp-core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index 8644fd0..f78cdaf 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -1021,7 +1021,6 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data)
 	struct cdn_dp_port *port;
 	struct drm_device *drm_dev = data;
 	int ret, i;
-	bool schedule_event = false;
 
 	ret = cdn_dp_parse_dt(dp);
 	if (ret < 0)
@@ -1083,15 +1082,11 @@ static int cdn_dp_bind(struct device *dev, struct device *master, void *data)
 				      "register EXTCON_DISP_DP notifier err\n");
 			goto err_free_connector;
 		}
-
-		if (extcon_get_state(port->extcon, EXTCON_DISP_DP))
-			schedule_event = true;
 	}
 
 	pm_runtime_enable(dev);
 
-	if (schedule_event)
-		schedule_work(&dp->event_work);
+	schedule_work(&dp->event_work);
 
 	return 0;
 
-- 
2.8.0.rc3.226.g39d4020

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-11-22 20:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 20:50 [PATCH 0/3] drm/rockchip: Add CDN DP driver Sean Paul
2016-11-22 20:50 ` [PATCH v16 1/3] drm/rockchip: cdn-dp: add cdn DP support for rk3399 Sean Paul
2016-11-22 20:50   ` Sean Paul
2016-11-22 20:50 ` Sean Paul [this message]
2016-11-22 20:50   ` [PATCH 2/3] drm/rockchip: cdn-dp: Load firmware if no monitor connected Sean Paul
2016-11-22 20:50 ` [PATCH 3/3] drm/rockchip: cdn-dp: Do not run worker while suspended Sean Paul
2016-11-22 20:50   ` Sean Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479847815-30750-3-git-send-email-seanpaul@chromium.org \
    --to=seanpaul@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=groeck@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    --cc=zyw@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.