All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] gpu: anx7808: fix a missing check in anx78xx_poweron
@ 2018-12-25  5:02 Kangjie Lu
  2018-12-25  5:18 ` Kangjie Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Kangjie Lu @ 2018-12-25  5:02 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Archit Taneja, Andrzej Hajda, Laurent Pinchart,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel

Both anx78xx_set_bits() and anx78xx_clear_bits() in the poweron process
may fail. The fix inserts checks for their return values.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/gpu/drm/bridge/analogix-anx78xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
index 3b0fe2b188db..4f35aced65a0 100644
--- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
@@ -646,6 +646,7 @@ static void anx78xx_poweron(struct anx78xx *anx78xx)
 				err);
 		return;
 	}
+
 	err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2],
 			SP_POWERDOWN_CTRL_REG,
 			SP_REGISTER_PD | SP_TOTAL_PD);
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] gpu: anx7808: fix a missing check in anx78xx_poweron
  2018-12-25  5:02 [PATCH v2] gpu: anx7808: fix a missing check in anx78xx_poweron Kangjie Lu
@ 2018-12-25  5:18 ` Kangjie Lu
  0 siblings, 0 replies; 3+ messages in thread
From: Kangjie Lu @ 2018-12-25  5:18 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: David Airlie, open list, dri-devel, Laurent Pinchart, Aditya Pakki


[-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --]

Please ignore this email. I've sent another one.

On Mon, Dec 24, 2018 at 11:02 PM Kangjie Lu <kjlu@umn.edu> wrote:

> Both anx78xx_set_bits() and anx78xx_clear_bits() in the poweron process
> may fail. The fix inserts checks for their return values.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>  drivers/gpu/drm/bridge/analogix-anx78xx.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c
> b/drivers/gpu/drm/bridge/analogix-anx78xx.c
> index 3b0fe2b188db..4f35aced65a0 100644
> --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
> +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
> @@ -646,6 +646,7 @@ static void anx78xx_poweron(struct anx78xx *anx78xx)
>                                 err);
>                 return;
>         }
> +
>         err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2],
>                         SP_POWERDOWN_CTRL_REG,
>                         SP_REGISTER_PD | SP_TOTAL_PD);
> --
> 2.17.2 (Apple Git-113)
>
>

-- 
Kangjie Lu
Assistant Professor
Department of Computer Science and Engineering
University of Minnesota
Personal homepage <https://www-users.cs.umn.edu/~kjlu>

[-- Attachment #1.2: Type: text/html, Size: 1908 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] gpu: anx7808: fix a missing check in anx78xx_poweron
@ 2018-12-25  5:17 Kangjie Lu
  0 siblings, 0 replies; 3+ messages in thread
From: Kangjie Lu @ 2018-12-25  5:17 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Archit Taneja, Andrzej Hajda, Laurent Pinchart,
	David Airlie, Daniel Vetter, dri-devel, linux-kernel

Both anx78xx_set_bits() and anx78xx_clear_bits() in the poweron process
may fail. The fix inserts checks for their return values.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/gpu/drm/bridge/analogix-anx78xx.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
index f8433c93f463..3b0fe2b188db 100644
--- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
@@ -638,10 +638,22 @@ static void anx78xx_poweron(struct anx78xx *anx78xx)
 	gpiod_set_value_cansleep(pdata->gpiod_reset, 0);
 
 	/* Power on registers module */
-	anx78xx_set_bits(anx78xx->map[I2C_IDX_TX_P2], SP_POWERDOWN_CTRL_REG,
-			 SP_HDCP_PD | SP_AUDIO_PD | SP_VIDEO_PD | SP_LINK_PD);
-	anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2], SP_POWERDOWN_CTRL_REG,
-			   SP_REGISTER_PD | SP_TOTAL_PD);
+	err = anx78xx_set_bits(anx78xx->map[I2C_IDX_TX_P2],
+			SP_POWERDOWN_CTRL_REG,
+			SP_HDCP_PD | SP_AUDIO_PD | SP_VIDEO_PD | SP_LINK_PD);
+	if (err) {
+		DRM_ERROR("Failed to set register bits: %d\n",
+				err);
+		return;
+	}
+	err = anx78xx_clear_bits(anx78xx->map[I2C_IDX_TX_P2],
+			SP_POWERDOWN_CTRL_REG,
+			SP_REGISTER_PD | SP_TOTAL_PD);
+	if (err) {
+		DRM_ERROR("Failed to clear register bits: %d\n",
+				err);
+		return;
+	}
 
 	anx78xx->powered = true;
 }
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-25  5:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-25  5:02 [PATCH v2] gpu: anx7808: fix a missing check in anx78xx_poweron Kangjie Lu
2018-12-25  5:18 ` Kangjie Lu
2018-12-25  5:17 Kangjie Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.