diff mbox series

[v3,15/38] media: ti-vpe: cal: remove wait when stopping camerarx

Message ID 20210524110909.672432-16-tomi.valkeinen@ideasonboard.com
State Superseded
Headers show
Series media: ti-vpe: cal: multistream & embedded data support | expand

Commit Message

Tomi Valkeinen May 24, 2021, 11:08 a.m. UTC
Asserting ComplexIO reset seems to affect the HW (ie. asserting reset
will break an active capture), but the RESET_DONE bit never changes to
"reset is ongoing" state. Thus we always get a timeout.

Drop the wait, as it seems to achieve nothing.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 drivers/media/platform/ti-vpe/cal-camerarx.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

Comments

Laurent Pinchart June 4, 2021, 1:43 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Mon, May 24, 2021 at 02:08:46PM +0300, Tomi Valkeinen wrote:
> Asserting ComplexIO reset seems to affect the HW (ie. asserting reset

> will break an active capture), but the RESET_DONE bit never changes to

> "reset is ongoing" state. Thus we always get a timeout.

> 

> Drop the wait, as it seems to achieve nothing.


I would be nice if this could get double-check by someone at TI with
more information than we have regarding the hardware implementation.

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>


Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


> ---

>  drivers/media/platform/ti-vpe/cal-camerarx.c | 15 ++-------------

>  1 file changed, 2 insertions(+), 13 deletions(-)

> 

> diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c

> index b36e55b63718..a8cca30f3f51 100644

> --- a/drivers/media/platform/ti-vpe/cal-camerarx.c

> +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c

> @@ -407,7 +407,6 @@ static int cal_camerarx_start(struct cal_camerarx *phy)

>  

>  static void cal_camerarx_stop(struct cal_camerarx *phy)

>  {

> -	unsigned int i;

>  	int ret;

>  

>  	cal_camerarx_ppi_disable(phy);

> @@ -421,19 +420,9 @@ static void cal_camerarx_stop(struct cal_camerarx *phy)

>  			CAL_CSI2_COMPLEXIO_CFG_RESET_CTRL,

>  			CAL_CSI2_COMPLEXIO_CFG_RESET_CTRL_MASK);

>  

> -	/* Wait for power down completion */

> -	for (i = 0; i < 10; i++) {

> -		if (cal_read_field(phy->cal,

> -				   CAL_CSI2_COMPLEXIO_CFG(phy->instance),

> -				   CAL_CSI2_COMPLEXIO_CFG_RESET_DONE_MASK) ==

> -		    CAL_CSI2_COMPLEXIO_CFG_RESET_DONE_RESETONGOING)

> -			break;

> -		usleep_range(1000, 1100);

> -	}

> -	phy_dbg(3, phy, "CAL_CSI2_COMPLEXIO_CFG(%d) = 0x%08x Complex IO in Reset (%d) %s\n",

> +	phy_dbg(3, phy, "CAL_CSI2_COMPLEXIO_CFG(%d) = 0x%08x Complex IO in Reset\n",

>  		phy->instance,

> -		cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)), i,

> -		(i >= 10) ? "(timeout)" : "");

> +		cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)));

>  

>  	/* Disable the phy */

>  	cal_camerarx_disable(phy);


-- 
Regards,

Laurent Pinchart
diff mbox series

Patch

diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c
index b36e55b63718..a8cca30f3f51 100644
--- a/drivers/media/platform/ti-vpe/cal-camerarx.c
+++ b/drivers/media/platform/ti-vpe/cal-camerarx.c
@@ -407,7 +407,6 @@  static int cal_camerarx_start(struct cal_camerarx *phy)
 
 static void cal_camerarx_stop(struct cal_camerarx *phy)
 {
-	unsigned int i;
 	int ret;
 
 	cal_camerarx_ppi_disable(phy);
@@ -421,19 +420,9 @@  static void cal_camerarx_stop(struct cal_camerarx *phy)
 			CAL_CSI2_COMPLEXIO_CFG_RESET_CTRL,
 			CAL_CSI2_COMPLEXIO_CFG_RESET_CTRL_MASK);
 
-	/* Wait for power down completion */
-	for (i = 0; i < 10; i++) {
-		if (cal_read_field(phy->cal,
-				   CAL_CSI2_COMPLEXIO_CFG(phy->instance),
-				   CAL_CSI2_COMPLEXIO_CFG_RESET_DONE_MASK) ==
-		    CAL_CSI2_COMPLEXIO_CFG_RESET_DONE_RESETONGOING)
-			break;
-		usleep_range(1000, 1100);
-	}
-	phy_dbg(3, phy, "CAL_CSI2_COMPLEXIO_CFG(%d) = 0x%08x Complex IO in Reset (%d) %s\n",
+	phy_dbg(3, phy, "CAL_CSI2_COMPLEXIO_CFG(%d) = 0x%08x Complex IO in Reset\n",
 		phy->instance,
-		cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)), i,
-		(i >= 10) ? "(timeout)" : "");
+		cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)));
 
 	/* Disable the phy */
 	cal_camerarx_disable(phy);