linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()
       [not found] <1566958886-25756-1-git-send-email-johnny.chuang@emc.com.tw>
@ 2019-08-28  2:33 ` Johnny.Chuang
  2019-08-29 18:29   ` 'Dmitry Torokhov'
  0 siblings, 1 reply; 5+ messages in thread
From: Johnny.Chuang @ 2019-08-28  2:33 UTC (permalink / raw)
  To: 'Dmitry Torokhov',
	linux-kernel, linux-input, STRD2-莊佳霖,
	STRD2-蔡惠嬋
  Cc: STRD2-陳崇明經理,
	'梁博翔', 'jeff'

The return value of elants_i2c_initialize() was always 0.
It maybe register input device when initialize fail.

Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
---
 drivers/input/touchscreen/elants_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/elants_i2c.c
b/drivers/input/touchscreen/elants_i2c.c
index d4ad24e..9c9816f 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data *ts)
 	if (error)
 		ts->iap_mode = ELAN_IAP_RECOVERY;
 
-	return 0;
+	return error;
 }
 
 /*
-- 
2.7.4


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

* Re: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()
  2019-08-28  2:33 ` [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize() Johnny.Chuang
@ 2019-08-29 18:29   ` 'Dmitry Torokhov'
  2019-09-03  2:33     ` Johnny.Chuang
  0 siblings, 1 reply; 5+ messages in thread
From: 'Dmitry Torokhov' @ 2019-08-29 18:29 UTC (permalink / raw)
  To: Johnny.Chuang
  Cc: linux-kernel, linux-input, STRD2-蔡惠嬋,
	STRD2-陳崇明經理,
	'梁博翔', 'jeff'

Hi Johnny,

On Wed, Aug 28, 2019 at 10:33:46AM +0800, Johnny.Chuang wrote:
> The return value of elants_i2c_initialize() was always 0.
> It maybe register input device when initialize fail.

We do not want to return error here, because it will abort probe, and
then we will not be able to initiate firmware flash flow so we can
attempt to recover the device.

If you want to try you can change the ts->iap_mode before trying to
register input device, but then you need to be very careful about
registering and unregistering it later, after flashing or re-flashing
firmware.

> 
> Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
> ---
>  drivers/input/touchscreen/elants_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c
> b/drivers/input/touchscreen/elants_i2c.c
> index d4ad24e..9c9816f 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data *ts)
>  	if (error)
>  		ts->iap_mode = ELAN_IAP_RECOVERY;
>  
> -	return 0;
> +	return error;
>  }
>  
>  /*
> -- 
> 2.7.4
> 

Thanks.

-- 
Dmitry

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

* RE: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()
  2019-08-29 18:29   ` 'Dmitry Torokhov'
@ 2019-09-03  2:33     ` Johnny.Chuang
  2019-09-03 15:55       ` 'Dmitry Torokhov'
  0 siblings, 1 reply; 5+ messages in thread
From: Johnny.Chuang @ 2019-09-03  2:33 UTC (permalink / raw)
  To: 'Dmitry Torokhov'
  Cc: linux-kernel, linux-input,
	'STRD2-蔡惠嬋',
	'STRD2-陳崇明經理',
	'梁博翔', 'jeff'

Hi Dmitry,

Thanks for your explanation.
If I want to abandon this patch, what's step I need to do?

Many thanks,
Johnny
-----Original Message-----
From: 'Dmitry Torokhov' [mailto:dmitry.torokhov@gmail.com] 
Sent: Friday, August 30, 2019 2:30 AM
To: Johnny.Chuang
Cc: linux-kernel@vger.kernel.org; linux-input@vger.kernel.org; STRD2-蔡惠嬋;
STRD2-陳崇明經理; '梁博翔'; 'jeff'
Subject: Re: [PATCH] Input: elants_i2c - return real value of
elants_i2c_initialize()

Hi Johnny,

On Wed, Aug 28, 2019 at 10:33:46AM +0800, Johnny.Chuang wrote:
> The return value of elants_i2c_initialize() was always 0.
> It maybe register input device when initialize fail.

We do not want to return error here, because it will abort probe, and then
we will not be able to initiate firmware flash flow so we can attempt to
recover the device.

If you want to try you can change the ts->iap_mode before trying to register
input device, but then you need to be very careful about registering and
unregistering it later, after flashing or re-flashing firmware.

> 
> Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
> ---
>  drivers/input/touchscreen/elants_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/elants_i2c.c
> b/drivers/input/touchscreen/elants_i2c.c
> index d4ad24e..9c9816f 100644
> --- a/drivers/input/touchscreen/elants_i2c.c
> +++ b/drivers/input/touchscreen/elants_i2c.c
> @@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data
*ts)
>  	if (error)
>  		ts->iap_mode = ELAN_IAP_RECOVERY;
>  
> -	return 0;
> +	return error;
>  }
>  
>  /*
> --
> 2.7.4
> 

Thanks.

-- 
Dmitry


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

* Re: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()
  2019-09-03  2:33     ` Johnny.Chuang
@ 2019-09-03 15:55       ` 'Dmitry Torokhov'
  2019-09-04  9:51         ` Johnny.Chuang
  0 siblings, 1 reply; 5+ messages in thread
From: 'Dmitry Torokhov' @ 2019-09-03 15:55 UTC (permalink / raw)
  To: Johnny.Chuang
  Cc: linux-kernel, linux-input,
	'STRD2-蔡惠嬋',
	'STRD2-陳崇明經理',
	'梁博翔', 'jeff'

On Tue, Sep 03, 2019 at 10:33:33AM +0800, Johnny.Chuang wrote:
> Hi Dmitry,
> 
> Thanks for your explanation.
> If I want to abandon this patch, what's step I need to do?

Absolutely nothing ;) Consider it dropped.

> 
> Many thanks,
> Johnny
> -----Original Message-----
> From: 'Dmitry Torokhov' [mailto:dmitry.torokhov@gmail.com] 
> Sent: Friday, August 30, 2019 2:30 AM
> To: Johnny.Chuang
> Cc: linux-kernel@vger.kernel.org; linux-input@vger.kernel.org; STRD2-蔡惠嬋;
> STRD2-陳崇明經理; '梁博翔'; 'jeff'
> Subject: Re: [PATCH] Input: elants_i2c - return real value of
> elants_i2c_initialize()
> 
> Hi Johnny,
> 
> On Wed, Aug 28, 2019 at 10:33:46AM +0800, Johnny.Chuang wrote:
> > The return value of elants_i2c_initialize() was always 0.
> > It maybe register input device when initialize fail.
> 
> We do not want to return error here, because it will abort probe, and then
> we will not be able to initiate firmware flash flow so we can attempt to
> recover the device.
> 
> If you want to try you can change the ts->iap_mode before trying to register
> input device, but then you need to be very careful about registering and
> unregistering it later, after flashing or re-flashing firmware.
> 
> > 
> > Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
> > ---
> >  drivers/input/touchscreen/elants_i2c.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/input/touchscreen/elants_i2c.c
> > b/drivers/input/touchscreen/elants_i2c.c
> > index d4ad24e..9c9816f 100644
> > --- a/drivers/input/touchscreen/elants_i2c.c
> > +++ b/drivers/input/touchscreen/elants_i2c.c
> > @@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data
> *ts)
> >  	if (error)
> >  		ts->iap_mode = ELAN_IAP_RECOVERY;
> >  
> > -	return 0;
> > +	return error;
> >  }
> >  
> >  /*
> > --
> > 2.7.4
> > 
> 
> Thanks.
> 
> -- 
> Dmitry
> 

-- 
Dmitry

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

* RE: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()
  2019-09-03 15:55       ` 'Dmitry Torokhov'
@ 2019-09-04  9:51         ` Johnny.Chuang
  0 siblings, 0 replies; 5+ messages in thread
From: Johnny.Chuang @ 2019-09-04  9:51 UTC (permalink / raw)
  To: 'Dmitry Torokhov'
  Cc: linux-kernel, linux-input,
	'STRD2-蔡惠嬋',
	'STRD2-陳崇明經理',
	'梁博翔', 'jeff'

Hi Dmitry,

Got it, let it dropped.

Many thanks,
Johnny
-----Original Message-----
From: 'Dmitry Torokhov' [mailto:dmitry.torokhov@gmail.com] 
Sent: Tuesday, September 03, 2019 11:55 PM
To: Johnny.Chuang
Cc: linux-kernel@vger.kernel.org; linux-input@vger.kernel.org; 'STRD2-蔡惠嬋'; 'STRD2-陳崇明經理'; '梁博翔'; 'jeff'
Subject: Re: [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize()

On Tue, Sep 03, 2019 at 10:33:33AM +0800, Johnny.Chuang wrote:
> Hi Dmitry,
> 
> Thanks for your explanation.
> If I want to abandon this patch, what's step I need to do?

Absolutely nothing ;) Consider it dropped.

> 
> Many thanks,
> Johnny
> -----Original Message-----
> From: 'Dmitry Torokhov' [mailto:dmitry.torokhov@gmail.com] 
> Sent: Friday, August 30, 2019 2:30 AM
> To: Johnny.Chuang
> Cc: linux-kernel@vger.kernel.org; linux-input@vger.kernel.org; STRD2-蔡惠嬋;
> STRD2-陳崇明經理; '梁博翔'; 'jeff'
> Subject: Re: [PATCH] Input: elants_i2c - return real value of
> elants_i2c_initialize()
> 
> Hi Johnny,
> 
> On Wed, Aug 28, 2019 at 10:33:46AM +0800, Johnny.Chuang wrote:
> > The return value of elants_i2c_initialize() was always 0.
> > It maybe register input device when initialize fail.
> 
> We do not want to return error here, because it will abort probe, and then
> we will not be able to initiate firmware flash flow so we can attempt to
> recover the device.
> 
> If you want to try you can change the ts->iap_mode before trying to register
> input device, but then you need to be very careful about registering and
> unregistering it later, after flashing or re-flashing firmware.
> 
> > 
> > Signed-off-by: Johnny Chuang <johnny.chuang@emc.com.tw>
> > ---
> >  drivers/input/touchscreen/elants_i2c.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/input/touchscreen/elants_i2c.c
> > b/drivers/input/touchscreen/elants_i2c.c
> > index d4ad24e..9c9816f 100644
> > --- a/drivers/input/touchscreen/elants_i2c.c
> > +++ b/drivers/input/touchscreen/elants_i2c.c
> > @@ -571,7 +571,7 @@ static int elants_i2c_initialize(struct elants_data
> *ts)
> >  	if (error)
> >  		ts->iap_mode = ELAN_IAP_RECOVERY;
> >  
> > -	return 0;
> > +	return error;
> >  }
> >  
> >  /*
> > --
> > 2.7.4
> > 
> 
> Thanks.
> 
> -- 
> Dmitry
> 

-- 
Dmitry


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

end of thread, other threads:[~2019-09-04  9:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1566958886-25756-1-git-send-email-johnny.chuang@emc.com.tw>
2019-08-28  2:33 ` [PATCH] Input: elants_i2c - return real value of elants_i2c_initialize() Johnny.Chuang
2019-08-29 18:29   ` 'Dmitry Torokhov'
2019-09-03  2:33     ` Johnny.Chuang
2019-09-03 15:55       ` 'Dmitry Torokhov'
2019-09-04  9:51         ` Johnny.Chuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).