Hi Sascha, On Thu, Aug 29, 2013 at 3:37 PM, Sascha Hauer <s.ha...@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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/