All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8
@ 2016-07-19 23:43 ` Andrew Duggan
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Duggan @ 2016-07-19 23:43 UTC (permalink / raw)
  To: linux-input, linux-kernel
  Cc: Andrew Duggan, Dmitry Torokhov, Jiri Kosina, Benjamin Tissoires,
	Vincent Huang, Nick Dyer, Chris Healy, Nitin Chaudhary, stable

According to the RMI4 spec the maximum size of F12 control register 8 is
15 bytes. The current code incorrectly reports an error if control 8 is
greater then 14. Making sensors with a control register 8 with 15 bytes
unusable.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reported-by: Chris Healy <cphealy@gmail.com>
Cc: stable@vger.kernel.org
---
 drivers/input/rmi4/rmi_f12.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
index c30fd86..9b0d9f7 100644
--- a/drivers/input/rmi4/rmi_f12.c
+++ b/drivers/input/rmi4/rmi_f12.c
@@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
 	struct rmi_device *rmi_dev = fn->rmi_dev;
 	int ret;
 	int offset;
-	u8 buf[14];
+	u8 buf[15];
 	int pitch_x = 0;
 	int pitch_y = 0;
 	int clip_x_low = 0;
@@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
 
 	offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
 
-	if (item->reg_size > 14) {
-		dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
+	if (item->reg_size > 15) {
+		dev_err(&fn->dev,
+			"F12 control8 should be a maximum of 15 bytes, not: %ld\n",
 			item->reg_size);
 		return -ENODEV;
 	}
-- 
2.7.4

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

* [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8
@ 2016-07-19 23:43 ` Andrew Duggan
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Duggan @ 2016-07-19 23:43 UTC (permalink / raw)
  To: linux-input, linux-kernel
  Cc: Andrew Duggan, Dmitry Torokhov, Jiri Kosina, Benjamin Tissoires,
	Vincent Huang, Nick Dyer, Chris Healy, Nitin Chaudhary, stable

According to the RMI4 spec the maximum size of F12 control register 8 is
15 bytes. The current code incorrectly reports an error if control 8 is
greater then 14. Making sensors with a control register 8 with 15 bytes
unusable.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Reported-by: Chris Healy <cphealy@gmail.com>
Cc: stable@vger.kernel.org
---
 drivers/input/rmi4/rmi_f12.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
index c30fd86..9b0d9f7 100644
--- a/drivers/input/rmi4/rmi_f12.c
+++ b/drivers/input/rmi4/rmi_f12.c
@@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
 	struct rmi_device *rmi_dev = fn->rmi_dev;
 	int ret;
 	int offset;
-	u8 buf[14];
+	u8 buf[15];
 	int pitch_x = 0;
 	int pitch_y = 0;
 	int clip_x_low = 0;
@@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
 
 	offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
 
-	if (item->reg_size > 14) {
-		dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
+	if (item->reg_size > 15) {
+		dev_err(&fn->dev,
+			"F12 control8 should be a maximum of 15 bytes, not: %ld\n",
 			item->reg_size);
 		return -ENODEV;
 	}
-- 
2.7.4

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

* Re: [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8
  2016-07-19 23:43 ` Andrew Duggan
  (?)
@ 2016-07-20  0:00 ` Dmitry Torokhov
  2016-07-20  0:02     ` Andrew Duggan
  -1 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2016-07-20  0:00 UTC (permalink / raw)
  To: Andrew Duggan
  Cc: linux-input, linux-kernel, Jiri Kosina, Benjamin Tissoires,
	Vincent Huang, Nick Dyer, Chris Healy, Nitin Chaudhary, stable

On Tue, Jul 19, 2016 at 04:43:41PM -0700, Andrew Duggan wrote:
> According to the RMI4 spec the maximum size of F12 control register 8 is
> 15 bytes. The current code incorrectly reports an error if control 8 is
> greater then 14. Making sensors with a control register 8 with 15 bytes
> unusable.
> 
> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
> Reported-by: Chris Healy <cphealy@gmail.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/input/rmi4/rmi_f12.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
> index c30fd86..9b0d9f7 100644
> --- a/drivers/input/rmi4/rmi_f12.c
> +++ b/drivers/input/rmi4/rmi_f12.c
> @@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>  	struct rmi_device *rmi_dev = fn->rmi_dev;
>  	int ret;
>  	int offset;
> -	u8 buf[14];
> +	u8 buf[15];
>  	int pitch_x = 0;
>  	int pitch_y = 0;
>  	int clip_x_low = 0;
> @@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>  
>  	offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
>  
> -	if (item->reg_size > 14) {
> -		dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
> +	if (item->reg_size > 15) {

Do you mind if I change this to sizeof(buf)?

> +		dev_err(&fn->dev,
> +			"F12 control8 should be a maximum of 15 bytes, not: %ld\n",
>  			item->reg_size);
>  		return -ENODEV;
>  	}
> -- 
> 2.7.4
> 

-- 
Dmitry

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

* Re: [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8
  2016-07-20  0:00 ` Dmitry Torokhov
@ 2016-07-20  0:02     ` Andrew Duggan
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Duggan @ 2016-07-20  0:02 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Jiri Kosina, Benjamin Tissoires,
	Vincent Huang, Nick Dyer, Chris Healy, Nitin Chaudhary, stable

On 07/19/2016 05:00 PM, Dmitry Torokhov wrote:
> On Tue, Jul 19, 2016 at 04:43:41PM -0700, Andrew Duggan wrote:
>> According to the RMI4 spec the maximum size of F12 control register 8 is
>> 15 bytes. The current code incorrectly reports an error if control 8 is
>> greater then 14. Making sensors with a control register 8 with 15 bytes
>> unusable.
>>
>> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
>> Reported-by: Chris Healy <cphealy@gmail.com>
>> Cc: stable@vger.kernel.org
>> ---
>>   drivers/input/rmi4/rmi_f12.c | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
>> index c30fd86..9b0d9f7 100644
>> --- a/drivers/input/rmi4/rmi_f12.c
>> +++ b/drivers/input/rmi4/rmi_f12.c
>> @@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>>   	struct rmi_device *rmi_dev = fn->rmi_dev;
>>   	int ret;
>>   	int offset;
>> -	u8 buf[14];
>> +	u8 buf[15];
>>   	int pitch_x = 0;
>>   	int pitch_y = 0;
>>   	int clip_x_low = 0;
>> @@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>>   
>>   	offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
>>   
>> -	if (item->reg_size > 14) {
>> -		dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
>> +	if (item->reg_size > 15) {
> Do you mind if I change this to sizeof(buf)?

Nope, that is fine with me.

Thanks,
Andrew

>
>> +		dev_err(&fn->dev,
>> +			"F12 control8 should be a maximum of 15 bytes, not: %ld\n",
>>   			item->reg_size);
>>   		return -ENODEV;
>>   	}
>> -- 
>> 2.7.4
>>

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

* Re: [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8
@ 2016-07-20  0:02     ` Andrew Duggan
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Duggan @ 2016-07-20  0:02 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Jiri Kosina, Benjamin Tissoires,
	Vincent Huang, Nick Dyer, Chris Healy, Nitin Chaudhary, stable

On 07/19/2016 05:00 PM, Dmitry Torokhov wrote:
> On Tue, Jul 19, 2016 at 04:43:41PM -0700, Andrew Duggan wrote:
>> According to the RMI4 spec the maximum size of F12 control register 8 is
>> 15 bytes. The current code incorrectly reports an error if control 8 is
>> greater then 14. Making sensors with a control register 8 with 15 bytes
>> unusable.
>>
>> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
>> Reported-by: Chris Healy <cphealy@gmail.com>
>> Cc: stable@vger.kernel.org
>> ---
>>   drivers/input/rmi4/rmi_f12.c | 7 ++++---
>>   1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
>> index c30fd86..9b0d9f7 100644
>> --- a/drivers/input/rmi4/rmi_f12.c
>> +++ b/drivers/input/rmi4/rmi_f12.c
>> @@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>>   	struct rmi_device *rmi_dev = fn->rmi_dev;
>>   	int ret;
>>   	int offset;
>> -	u8 buf[14];
>> +	u8 buf[15];
>>   	int pitch_x = 0;
>>   	int pitch_y = 0;
>>   	int clip_x_low = 0;
>> @@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>>   
>>   	offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
>>   
>> -	if (item->reg_size > 14) {
>> -		dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
>> +	if (item->reg_size > 15) {
> Do you mind if I change this to sizeof(buf)?

Nope, that is fine with me.

Thanks,
Andrew

>
>> +		dev_err(&fn->dev,
>> +			"F12 control8 should be a maximum of 15 bytes, not: %ld\n",
>>   			item->reg_size);
>>   		return -ENODEV;
>>   	}
>> -- 
>> 2.7.4
>>

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

* Re: [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8
  2016-07-19 23:43 ` Andrew Duggan
  (?)
  (?)
@ 2016-07-20  1:16 ` Nitin Chaudhary
  -1 siblings, 0 replies; 6+ messages in thread
From: Nitin Chaudhary @ 2016-07-20  1:16 UTC (permalink / raw)
  To: Andrew Duggan
  Cc: linux-input, linux-kernel, Dmitry Torokhov, Jiri Kosina,
	Benjamin Tissoires, Vincent Huang, Nick Dyer, Chris Healy,
	stable

Tested on i.MX6Q Board with Synaptics 7813 Touch Controller, works fine.

Tested by: Nitin Chaudhary <nitinchaudhary1289@gmail.com>

On Tue, Jul 19, 2016 at 4:43 PM, Andrew Duggan <aduggan@synaptics.com> wrote:
> According to the RMI4 spec the maximum size of F12 control register 8 is
> 15 bytes. The current code incorrectly reports an error if control 8 is
> greater then 14. Making sensors with a control register 8 with 15 bytes
> unusable.
>
> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
> Reported-by: Chris Healy <cphealy@gmail.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/input/rmi4/rmi_f12.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
> index c30fd86..9b0d9f7 100644
> --- a/drivers/input/rmi4/rmi_f12.c
> +++ b/drivers/input/rmi4/rmi_f12.c
> @@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>         struct rmi_device *rmi_dev = fn->rmi_dev;
>         int ret;
>         int offset;
> -       u8 buf[14];
> +       u8 buf[15];
>         int pitch_x = 0;
>         int pitch_y = 0;
>         int clip_x_low = 0;
> @@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>
>         offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
>
> -       if (item->reg_size > 14) {
> -               dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
> +       if (item->reg_size > 15) {
> +               dev_err(&fn->dev,
> +                       "F12 control8 should be a maximum of 15 bytes, not: %ld\n",
>                         item->reg_size);
>                 return -ENODEV;
>         }
> --
> 2.7.4
>


On Tue, Jul 19, 2016 at 4:43 PM, Andrew Duggan <aduggan@synaptics.com> wrote:
> According to the RMI4 spec the maximum size of F12 control register 8 is
> 15 bytes. The current code incorrectly reports an error if control 8 is
> greater then 14. Making sensors with a control register 8 with 15 bytes
> unusable.
>
> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
> Reported-by: Chris Healy <cphealy@gmail.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/input/rmi4/rmi_f12.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c
> index c30fd86..9b0d9f7 100644
> --- a/drivers/input/rmi4/rmi_f12.c
> +++ b/drivers/input/rmi4/rmi_f12.c
> @@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>         struct rmi_device *rmi_dev = fn->rmi_dev;
>         int ret;
>         int offset;
> -       u8 buf[14];
> +       u8 buf[15];
>         int pitch_x = 0;
>         int pitch_y = 0;
>         int clip_x_low = 0;
> @@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12)
>
>         offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8);
>
> -       if (item->reg_size > 14) {
> -               dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n",
> +       if (item->reg_size > 15) {
> +               dev_err(&fn->dev,
> +                       "F12 control8 should be a maximum of 15 bytes, not: %ld\n",
>                         item->reg_size);
>                 return -ENODEV;
>         }
> --
> 2.7.4
>



-- 
Thanks & Regards

Nitin Chaudhary
Nitin Chaudhary
MS, Electrical Engineering
University of Southern California
Intern, Zodiac In-flight Innovations

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

end of thread, other threads:[~2016-07-20  1:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19 23:43 [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8 Andrew Duggan
2016-07-19 23:43 ` Andrew Duggan
2016-07-20  0:00 ` Dmitry Torokhov
2016-07-20  0:02   ` Andrew Duggan
2016-07-20  0:02     ` Andrew Duggan
2016-07-20  1:16 ` Nitin Chaudhary

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.