[PATCH 1/6] mei: vsc: Enhance IVSC chipset reset toggling

Wentong Wu posted 6 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH 1/6] mei: vsc: Enhance IVSC chipset reset toggling
Posted by Wentong Wu 1 year, 5 months ago
Implementing the hardware recommendation to toggle the chipset reset.

Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
Cc: stable@vger.kernel.org # for 6.8+
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
Tested-by: Jason Chen <jason.z.chen@intel.com>
---
 drivers/misc/mei/vsc-tp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c
index e6a98dba8a73..dcab5174bf00 100644
--- a/drivers/misc/mei/vsc-tp.c
+++ b/drivers/misc/mei/vsc-tp.c
@@ -350,6 +350,8 @@ void vsc_tp_reset(struct vsc_tp *tp)
 	disable_irq(tp->spi->irq);
 
 	/* toggle reset pin */
+	gpiod_set_value_cansleep(tp->resetfw, 1);
+	msleep(VSC_TP_RESET_PIN_TOGGLE_INTERVAL_MS);
 	gpiod_set_value_cansleep(tp->resetfw, 0);
 	msleep(VSC_TP_RESET_PIN_TOGGLE_INTERVAL_MS);
 	gpiod_set_value_cansleep(tp->resetfw, 1);
-- 
2.34.1
Re: [PATCH 1/6] mei: vsc: Enhance IVSC chipset reset toggling
Posted by Sakari Ailus 1 year, 5 months ago
Hi Wentong,

Thanks for the set.

On Sun, Jun 23, 2024 at 05:30:51PM +0800, Wentong Wu wrote:
> Implementing the hardware recommendation to toggle the chipset reset.
> 
> Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
> Cc: stable@vger.kernel.org # for 6.8+
> Signed-off-by: Wentong Wu <wentong.wu@intel.com>
> Tested-by: Jason Chen <jason.z.chen@intel.com>
> ---
>  drivers/misc/mei/vsc-tp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c
> index e6a98dba8a73..dcab5174bf00 100644
> --- a/drivers/misc/mei/vsc-tp.c
> +++ b/drivers/misc/mei/vsc-tp.c
> @@ -350,6 +350,8 @@ void vsc_tp_reset(struct vsc_tp *tp)
>  	disable_irq(tp->spi->irq);
>  
>  	/* toggle reset pin */
> +	gpiod_set_value_cansleep(tp->resetfw, 1);
> +	msleep(VSC_TP_RESET_PIN_TOGGLE_INTERVAL_MS);
>  	gpiod_set_value_cansleep(tp->resetfw, 0);
>  	msleep(VSC_TP_RESET_PIN_TOGGLE_INTERVAL_MS);
>  	gpiod_set_value_cansleep(tp->resetfw, 1);

Looking at the patch, the driver appears to leave the reset signal enabled.
As it currently works, also the polarity appears to be wrong.

Could you addrss this, after this patch?

-- 
Kind regards,

Sakari Ailus
RE: [PATCH 1/6] mei: vsc: Enhance IVSC chipset reset toggling
Posted by Wu, Wentong 1 year, 5 months ago
> From: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> Hi Wentong,
> 
> Thanks for the set.
>
Hi Sakari,

Thanks for your review

> On Sun, Jun 23, 2024 at 05:30:51PM +0800, Wentong Wu wrote:
> > Implementing the hardware recommendation to toggle the chipset reset.
> >
> > Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
> > Cc: stable@vger.kernel.org # for 6.8+
> > Signed-off-by: Wentong Wu <wentong.wu@intel.com>
> > Tested-by: Jason Chen <jason.z.chen@intel.com>
> > ---
> >  drivers/misc/mei/vsc-tp.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c
> > index e6a98dba8a73..dcab5174bf00 100644
> > --- a/drivers/misc/mei/vsc-tp.c
> > +++ b/drivers/misc/mei/vsc-tp.c
> > @@ -350,6 +350,8 @@ void vsc_tp_reset(struct vsc_tp *tp)
> >  	disable_irq(tp->spi->irq);
> >
> >  	/* toggle reset pin */
> > +	gpiod_set_value_cansleep(tp->resetfw, 1);
> > +	msleep(VSC_TP_RESET_PIN_TOGGLE_INTERVAL_MS);
> >  	gpiod_set_value_cansleep(tp->resetfw, 0);
> >  	msleep(VSC_TP_RESET_PIN_TOGGLE_INTERVAL_MS);
> >  	gpiod_set_value_cansleep(tp->resetfw, 1);
> 
> Looking at the patch, the driver appears to leave the reset signal enabled.
> As it currently works, also the polarity appears to be wrong.

Ok, the reset pin is RISING trigger. Probably we can remove this.

> 
> Could you addrss this, after this patch?

ack, I will send v2 patch set.

BR,
Wentong
> 
> --
> Kind regards,
> 
> Sakari Ailus