diff mbox series

[v3,3/4] drm/omap: dsi: Ensure the device is active during probe

Message ID 20181110111654.4387-4-laurent.pinchart@ideasonboard.com
State New, archived
Headers show
Series omapdrm: Fix runtime PM issues at module load and unload time | expand

Commit Message

Laurent Pinchart Nov. 10, 2018, 11:16 a.m. UTC
The probe function performs hardware access to read the number of
supported data lanes from a configuration register and thus requires the
device to be active. Ensure this by surrounding the access with
dsi_runtime_get() and dsi_runtime_put() calls.

Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Tony Lindgren <tony@atomide.com>
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Sebastian Reichel Nov. 11, 2018, 12:48 a.m. UTC | #1
Hi,

On Sat, Nov 10, 2018 at 01:16:53PM +0200, Laurent Pinchart wrote:
> The probe function performs hardware access to read the number of
> supported data lanes from a configuration register and thus requires the
> device to be active. Ensure this by surrounding the access with
> dsi_runtime_get() and dsi_runtime_put() calls.
> 
> Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Acked-by: Tony Lindgren <tony@atomide.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dsi.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 394c129cfb3b..b9d5ad7e67d8 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -5409,11 +5409,14 @@ static int dsi_probe(struct platform_device *pdev)
>  
>  	/* DSI on OMAP3 doesn't have register DSI_GNQ, set number
>  	 * of data to 3 by default */
> -	if (dsi->data->quirks & DSI_QUIRK_GNQ)
> +	if (dsi->data->quirks & DSI_QUIRK_GNQ) {
> +		dsi_runtime_get(dsi);
>  		/* NB_DATA_LANES */
>  		dsi->num_lanes_supported = 1 + REG_GET(dsi, DSI_GNQ, 11, 9);
> -	else
> +		dsi_runtime_put(dsi);
> +	} else {
>  		dsi->num_lanes_supported = 3;
> +	}
>  
>  	r = dsi_init_output(dsi);
>  	if (r)
> -- 
> Regards,
> 
> Laurent Pinchart
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 394c129cfb3b..b9d5ad7e67d8 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -5409,11 +5409,14 @@  static int dsi_probe(struct platform_device *pdev)
 
 	/* DSI on OMAP3 doesn't have register DSI_GNQ, set number
 	 * of data to 3 by default */
-	if (dsi->data->quirks & DSI_QUIRK_GNQ)
+	if (dsi->data->quirks & DSI_QUIRK_GNQ) {
+		dsi_runtime_get(dsi);
 		/* NB_DATA_LANES */
 		dsi->num_lanes_supported = 1 + REG_GET(dsi, DSI_GNQ, 11, 9);
-	else
+		dsi_runtime_put(dsi);
+	} else {
 		dsi->num_lanes_supported = 3;
+	}
 
 	r = dsi_init_output(dsi);
 	if (r)