Skip to contentSkip to conversation

drm/bridge: ti-sn65dsi83: Handle dsi_lanes == 0 as invalid

PATCH Applied Marek Vasut 4 participants 7 messages May 18, 2022 – May 23, 2022

Subsystems (3)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: ti-sn65dsi83: Handle dsi_lanes == 0 as invalid

Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid.

Fixes ceb515ba29ba6 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Cc Jonas Karlman <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
---
 drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
index d64d4385188dd..dc65f424e7f3c 100644
@@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
 	ctx->host_node = of_graph_get_remote_port_parent(endpoint);
 	of_node_put(endpoint);
 
-	if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+	if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
 		ret = -EINVAL;
 		goto err_put_node;
 	}
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Marek Vasut

Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid.

Fixes ceb515ba29ba6 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Cc Jonas Karlman <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>

I wonder if you could not make common helper to get number of lanes with checks included, quite trivial, but maybe worth to standardize it.

Regards
Andrzej

Quoted 17 lines
---
  drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
index d64d4385188dd..dc65f424e7f3c 100644
@@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
  	ctx->host_node = of_graph_get_remote_port_parent(endpoint);
  	of_node_put(endpoint);
 
-	if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+	if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
  		ret = -EINVAL;
  		goto err_put_node;
  	}
Reviewed-by on v1 1/1
#2 lore raw
In reply to Marek Vasut

Am Donnerstag, dem 19.05.2022 um 01:38 +0200 schrieb Marek Vasut:

Quoted 13 lines

Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid.

Fixes ceb515ba29ba6 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Cc Jonas Karlman <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
Quoted 17 lines
---
 drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
index d64d4385188dd..dc65f424e7f3c 100644
@@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
 	ctx->host_node = of_graph_get_remote_port_parent(endpoint);
 	of_node_put(endpoint);
 
-	if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+	if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
 		ret = -EINVAL;
 		goto err_put_node;
 	}
Applied
#3 lore raw
Quoted 30 lines · Lucas Stach

Am Donnerstag, dem 19.05.2022 um 01:38 +0200 schrieb Marek Vasut:

Quoted 13 lines

Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid.

Fixes ceb515ba29ba6 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Cc Jonas Karlman <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Neil Armstrong <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
Quoted 12 lines
---
 drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +0 -0
index d64d4385188dd..dc65f424e7f3c 100644
@@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
      ctx->host_node = of_graph_get_remote_port_parent(endpoint);
      of_node_put(endpoint);
 
Quoted 7 lines

drivers/gpu/drm/bridge/ti-sn65dsi83.c static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model) · line 591

Quoted 5 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
-     if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+     if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
              ret = -EINVAL;
              goto err_put_node;
      }

Applied to drm-misc-next.

#4 lore raw
Quoted 5 lines · Robert Foss
Quoted 4 lines · Lucas Stach

Am Donnerstag, dem 19.05.2022 um 01:38 +0200 schrieb Marek Vasut:

Quoted 2 lines

Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid.

[...]

Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c +0 -0
index d64d4385188dd..dc65f424e7f3c 100644
@@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
       ctx->host_node = of_graph_get_remote_port_parent(endpoint);
       of_node_put(endpoint);
 
Quoted 7 lines

drivers/gpu/drm/bridge/ti-sn65dsi83.c static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model) · line 591

Quoted 5 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
-     if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+     if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
               ret = -EINVAL;
               goto err_put_node;
       }
Quoted 1 line

Applied to drm-misc-next.

This was already applied to drm-misc-next-fixes , since this is a fix for something that was already in release . The conflict will resolve itself easily though ?

#5 lore raw
Quoted 26 lines · Marek Vasut
Quoted 5 lines · Robert Foss
Quoted 4 lines · Lucas Stach

Am Donnerstag, dem 19.05.2022 um 01:38 +0200 schrieb Marek Vasut:

Quoted 2 lines

Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid.

[...]

Quoted 16 lines
Quoted 15 lines
Quoted 13 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
index d64d4385188dd..dc65f424e7f3c 100644
@@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
       ctx->host_node = of_graph_get_remote_port_parent(endpoint);
       of_node_put(endpoint);
 
-     if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+     if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
               ret = -EINVAL;
               goto err_put_node;
       }
Quoted 5 lines
Quoted 1 line

Applied to drm-misc-next.

This was already applied to drm-misc-next-fixes , since this is a fix for something that was already in release . The conflict will resolve itself easily though ?

Ah, I didn't realize. I'm not sure if it will resolve itself or not. But I think either it is reverted in drm-misc-next now, or we wait for an issue to crop up. I think either way is acceptable, but waiting maybe causes less churn. So unless someone has another preference, let's wait and see if a conflict arises.

#6 lore raw
Quoted 33 lines · Robert Foss
Quoted 26 lines · Marek Vasut
Quoted 5 lines · Robert Foss
Quoted 4 lines · Lucas Stach

Am Donnerstag, dem 19.05.2022 um 01:38 +0200 schrieb Marek Vasut:

Quoted 2 lines

Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid.

[...]

Quoted 16 lines
Quoted 15 lines
Quoted 13 lines
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
index d64d4385188dd..dc65f424e7f3c 100644
@@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
        ctx->host_node = of_graph_get_remote_port_parent(endpoint);
        of_node_put(endpoint);
 
-     if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+     if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
                ret = -EINVAL;
                goto err_put_node;
        }
Quoted 5 lines
Quoted 1 line

Applied to drm-misc-next.

This was already applied to drm-misc-next-fixes , since this is a fix for something that was already in release . The conflict will resolve itself easily though ?

Quoted 5 lines

Ah, I didn't realize. I'm not sure if it will resolve itself or not. But I think either it is reverted in drm-misc-next now, or we wait for an issue to crop up. I think either way is acceptable, but waiting maybe causes less churn. So unless someone has another preference, let's wait and see if a conflict arises.

I agree, we wait.