linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound
  2015-11-05 23:34 [PATCH 00/26] Consolidate patches and add support for new devices Andrew Duggan
@ 2015-11-05 23:34 ` Andrew Duggan
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Duggan @ 2015-11-05 23:34 UTC (permalink / raw)
  To: linux-input, linux-kernel
  Cc: Benjamin Tissoires, Dmitry Torokhov, Linus Walleij,
	Benjamin Tissoires, Christopher Heiny, Stephen Chandler Paul

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>

If the device has been registered but is not populated, we should not
process any incoming interrupt.
Make sure the pointers we are following are valid.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Andrew Duggan <aduggan@synaptics.com>
---
 drivers/input/rmi4/rmi_driver.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 2fdc7e8..fe5f2f9 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -279,6 +279,9 @@ int rmi_process_interrupt_requests(struct rmi_device *rmi_dev)
 	struct rmi_function *entry;
 	int error;
 
+	if (!data || !data->f01_container || !data->irq_status)
+		return 0;
+
 	error = rmi_read_block(rmi_dev,
 				data->f01_container->fd.data_base_addr + 1,
 				data->irq_status, data->num_of_irq_regs);
-- 
2.1.4

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

* [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound
@ 2015-11-05 23:37 Andrew Duggan
  2015-11-09 12:58 ` Linus Walleij
  2015-11-09 23:16 ` Dmitry Torokhov
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Duggan @ 2015-11-05 23:37 UTC (permalink / raw)
  To: linux-input, linux-kernel
  Cc: Benjamin Tissoires, Dmitry Torokhov, Linus Walleij,
	Benjamin Tissoires, Christopher Heiny, Stephen Chandler Paul

From: Benjamin Tissoires <benjamin.tissoires@redhat.com>

If the device has been registered but is not populated, we should not
process any incoming interrupt.
Make sure the pointers we are following are valid.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Andrew Duggan <aduggan@synaptics.com>
---
 drivers/input/rmi4/rmi_driver.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 2fdc7e8..fe5f2f9 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -279,6 +279,9 @@ int rmi_process_interrupt_requests(struct rmi_device *rmi_dev)
 	struct rmi_function *entry;
 	int error;
 
+	if (!data || !data->f01_container || !data->irq_status)
+		return 0;
+
 	error = rmi_read_block(rmi_dev,
 				data->f01_container->fd.data_base_addr + 1,
 				data->irq_status, data->num_of_irq_regs);
-- 
2.1.4

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

* Re: [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound
  2015-11-05 23:37 [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound Andrew Duggan
@ 2015-11-09 12:58 ` Linus Walleij
  2015-11-09 23:16 ` Dmitry Torokhov
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2015-11-09 12:58 UTC (permalink / raw)
  To: Andrew Duggan
  Cc: Linux Input, linux-kernel@vger.kernel.org, Benjamin Tissoires,
	Dmitry Torokhov, Benjamin Tissoires, Christopher Heiny,
	Stephen Chandler Paul

On Fri, Nov 6, 2015 at 12:37 AM, Andrew Duggan <aduggan@synaptics.com> wrote:

> From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>
> If the device has been registered but is not populated, we should not
> process any incoming interrupt.
> Make sure the pointers we are following are valid.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Tested-by: Andrew Duggan <aduggan@synaptics.com>

Tested-by: Linus Walleij <linus.walleij@linaro.org>

This should just be squashed into the offending commit.

Yours,
Linus Walleij

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

* Re: [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound
  2015-11-05 23:37 [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound Andrew Duggan
  2015-11-09 12:58 ` Linus Walleij
@ 2015-11-09 23:16 ` Dmitry Torokhov
  2015-11-10  9:11   ` Benjamin Tissoires
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2015-11-09 23:16 UTC (permalink / raw)
  To: Andrew Duggan
  Cc: linux-input, linux-kernel, Benjamin Tissoires, Linus Walleij,
	Benjamin Tissoires, Christopher Heiny, Stephen Chandler Paul

On Thu, Nov 05, 2015 at 03:37:25PM -0800, Andrew Duggan wrote:
> From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> 
> If the device has been registered but is not populated, we should not
> process any incoming interrupt.
> Make sure the pointers we are following are valid.

Why are the interrupts enabled when device is not ready?

> 
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> Tested-by: Andrew Duggan <aduggan@synaptics.com>
> ---
>  drivers/input/rmi4/rmi_driver.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> index 2fdc7e8..fe5f2f9 100644
> --- a/drivers/input/rmi4/rmi_driver.c
> +++ b/drivers/input/rmi4/rmi_driver.c
> @@ -279,6 +279,9 @@ int rmi_process_interrupt_requests(struct rmi_device *rmi_dev)
>  	struct rmi_function *entry;
>  	int error;
>  
> +	if (!data || !data->f01_container || !data->irq_status)
> +		return 0;
> +
>  	error = rmi_read_block(rmi_dev,
>  				data->f01_container->fd.data_base_addr + 1,
>  				data->irq_status, data->num_of_irq_regs);
> -- 
> 2.1.4
> 

-- 
Dmitry

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

* Re: [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound
  2015-11-09 23:16 ` Dmitry Torokhov
@ 2015-11-10  9:11   ` Benjamin Tissoires
  0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Tissoires @ 2015-11-10  9:11 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andrew Duggan, linux-input, linux-kernel@vger.kernel.org,
	Benjamin Tissoires, Linus Walleij, Christopher Heiny,
	Stephen Chandler Paul

On Tue, Nov 10, 2015 at 12:16 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Nov 05, 2015 at 03:37:25PM -0800, Andrew Duggan wrote:
>> From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>>
>> If the device has been registered but is not populated, we should not
>> process any incoming interrupt.
>> Make sure the pointers we are following are valid.
>
> Why are the interrupts enabled when device is not ready?

Hmm... Yes, maybe this should have been tackled at the smbus level.
Sorting this out might also help in the various suspend/resume bugs we
are experiencing.

Cheers,
Benjamin

>
>>
>> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>> Tested-by: Andrew Duggan <aduggan@synaptics.com>
>> ---
>>  drivers/input/rmi4/rmi_driver.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
>> index 2fdc7e8..fe5f2f9 100644
>> --- a/drivers/input/rmi4/rmi_driver.c
>> +++ b/drivers/input/rmi4/rmi_driver.c
>> @@ -279,6 +279,9 @@ int rmi_process_interrupt_requests(struct rmi_device *rmi_dev)
>>       struct rmi_function *entry;
>>       int error;
>>
>> +     if (!data || !data->f01_container || !data->irq_status)
>> +             return 0;
>> +
>>       error = rmi_read_block(rmi_dev,
>>                               data->f01_container->fd.data_base_addr + 1,
>>                               data->irq_status, data->num_of_irq_regs);
>> --
>> 2.1.4
>>
>
> --
> Dmitry

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

end of thread, other threads:[~2015-11-10  9:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-05 23:37 [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound Andrew Duggan
2015-11-09 12:58 ` Linus Walleij
2015-11-09 23:16 ` Dmitry Torokhov
2015-11-10  9:11   ` Benjamin Tissoires
  -- strict thread matches above, loose matches on Subject: below --
2015-11-05 23:34 [PATCH 00/26] Consolidate patches and add support for new devices Andrew Duggan
2015-11-05 23:34 ` [PATCH 04/26] Input: synaptics-rmi4 - prevent oopses when irq arrives while the device is not bound Andrew Duggan

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).