lkml.org 
[lkml]   [2013]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH v2] imx-drm: Fix probe failure
From
Hi Sascha,

On Thu, Aug 29, 2013 at 3:37 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> It's not about the module refcount. It's only that a on a drm device
> which is in use you better do not add/remove components.
>
> Again: The imx-drm driver does *not* do hotplugging. It will *not* add
> or remove components when the device is opened. The code you remove
> exactly makes (or made before Daniels patch) that sure.

I am not sure what would be the correct fix for this.

What about this?

--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -438,6 +438,8 @@ static int imx_drm_driver_load(struct drm_device
*drm, unsigned long flags)
ret = -EINVAL;

ret = 0;
+
+ imxdrm->references = -1;

err_init:
mutex_unlock(&imxdrm->mutex);
@@ -485,7 +487,7 @@ int imx_drm_add_crtc(struct drm_crtc *crtc,

mutex_lock(&imxdrm->mutex);

- if (imxdrm->references) {
+ if (imxdrm->references > 0) {
ret = -EBUSY;
goto err_busy;
}
@@ -564,7 +566,7 @@ int imx_drm_add_encoder(struct drm_encoder *encoder,

mutex_lock(&imxdrm->mutex);

- if (imxdrm->references) {
+ if (imxdrm->references > 0) {
ret = -EBUSY;
goto err_busy;
}
@@ -709,7 +711,7 @@ int imx_drm_add_connector(struct drm_connector *connector,

mutex_lock(&imxdrm->mutex);

- if (imxdrm->references) {
+ if (imxdrm->references > 0) {
ret = -EBUSY;
goto err_busy;
}

\
 
 \ /
  Last update: 2013-08-30 18:21    [W:0.049 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site