* [PATCH] HID: rmi: print an error if F11 is not found instead of stopping the device
@ 2014-08-06 20:37 Andrew Duggan
2014-08-14 9:43 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Duggan @ 2014-08-06 20:37 UTC (permalink / raw)
To: linux-input, linux-kernel; +Cc: Andrew Duggan, Jiri Kosina, Benjamin Tissoires
Currently rmi_probe will return -EIO if the device doesn't report that it has F11.
This would indicate that something happened and the device is in the bootloader.
We can recover the device using a userspace firmware update tool, but it needs
access to the device through the hidraw device file. If the probe returns -EIO
the hidraw device won't be created. So instead of failing the probe, just print
an error message, but leave the device accessible from userspace.
Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
---
drivers/hid/hid-rmi.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
index 0dc2514..8389e81 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
@@ -909,10 +909,15 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
return ret;
}
- if (!test_bit(RMI_STARTED, &data->flags)) {
- hid_hw_stop(hdev);
- return -EIO;
- }
+ if (!test_bit(RMI_STARTED, &data->flags))
+ /*
+ * The device maybe in the bootloader if rmi_input_configured
+ * failed to find F11 in the PDT. Print an error, but don't
+ * return an error from rmi_probe so that hidraw will be
+ * accessible from userspace. That way a userspace tool
+ * can be used to reload working firmware on the touchpad.
+ */
+ hid_err(hdev, "Device failed to be properly configured\n");
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: rmi: print an error if F11 is not found instead of stopping the device
2014-08-06 20:37 [PATCH] HID: rmi: print an error if F11 is not found instead of stopping the device Andrew Duggan
@ 2014-08-14 9:43 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2014-08-14 9:43 UTC (permalink / raw)
To: Andrew Duggan; +Cc: linux-input, linux-kernel, Benjamin Tissoires
On Wed, 6 Aug 2014, Andrew Duggan wrote:
> Currently rmi_probe will return -EIO if the device doesn't report that it has F11.
> This would indicate that something happened and the device is in the bootloader.
> We can recover the device using a userspace firmware update tool, but it needs
> access to the device through the hidraw device file. If the probe returns -EIO
> the hidraw device won't be created. So instead of failing the probe, just print
> an error message, but leave the device accessible from userspace.
>
> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
> ---
> drivers/hid/hid-rmi.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
> index 0dc2514..8389e81 100644
> --- a/drivers/hid/hid-rmi.c
> +++ b/drivers/hid/hid-rmi.c
> @@ -909,10 +909,15 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
> return ret;
> }
>
> - if (!test_bit(RMI_STARTED, &data->flags)) {
> - hid_hw_stop(hdev);
> - return -EIO;
> - }
> + if (!test_bit(RMI_STARTED, &data->flags))
> + /*
> + * The device maybe in the bootloader if rmi_input_configured
> + * failed to find F11 in the PDT. Print an error, but don't
> + * return an error from rmi_probe so that hidraw will be
> + * accessible from userspace. That way a userspace tool
> + * can be used to reload working firmware on the touchpad.
> + */
> + hid_err(hdev, "Device failed to be properly configured\n");
Queued for 3.17 still. Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-14 9:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 20:37 [PATCH] HID: rmi: print an error if F11 is not found instead of stopping the device Andrew Duggan
2014-08-14 9:43 ` Jiri Kosina
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).