i2c_hid: enable i2c-hid devices to suspend/resume asynchronously
PATCH 1/1 i2c_hid: enable i2c-hid devices to suspend/resume asynchronously
i2c-hid devices' suspend/resume are usually time-consuming process. For example, the touch controller(i2c-ATML1000:00) on ASUS T100 tablet takes about 160ms for suspending and 120ms for resuming. This patch enables i2c-hid devices to suspend/resume asynchronously. This will take advantage of multicore and speed up system suspend/resume process.
--- drivers/hid/i2c-hid/i2c-hid.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hid/i2c-hid/i2c-hid.c +1 -0
@@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,pm_runtime_get_noresume (&client->dev);pm_runtime_set_active (&client->dev);pm_runtime_enable (&client->dev); +device_enable_async_suspend (&client->dev); ret =i2c_hid_fetch_hid_descriptor (ihid);if (ret <0 )
-- 1.7.1
Quoted 7 lines · Zhonghui
i2c-hid devices' suspend/resume are usually time-consuming process. For example, the touch controller(i2c-ATML1000:00) on ASUS T100 tablet takes about 160ms for suspending and 120ms for resuming. This patch enables i2c-hid devices to suspend/resume asynchronously. This will take advantage of multicore and speed up system suspend/resume process.
Signed-off-by Zhonghui Fu <[email protected]>
Looks reasonable to me,
Jiri Kosina
maintainerQuoted 5 lines · Zhonghui
i2c-hid devices' suspend/resume are usually time-consuming process. For example, the touch controller(i2c-ATML1000:00) on ASUS T100 tablet takes about 160ms for suspending and 120ms for resuming. This patch enables i2c-hid devices to suspend/resume asynchronously. This will take advantage of multicore and speed up system suspend/resume process.
Umm, why do we need this in the first place, given the fact that we are enabling async suspend for each and every HID device allocated via hid_allocate_device() already?
Signature · 2 lines
Jiri Kosina SUSE Labs
A message that is not in the archive (sent off-list or not yet received): CAE_wzQ-Rwpf3Cb8cpw11s=rcRTMZ5kpod7jLAhF84A82CLaVcA@mail.gmail.com
Quoted 9 lines · Dmitry Torokhov
Quoted 7 lines · Jiri Kosina
Quoted 5 lines · Zhonghui
i2c-hid devices' suspend/resume are usually time-consuming process. For example, the touch controller(i2c-ATML1000:00) on ASUS T100 tablet takes about 160ms for suspending and 120ms for resuming. This patch enables i2c-hid devices to suspend/resume asynchronously. This will take advantage of multicore and speed up system suspend/resume process.
Quoted 7 lines
Quoted 4 lines
Umm, why do we need this in the first place, given the fact that we are enabling async suspend for each and every HID device allocated via
hid_allocate_device()already?i2c-hid is not a HID but I2C device on I2C bus and is currently resumed synchronously, in-line. Since it tries to reset device as part of resume it may take a while for the device to respond.
Sorry for late reply.
Yes, the devices driven by i2c-hid driver are I2C devices, not HID devices.
Quoted 6 lines
BTW, I am not quite sure what async suspend enabled
inhid_allocate_device()does for us, given that I do not see HID bus implementing the suspend/resume support for its devices (as far as I remember we rely on underlying transports - USB or I2C - to resume the devices properly).
Even if HID bus does not implement the suspend/resume support for its devices, the power domain, device type, device class or device driver subsystem related to HID devices can still implement the suspend/resume support for HID devices.
Thanks,
Zhonghui
Quoted 4 lines
Thanks,
Dmitry
Quoted 8 lines · Zhonghui
i2c-hid devices' suspend/resume are usually time-consuming process. For example, the touch controller(i2c-ATML1000:00) on ASUS T100 tablet takes about 160ms for suspending and 120ms for resuming. This patch enables i2c-hid devices to suspend/resume asynchronously. This will take advantage of multicore and speed up system suspend/resume process.
Signed-off-by Zhonghui Fu <[email protected]>---
In regard with the discussion:
Quoted 17 lines
drivers/hid/i2c-hid/i2c-hid.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/hid/i2c-hid/i2c-hid.c +1
-1@@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,pm_runtime_get_noresume (&client->dev);pm_runtime_set_active (&client->dev);pm_runtime_enable (&client->dev); +device_enable_async_suspend (&client->dev); ret =i2c_hid_fetch_hid_descriptor (ihid);if (ret <0 ) -- 1.7.1
Quoted 16 lines · Zhonghui
i2c-hid devices' suspend/resume are usually time-consuming process. For example, the touch controller(i2c-ATML1000:00) on ASUS T100 tablet takes about 160ms for suspending and 120ms for resuming. This patch enables i2c-hid devices to suspend/resume asynchronously. This will take advantage of multicore and speed up system suspend/resume process.
Signed-off-by Zhonghui Fu <[email protected]>--- drivers/hid/i2c-hid/i2c-hid.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/hid/i2c-hid/i2c-hid.c +0
-0
drivers/hid/i2c-hid/i2c-hid.c static int i2c_hid_probe(struct i2c_client *client, · line 1026
Quoted 7 lines
drivers/hid/i2c-hid/i2c-hid.c +1
-0@@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,pm_runtime_get_noresume (&client->dev);pm_runtime_set_active (&client->dev);pm_runtime_enable (&client->dev); +device_enable_async_suspend (&client->dev); ret =i2c_hid_fetch_hid_descriptor (ihid);if (ret <0 )
Applied to hid.git#for-4.8/i2c-hid.
Signature · 2 lines
Jiri Kosina SUSE Labs