Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-06-06 Thread Jiri Kosina
On Thu, 19 May 2016, Fu, Zhonghui wrote:

> 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 
> ---
>  drivers/hid/i2c-hid/i2c-hid.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 2e021ba..cc41e1e 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,
>   pm_runtime_get_noresume(>dev);
>   pm_runtime_set_active(>dev);
>   pm_runtime_enable(>dev);
> + device_enable_async_suspend(>dev);
>  
>   ret = i2c_hid_fetch_hid_descriptor(ihid);
>   if (ret < 0)

Applied to hid.git#for-4.8/i2c-hid.

-- 
Jiri Kosina
SUSE Labs



Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-06-06 Thread Jiri Kosina
On Thu, 19 May 2016, Fu, Zhonghui wrote:

> 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 
> ---
>  drivers/hid/i2c-hid/i2c-hid.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 2e021ba..cc41e1e 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,
>   pm_runtime_get_noresume(>dev);
>   pm_runtime_set_active(>dev);
>   pm_runtime_enable(>dev);
> + device_enable_async_suspend(>dev);
>  
>   ret = i2c_hid_fetch_hid_descriptor(ihid);
>   if (ret < 0)

Applied to hid.git#for-4.8/i2c-hid.

-- 
Jiri Kosina
SUSE Labs



Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-06-03 Thread Benjamin Tissoires
On May 19 2016 or thereabouts, Fu, Zhonghui wrote:
> 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 
> ---

In regard with the discussion:
Acked-by: Benjamin Tissoires 

>  drivers/hid/i2c-hid/i2c-hid.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 2e021ba..cc41e1e 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,
>   pm_runtime_get_noresume(>dev);
>   pm_runtime_set_active(>dev);
>   pm_runtime_enable(>dev);
> + device_enable_async_suspend(>dev);
>  
>   ret = i2c_hid_fetch_hid_descriptor(ihid);
>   if (ret < 0)
> -- 1.7.1
> 


Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-06-03 Thread Benjamin Tissoires
On May 19 2016 or thereabouts, Fu, Zhonghui wrote:
> 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 
> ---

In regard with the discussion:
Acked-by: Benjamin Tissoires 

>  drivers/hid/i2c-hid/i2c-hid.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 2e021ba..cc41e1e 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,
>   pm_runtime_get_noresume(>dev);
>   pm_runtime_set_active(>dev);
>   pm_runtime_enable(>dev);
> + device_enable_async_suspend(>dev);
>  
>   ret = i2c_hid_fetch_hid_descriptor(ihid);
>   if (ret < 0)
> -- 1.7.1
> 


Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-31 Thread Fu, Zhonghui


On 5/25/2016 1:31 AM, Dmitry Torokhov wrote:
> On Tue, May 24, 2016 at 3:24 AM, Jiri Kosina  wrote:
>
>> On Thu, 19 May 2016, Fu, Zhonghui wrote:
>>
>>> 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?
>>
> 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.
>
> BTW, I am not quite sure what async suspend enabled
> in hid_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
>
> Thanks,
> Dmitry
>



Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-31 Thread Fu, Zhonghui


On 5/25/2016 1:31 AM, Dmitry Torokhov wrote:
> On Tue, May 24, 2016 at 3:24 AM, Jiri Kosina  wrote:
>
>> On Thu, 19 May 2016, Fu, Zhonghui wrote:
>>
>>> 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?
>>
> 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.
>
> BTW, I am not quite sure what async suspend enabled
> in hid_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
>
> Thanks,
> Dmitry
>



Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-24 Thread Jiri Kosina
On Thu, 19 May 2016, Fu, Zhonghui wrote:

> 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?

-- 
Jiri Kosina
SUSE Labs



Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-24 Thread Jiri Kosina
On Thu, 19 May 2016, Fu, Zhonghui wrote:

> 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?

-- 
Jiri Kosina
SUSE Labs



Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-23 Thread Mika Westerberg
On Thu, May 19, 2016 at 10:46:24AM +0800, Fu, Zhonghui wrote:
> 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 

Looks reasonable to me,

Reviewed-by: Mika Westerberg 


Re: [PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-23 Thread Mika Westerberg
On Thu, May 19, 2016 at 10:46:24AM +0800, Fu, Zhonghui wrote:
> 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 

Looks reasonable to me,

Reviewed-by: Mika Westerberg 


[PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-18 Thread Fu, 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 
---
 drivers/hid/i2c-hid/i2c-hid.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 2e021ba..cc41e1e 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,
pm_runtime_get_noresume(>dev);
pm_runtime_set_active(>dev);
pm_runtime_enable(>dev);
+   device_enable_async_suspend(>dev);
 
ret = i2c_hid_fetch_hid_descriptor(ihid);
if (ret < 0)
-- 1.7.1



[PATCH] i2c_hid: enable i2c-hid devices to suspend/resume asynchronously

2016-05-18 Thread Fu, 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 
---
 drivers/hid/i2c-hid/i2c-hid.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 2e021ba..cc41e1e 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1020,6 +1020,7 @@ static int i2c_hid_probe(struct i2c_client *client,
pm_runtime_get_noresume(>dev);
pm_runtime_set_active(>dev);
pm_runtime_enable(>dev);
+   device_enable_async_suspend(>dev);
 
ret = i2c_hid_fetch_hid_descriptor(ihid);
if (ret < 0)
-- 1.7.1