Re: Patch "HID: multitouch: Fetch feature reports on demand for Win8 devices" has been added to the 4.3-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 14 2016 or thereabouts, gregkh@xxxxxxxxxxxxxxxxxxx wrote:
> 
> This is a note to let you know that I've just added the patch titled
> 
>     HID: multitouch: Fetch feature reports on demand for Win8 devices
> 
> to the 4.3-stable tree which can be found at:
>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> 
> The filename of the patch is:
>      hid-multitouch-fetch-feature-reports-on-demand-for-win8-devices.patch
> and it can be found in the queue-4.3 subdirectory.
> 
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@xxxxxxxxxxxxxxx> know about it.

Hi Greg,

If you backport this to 4.3, I'd like you to pull in 73e7d63 ("HID:
multitouch: fix input mode switching on some Elan panels").
The commit added to your stable queue (6d4f5440) revealed a firmware
issue on Elan panels that were unnoticed before.

Cheers,
Benjamin

> 
> 
> From 6d4f5440a3a2bb2e9d0d582bbf98234e9e9bb095 Mon Sep 17 00:00:00 2001
> From: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
> Date: Wed, 7 Oct 2015 15:33:43 +0300
> Subject: HID: multitouch: Fetch feature reports on demand for Win8 devices
> 
> From: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
> 
> commit 6d4f5440a3a2bb2e9d0d582bbf98234e9e9bb095 upstream.
> 
> Some newer Intel Skylake based Dell laptops with Win8 precision touchpad
> fail when initial feature reports are fetched from it. Below is an example
> output with some additional debug included:
> 
>  i2c_hid i2c-DLL0704:01: Fetching the HID descriptor
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=20 00
>  i2c_hid i2c-DLL0704:01: HID Descriptor: 1e 00 00 01 99 02 21 00 24 ...
>  ...
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 38 02 23 00
>  i2c_hid i2c-DLL0704:01: report (len=4): 04 00 08 05
>  i2c_hid i2c-DLL0704:01: report id 13
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 3d 02 23 00
>  i2c_hid i2c-DLL0704:01: failed to retrieve report from device.
>  i2c_hid i2c-DLL0704:01: report id 7
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 37 02 23 00
>  i2c_hid i2c-DLL0704:01: report (len=259): 03 01 07 fc 28 fe 84 40 ...
>  i2c_hid i2c-DLL0704:01: report id 4
>  i2c_hid i2c-DLL0704:01: i2c_hid_get_report
>  i2c_hid i2c-DLL0704:01: __i2c_hid_command: cmd=22 00 34 02 23 00
> 
> We manage to fetch few reports but then the touchpad dies:
> 
>  i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration
>  i2c_hid i2c-DLL0704:01: failed to retrieve report from device.
> 
> it eventually pulls the whole I2C bus low:
> 
>  i2c_designware i2c_designware.1: controller timed out
>  i2c_hid i2c-DLL0704:01: failed to set a report to device.
> 
> Fix this by preventing initial feature report retrieval for Win8 devices.
> Instead we fetch reports as needed in mt_feature_mapping(). This prevents
> fetching reports which might cause problems with the device in question.
> 
> Suggested-by: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
> Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
> Tested-by: Seth Forshee <seth.forshee@xxxxxxxxxxxxx>
> Signed-off-by: Jiri Kosina <jkosina@xxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> 
> ---
>  drivers/hid/hid-multitouch.c |   45 ++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 44 insertions(+), 1 deletion(-)
> 
> --- a/drivers/hid/hid-multitouch.c
> +++ b/drivers/hid/hid-multitouch.c
> @@ -309,6 +309,41 @@ static struct attribute_group mt_attribu
>  	.attrs = sysfs_attrs
>  };
>  
> +static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
> +{
> +	struct mt_device *td = hid_get_drvdata(hdev);
> +	int ret, size = hid_report_len(report);
> +	u8 *buf;
> +
> +	/*
> +	 * Only fetch the feature report if initial reports are not already
> +	 * been retrieved. Currently this is only done for Windows 8 touch
> +	 * devices.
> +	 */
> +	if (!(hdev->quirks & HID_QUIRK_NO_INIT_REPORTS))
> +		return;
> +	if (td->mtclass.name != MT_CLS_WIN_8)
> +		return;
> +
> +	buf = hid_alloc_report_buf(report, GFP_KERNEL);
> +	if (!buf)
> +		return;
> +
> +	ret = hid_hw_raw_request(hdev, report->id, buf, size,
> +				 HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
> +	if (ret < 0) {
> +		dev_warn(&hdev->dev, "failed to fetch feature %d\n",
> +			 report->id);
> +	} else {
> +		ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, buf,
> +					   size, 0);
> +		if (ret)
> +			dev_warn(&hdev->dev, "failed to report feature\n");
> +	}
> +
> +	kfree(buf);
> +}
> +
>  static void mt_feature_mapping(struct hid_device *hdev,
>  		struct hid_field *field, struct hid_usage *usage)
>  {
> @@ -327,6 +362,8 @@ static void mt_feature_mapping(struct hi
>  
>  		break;
>  	case HID_DG_CONTACTMAX:
> +		mt_get_feature(hdev, field->report);
> +
>  		td->maxcontact_report_id = field->report->id;
>  		td->maxcontacts = field->value[0];
>  		if (!td->maxcontacts &&
> @@ -343,6 +380,7 @@ static void mt_feature_mapping(struct hi
>  			break;
>  		}
>  
> +		mt_get_feature(hdev, field->report);
>  		if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD)
>  			td->is_buttonpad = true;
>  
> @@ -1026,8 +1064,13 @@ static int mt_probe(struct hid_device *h
>  		 * reports. Fortunately, the Win8 spec says that all touches
>  		 * should be sent during each report, making the initialization
>  		 * of input reports unnecessary.
> +		 *
> +		 * In addition some touchpads do not behave well if we read
> +		 * all feature reports from them. Instead we prevent
> +		 * initial report fetching and then selectively fetch each
> +		 * report we are interested in.
>  		 */
> -		hdev->quirks |= HID_QUIRK_NO_INIT_INPUT_REPORTS;
> +		hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS;
>  
>  	td = devm_kzalloc(&hdev->dev, sizeof(struct mt_device), GFP_KERNEL);
>  	if (!td) {
> 
> 
> Patches currently in stable-queue which might be from mika.westerberg@xxxxxxxxxxxxxxx are
> 
> queue-4.3/hid-multitouch-fetch-feature-reports-on-demand-for-win8-devices.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]