[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5ANriVriw5W6qPG7OxPAsbvVHfZfzoCJk-d3aiAtyQkFA@mail.gmail.com>
Date: Fri, 30 Aug 2013 13:08:14 -0300
From: Fabio Estevam <festevam@...il.com>
To: Sascha Hauer <s.hauer@...gutronix.de>
Cc: Fabio Estevam <fabio.estevam@...escale.com>,
Dave Airlie <airlied@...hat.com>, daniel.vetter@...ll.ch,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] imx-drm: Fix probe failure
Hi Sascha,
On Thu, Aug 29, 2013 at 3:37 PM, Sascha Hauer <s.hauer@...gutronix.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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists