diff mbox

[1/2] input: usb: hid: Bump maximum global item tag report size to 128 bytes

Message ID 1344203835-8308-1-git-send-email-marex@denx.de (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Marek Vasut Aug. 5, 2012, 9:57 p.m. UTC
The Freescale i.MX28 BootROM USB recovery mode implements the USB HID
protocol, yet the global item tag report size is 128. Linux checks if
this is 96 as of now, see [1]. This causes Linux to refuse to communicate
with this device, making it impossible to use the recovery mode.

This is not a standard HID device per se, but rather a software emulation
implemented within the BootROM code and realized through USB OTG-capable
port switched to device mode present on the device.

Previous attempt to discuss this issue dates back to 2011, see [2]. There
has been not much response. Also noteworthy is the [3], where there seems
to be a pointing device that has issue similar to this one.

The tool making use of the USB recovery mode is available at [4].

[1] http://comments.gmane.org/gmane.linux.kernel.input/22328
[2] http://www.spinics.net/lists/linux-usb/msg43463.html
[3] https://bbs.archlinux.org/viewtopic.php?pid=1141340
[4] http://git.bfuser.eu/?p=marex/mxsldr.git;a=summary

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chen Peter <B29397@freescale.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jiri Kosina <jkosina@suse.cz>
---
 drivers/hid/hid-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Kosina Aug. 15, 2012, 8:33 a.m. UTC | #1
On Sun, 5 Aug 2012, Marek Vasut wrote:

> The Freescale i.MX28 BootROM USB recovery mode implements the USB HID
> protocol, yet the global item tag report size is 128. Linux checks if
> this is 96 as of now, see [1]. This causes Linux to refuse to communicate
> with this device, making it impossible to use the recovery mode.
> 
> This is not a standard HID device per se, but rather a software emulation
> implemented within the BootROM code and realized through USB OTG-capable
> port switched to device mode present on the device.
> 
> Previous attempt to discuss this issue dates back to 2011, see [2]. There
> has been not much response. Also noteworthy is the [3], where there seems
> to be a pointing device that has issue similar to this one.
> 
> The tool making use of the USB recovery mode is available at [4].
> 
> [1] http://comments.gmane.org/gmane.linux.kernel.input/22328
> [2] http://www.spinics.net/lists/linux-usb/msg43463.html
> [3] https://bbs.archlinux.org/viewtopic.php?pid=1141340
> [4] http://git.bfuser.eu/?p=marex/mxsldr.git;a=summary
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Chen Peter <B29397@freescale.com>
> Cc: Greg KH <greg@kroah.com>
> Cc: Jiri Kosina <jkosina@suse.cz>

I have not admit I don't remember where the original limit came from -- 
the spec doesn't mandate it as far as I can tell.

I am queueing this patch now for next merge window. Thanks.

> ---
>  drivers/hid/hid-core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 60ea284..2b9dd76 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -374,7 +374,7 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
>  
>  	case HID_GLOBAL_ITEM_TAG_REPORT_SIZE:
>  		parser->global.report_size = item_udata(item);
> -		if (parser->global.report_size > 96) {
> +		if (parser->global.report_size > 128) {
>  			hid_err(parser->device, "invalid report_size %d\n",
>  					parser->global.report_size);
>  			return -1;
> -- 
> 1.7.10.4
>
Marek Vasut Aug. 15, 2012, 11:56 a.m. UTC | #2
Dear Jiri Kosina,

> On Sun, 5 Aug 2012, Marek Vasut wrote:
> > The Freescale i.MX28 BootROM USB recovery mode implements the USB HID
> > protocol, yet the global item tag report size is 128. Linux checks if
> > this is 96 as of now, see [1]. This causes Linux to refuse to communicate
> > with this device, making it impossible to use the recovery mode.
> > 
> > This is not a standard HID device per se, but rather a software emulation
> > implemented within the BootROM code and realized through USB OTG-capable
> > port switched to device mode present on the device.
> > 
> > Previous attempt to discuss this issue dates back to 2011, see [2]. There
> > has been not much response. Also noteworthy is the [3], where there seems
> > to be a pointing device that has issue similar to this one.
> > 
> > The tool making use of the USB recovery mode is available at [4].
> > 
> > [1] http://comments.gmane.org/gmane.linux.kernel.input/22328
> > [2] http://www.spinics.net/lists/linux-usb/msg43463.html
> > [3] https://bbs.archlinux.org/viewtopic.php?pid=1141340
> > [4] http://git.bfuser.eu/?p=marex/mxsldr.git;a=summary
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Chen Peter <B29397@freescale.com>
> > Cc: Greg KH <greg@kroah.com>
> > Cc: Jiri Kosina <jkosina@suse.cz>
> 
> I have not admit I don't remember where the original limit came from --
> the spec doesn't mandate it as far as I can tell.
> 
> I am queueing this patch now for next merge window. Thanks.
[...]

Thanks!

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 60ea284..2b9dd76 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -374,7 +374,7 @@  static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
 
 	case HID_GLOBAL_ITEM_TAG_REPORT_SIZE:
 		parser->global.report_size = item_udata(item);
-		if (parser->global.report_size > 96) {
+		if (parser->global.report_size > 128) {
 			hid_err(parser->device, "invalid report_size %d\n",
 					parser->global.report_size);
 			return -1;