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 <ji...@kernel.org> 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
>



[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 <zhonghui...@linux.intel.com>
---
 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



Re: [PATCH] mmc/sdio: utilize runtime PM to speed up SDIO card's resume process

2016-04-17 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui

On 4/13/2016 2:42 PM, Fu, Zhonghui wrote:
> Leave some work of SDIO card's resume process into it's runtime resume
> process to shorten system resume latency.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
>  drivers/mmc/core/sdio.c  |   21 ++---
>  include/linux/mmc/host.h |9 ++---
>  2 files changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index bd44ba8..fe5d3c5 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -902,6 +902,10 @@ static int mmc_sdio_suspend(struct mmc_host *host)
>  
>   if (!mmc_card_keep_power(host)) {
>   mmc_power_off(host);
> + if (host->caps & MMC_CAP_POWER_OFF_CARD) {
> + pm_runtime_disable(>card->dev);
> + pm_runtime_set_suspended(>card->dev);
> + }
>   } else if (host->retune_period) {
>   mmc_retune_timer_stop(host);
>   mmc_retune_needed(host);
> @@ -924,18 +928,16 @@ static int mmc_sdio_resume(struct mmc_host *host)
>  
>   /* Restore power if needed */
>   if (!mmc_card_keep_power(host)) {
> - mmc_power_up(host, host->card->ocr);
>   /*
> -  * Tell runtime PM core we just powered up the card,
> -  * since it still believes the card is powered off.
>* Note that currently runtime PM is only enabled
>* for SDIO cards that are MMC_CAP_POWER_OFF_CARD
>*/
>   if (host->caps & MMC_CAP_POWER_OFF_CARD) {
> - pm_runtime_disable(>card->dev);
> - pm_runtime_set_active(>card->dev);
>   pm_runtime_enable(>card->dev);
> + goto out;
>   }
> +
> + mmc_power_up(host, host->card->ocr);
>   }
>  
>   /* No need to reinitialize powered-resumed nonremovable cards */
> @@ -953,13 +955,10 @@ static int mmc_sdio_resume(struct mmc_host *host)
>   err = sdio_enable_4bit_bus(host->card);
>   }
>  
> - if (!err && host->sdio_irqs) {
> - if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD))
> - wake_up_process(host->sdio_irq_thread);
> - else if (host->caps & MMC_CAP_SDIO_IRQ)
> - host->ops->enable_sdio_irq(host, 1);
> - }
> + if (!err && host->sdio_irqs)
> + mmc_signal_sdio_irq(host);
>  
> +out:
>   mmc_release_host(host);
>  
>   host->pm_flags &= ~MMC_PM_KEEP_POWER;
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 8dd4d29..8faaa5b 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -400,10 +400,13 @@ void mmc_request_done(struct mmc_host *, struct 
> mmc_request *);
>  
>  static inline void mmc_signal_sdio_irq(struct mmc_host *host)
>  {
> - host->ops->enable_sdio_irq(host, 0);
> - host->sdio_irq_pending = true;
> - if (host->sdio_irq_thread)
> + if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) {
> + host->ops->enable_sdio_irq(host, 0);
> + host->sdio_irq_pending = true;
>   wake_up_process(host->sdio_irq_thread);
> + } else if (host->caps & MMC_CAP_SDIO_IRQ) {
> + host->ops->enable_sdio_irq(host, 1);
> + }
>  }
>  
>  void sdio_run_irqs(struct mmc_host *host);
> -- 1.7.1
>



Re: [PATCH] mmc/sdio: utilize runtime PM to speed up SDIO card's resume process

2016-04-17 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui

On 4/13/2016 2:42 PM, Fu, Zhonghui wrote:
> Leave some work of SDIO card's resume process into it's runtime resume
> process to shorten system resume latency.
>
> Signed-off-by: Zhonghui Fu 
> ---
>  drivers/mmc/core/sdio.c  |   21 ++---
>  include/linux/mmc/host.h |9 ++---
>  2 files changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index bd44ba8..fe5d3c5 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -902,6 +902,10 @@ static int mmc_sdio_suspend(struct mmc_host *host)
>  
>   if (!mmc_card_keep_power(host)) {
>   mmc_power_off(host);
> + if (host->caps & MMC_CAP_POWER_OFF_CARD) {
> + pm_runtime_disable(>card->dev);
> + pm_runtime_set_suspended(>card->dev);
> + }
>   } else if (host->retune_period) {
>   mmc_retune_timer_stop(host);
>   mmc_retune_needed(host);
> @@ -924,18 +928,16 @@ static int mmc_sdio_resume(struct mmc_host *host)
>  
>   /* Restore power if needed */
>   if (!mmc_card_keep_power(host)) {
> - mmc_power_up(host, host->card->ocr);
>   /*
> -  * Tell runtime PM core we just powered up the card,
> -  * since it still believes the card is powered off.
>* Note that currently runtime PM is only enabled
>* for SDIO cards that are MMC_CAP_POWER_OFF_CARD
>*/
>   if (host->caps & MMC_CAP_POWER_OFF_CARD) {
> - pm_runtime_disable(>card->dev);
> - pm_runtime_set_active(>card->dev);
>   pm_runtime_enable(>card->dev);
> + goto out;
>   }
> +
> + mmc_power_up(host, host->card->ocr);
>   }
>  
>   /* No need to reinitialize powered-resumed nonremovable cards */
> @@ -953,13 +955,10 @@ static int mmc_sdio_resume(struct mmc_host *host)
>   err = sdio_enable_4bit_bus(host->card);
>   }
>  
> - if (!err && host->sdio_irqs) {
> - if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD))
> - wake_up_process(host->sdio_irq_thread);
> - else if (host->caps & MMC_CAP_SDIO_IRQ)
> - host->ops->enable_sdio_irq(host, 1);
> - }
> + if (!err && host->sdio_irqs)
> + mmc_signal_sdio_irq(host);
>  
> +out:
>   mmc_release_host(host);
>  
>   host->pm_flags &= ~MMC_PM_KEEP_POWER;
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 8dd4d29..8faaa5b 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -400,10 +400,13 @@ void mmc_request_done(struct mmc_host *, struct 
> mmc_request *);
>  
>  static inline void mmc_signal_sdio_irq(struct mmc_host *host)
>  {
> - host->ops->enable_sdio_irq(host, 0);
> - host->sdio_irq_pending = true;
> - if (host->sdio_irq_thread)
> + if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) {
> + host->ops->enable_sdio_irq(host, 0);
> + host->sdio_irq_pending = true;
>   wake_up_process(host->sdio_irq_thread);
> + } else if (host->caps & MMC_CAP_SDIO_IRQ) {
> + host->ops->enable_sdio_irq(host, 1);
> + }
>  }
>  
>  void sdio_run_irqs(struct mmc_host *host);
> -- 1.7.1
>



[PATCH] mmc/sdio: utilize runtime PM to speed up SDIO card's resume process

2016-04-13 Thread Fu, Zhonghui
Leave some work of SDIO card's resume process into it's runtime resume
process to shorten system resume latency.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
 drivers/mmc/core/sdio.c  |   21 ++---
 include/linux/mmc/host.h |9 ++---
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index bd44ba8..fe5d3c5 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -902,6 +902,10 @@ static int mmc_sdio_suspend(struct mmc_host *host)
 
if (!mmc_card_keep_power(host)) {
mmc_power_off(host);
+   if (host->caps & MMC_CAP_POWER_OFF_CARD) {
+   pm_runtime_disable(>card->dev);
+   pm_runtime_set_suspended(>card->dev);
+   }
} else if (host->retune_period) {
mmc_retune_timer_stop(host);
mmc_retune_needed(host);
@@ -924,18 +928,16 @@ static int mmc_sdio_resume(struct mmc_host *host)
 
/* Restore power if needed */
if (!mmc_card_keep_power(host)) {
-   mmc_power_up(host, host->card->ocr);
/*
-* Tell runtime PM core we just powered up the card,
-* since it still believes the card is powered off.
 * Note that currently runtime PM is only enabled
 * for SDIO cards that are MMC_CAP_POWER_OFF_CARD
 */
if (host->caps & MMC_CAP_POWER_OFF_CARD) {
-   pm_runtime_disable(>card->dev);
-   pm_runtime_set_active(>card->dev);
pm_runtime_enable(>card->dev);
+   goto out;
}
+
+   mmc_power_up(host, host->card->ocr);
}
 
/* No need to reinitialize powered-resumed nonremovable cards */
@@ -953,13 +955,10 @@ static int mmc_sdio_resume(struct mmc_host *host)
err = sdio_enable_4bit_bus(host->card);
}
 
-   if (!err && host->sdio_irqs) {
-   if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD))
-   wake_up_process(host->sdio_irq_thread);
-   else if (host->caps & MMC_CAP_SDIO_IRQ)
-   host->ops->enable_sdio_irq(host, 1);
-   }
+   if (!err && host->sdio_irqs)
+   mmc_signal_sdio_irq(host);
 
+out:
mmc_release_host(host);
 
host->pm_flags &= ~MMC_PM_KEEP_POWER;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8dd4d29..8faaa5b 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -400,10 +400,13 @@ void mmc_request_done(struct mmc_host *, struct 
mmc_request *);
 
 static inline void mmc_signal_sdio_irq(struct mmc_host *host)
 {
-   host->ops->enable_sdio_irq(host, 0);
-   host->sdio_irq_pending = true;
-   if (host->sdio_irq_thread)
+   if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) {
+   host->ops->enable_sdio_irq(host, 0);
+   host->sdio_irq_pending = true;
wake_up_process(host->sdio_irq_thread);
+   } else if (host->caps & MMC_CAP_SDIO_IRQ) {
+   host->ops->enable_sdio_irq(host, 1);
+   }
 }
 
 void sdio_run_irqs(struct mmc_host *host);
-- 1.7.1



[PATCH] mmc/sdio: utilize runtime PM to speed up SDIO card's resume process

2016-04-13 Thread Fu, Zhonghui
Leave some work of SDIO card's resume process into it's runtime resume
process to shorten system resume latency.

Signed-off-by: Zhonghui Fu 
---
 drivers/mmc/core/sdio.c  |   21 ++---
 include/linux/mmc/host.h |9 ++---
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index bd44ba8..fe5d3c5 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -902,6 +902,10 @@ static int mmc_sdio_suspend(struct mmc_host *host)
 
if (!mmc_card_keep_power(host)) {
mmc_power_off(host);
+   if (host->caps & MMC_CAP_POWER_OFF_CARD) {
+   pm_runtime_disable(>card->dev);
+   pm_runtime_set_suspended(>card->dev);
+   }
} else if (host->retune_period) {
mmc_retune_timer_stop(host);
mmc_retune_needed(host);
@@ -924,18 +928,16 @@ static int mmc_sdio_resume(struct mmc_host *host)
 
/* Restore power if needed */
if (!mmc_card_keep_power(host)) {
-   mmc_power_up(host, host->card->ocr);
/*
-* Tell runtime PM core we just powered up the card,
-* since it still believes the card is powered off.
 * Note that currently runtime PM is only enabled
 * for SDIO cards that are MMC_CAP_POWER_OFF_CARD
 */
if (host->caps & MMC_CAP_POWER_OFF_CARD) {
-   pm_runtime_disable(>card->dev);
-   pm_runtime_set_active(>card->dev);
pm_runtime_enable(>card->dev);
+   goto out;
}
+
+   mmc_power_up(host, host->card->ocr);
}
 
/* No need to reinitialize powered-resumed nonremovable cards */
@@ -953,13 +955,10 @@ static int mmc_sdio_resume(struct mmc_host *host)
err = sdio_enable_4bit_bus(host->card);
}
 
-   if (!err && host->sdio_irqs) {
-   if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD))
-   wake_up_process(host->sdio_irq_thread);
-   else if (host->caps & MMC_CAP_SDIO_IRQ)
-   host->ops->enable_sdio_irq(host, 1);
-   }
+   if (!err && host->sdio_irqs)
+   mmc_signal_sdio_irq(host);
 
+out:
mmc_release_host(host);
 
host->pm_flags &= ~MMC_PM_KEEP_POWER;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8dd4d29..8faaa5b 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -400,10 +400,13 @@ void mmc_request_done(struct mmc_host *, struct 
mmc_request *);
 
 static inline void mmc_signal_sdio_irq(struct mmc_host *host)
 {
-   host->ops->enable_sdio_irq(host, 0);
-   host->sdio_irq_pending = true;
-   if (host->sdio_irq_thread)
+   if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD)) {
+   host->ops->enable_sdio_irq(host, 0);
+   host->sdio_irq_pending = true;
wake_up_process(host->sdio_irq_thread);
+   } else if (host->caps & MMC_CAP_SDIO_IRQ) {
+   host->ops->enable_sdio_irq(host, 1);
+   }
 }
 
 void sdio_run_irqs(struct mmc_host *host);
-- 1.7.1



Re: [PATCH v2] i2c/designware: enable i2c controller to suspend/resume asynchronously

2016-03-08 Thread Fu, Zhonghui


On 2/1/2016 11:54 PM, Wolfram Sang wrote:
 device may be completed in separate kernel thread. PM core ensures
 all power state transition dependency between devices. This patch
> I'd like an Ack on that from a PM maintainer, because I think chips like
> PMICs are special and might not be covered by the generic case...
>
>> Besides that we have to be really aware about DMA power related fix
>> introduced in v4.5-rc1 in acpi_lpss.c [1]. So, I would like to see a
>> wide testing especially on Intel Baytrail / Braswell platforms before
>> enabling it.
> And this one, too.
Because of long leave, so sorry for very late reply.

I agree with you. Need more investigation and test for this patch before 
enabling it.


Thanks,
Zhonghui
>



Re: [PATCH v2] i2c/designware: enable i2c controller to suspend/resume asynchronously

2016-03-08 Thread Fu, Zhonghui


On 2/1/2016 11:54 PM, Wolfram Sang wrote:
 device may be completed in separate kernel thread. PM core ensures
 all power state transition dependency between devices. This patch
> I'd like an Ack on that from a PM maintainer, because I think chips like
> PMICs are special and might not be covered by the generic case...
>
>> Besides that we have to be really aware about DMA power related fix
>> introduced in v4.5-rc1 in acpi_lpss.c [1]. So, I would like to see a
>> wide testing especially on Intel Baytrail / Braswell platforms before
>> enabling it.
> And this one, too.
Because of long leave, so sorry for very late reply.

I agree with you. Need more investigation and test for this patch before 
enabling it.


Thanks,
Zhonghui
>



Re: [PATCH 1/2 v2] mmc: enable mmc host device to suspend/resume asynchronously

2016-01-25 Thread Fu, Zhonghui


On 1/22/2016 10:51 PM, Ulf Hansson wrote:
> On 22 January 2016 at 04:32, Fu, Zhonghui  wrote:
>> This patch enables mmc hosts to suspend/resume asynchronously.
>> This will improve system suspend/resume speed. After applying
>> this patch and enabling all mmc hosts' child devices to
>> suspend/resume asynchronously on ASUS T100TA, the system
>> suspend-to-idle time is reduced from 1645ms to 1107ms, and the
>> system resume time is reduced from 940ms to 914ms.
> Do you really reduce time at all with this patch by its own? I think not.
>
> Moreover, I thought the biggest improvement came from the patch which
> enabled async suspend/resume for the MMC/SD/SDIO device?
> ec076cd226c3 ("mmc: enable MMC/SD/SDIO device to suspend/resume 
> asynchronously")
>
> Similar comment applies to patch2/2, but I would expect it together
> with the $subject patch gives an improvement.
>
> Please update the change-logs one more round.

The reduce time is not contributed by only this patch, please see the 
change-log: "After applying this patch and enabling all mmc hosts' child 
devices to suspend/resume asynchronously on ASUS T100TA ...". Actually, the 
biggest improvement came from the patch - "net/wireless: enable wiphy device to 
suspend/resume asynchronously(commit 
9f0e13546ef5773b7059b531a667ec47a5f897ee)". Wiphy device(phy0) is child device 
of WiFi card(SDIO card).

Do you mean that I should list the reduce time contributed by only this patch 
and patch2/2 in change-log?


Thanks,
Zhonghui
>
> Kind regards
> Uffe
>
>> Signed-off-by: Zhonghui Fu 
>> Acked-by: Venu Byravarasu 
>> ---
>> Changes in v2:
>> - Update commit message
>>
>>  drivers/mmc/core/host.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index 0aecd5c..1d94607 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
>> *dev)
>> host->class_dev.parent = dev;
>> host->class_dev.class = _host_class;
>> device_initialize(>class_dev);
>> +   device_enable_async_suspend(>class_dev);
>>
>> if (mmc_gpio_alloc(host)) {
>> put_device(>class_dev);
>> -- 1.7.1
>>



Re: [PATCH 1/2 v2] mmc: enable mmc host device to suspend/resume asynchronously

2016-01-25 Thread Fu, Zhonghui


On 1/22/2016 10:51 PM, Ulf Hansson wrote:
> On 22 January 2016 at 04:32, Fu, Zhonghui <zhonghui...@linux.intel.com> wrote:
>> This patch enables mmc hosts to suspend/resume asynchronously.
>> This will improve system suspend/resume speed. After applying
>> this patch and enabling all mmc hosts' child devices to
>> suspend/resume asynchronously on ASUS T100TA, the system
>> suspend-to-idle time is reduced from 1645ms to 1107ms, and the
>> system resume time is reduced from 940ms to 914ms.
> Do you really reduce time at all with this patch by its own? I think not.
>
> Moreover, I thought the biggest improvement came from the patch which
> enabled async suspend/resume for the MMC/SD/SDIO device?
> ec076cd226c3 ("mmc: enable MMC/SD/SDIO device to suspend/resume 
> asynchronously")
>
> Similar comment applies to patch2/2, but I would expect it together
> with the $subject patch gives an improvement.
>
> Please update the change-logs one more round.

The reduce time is not contributed by only this patch, please see the 
change-log: "After applying this patch and enabling all mmc hosts' child 
devices to suspend/resume asynchronously on ASUS T100TA ...". Actually, the 
biggest improvement came from the patch - "net/wireless: enable wiphy device to 
suspend/resume asynchronously(commit 
9f0e13546ef5773b7059b531a667ec47a5f897ee)". Wiphy device(phy0) is child device 
of WiFi card(SDIO card).

Do you mean that I should list the reduce time contributed by only this patch 
and patch2/2 in change-log?


Thanks,
Zhonghui
>
> Kind regards
> Uffe
>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> Acked-by: Venu Byravarasu <vbyravar...@nvidia.com>
>> ---
>> Changes in v2:
>> - Update commit message
>>
>>  drivers/mmc/core/host.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index 0aecd5c..1d94607 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
>> *dev)
>> host->class_dev.parent = dev;
>> host->class_dev.class = _host_class;
>> device_initialize(>class_dev);
>> +   device_enable_async_suspend(>class_dev);
>>
>> if (mmc_gpio_alloc(host)) {
>> put_device(>class_dev);
>> -- 1.7.1
>>



Re: [PATCH 2/2] i2c: enable i2c adapter to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui

Hi Wolfram,

What do you think about this patch?


Thanks,
Zhonghui



On 12/24/2015 10:44 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition dependency between devices. This patch
> enables i2c adapters to suspend/resume asynchronously. This will take
> advantage of multicore and improve system suspend/resume speed. After
> enabling all i2c devices, i2c adapters and i2c controllers on ASUS
> T100TA tablet, the system suspend-to-idle time is reduced to about
> 510ms from 750ms, and the system resume time is reduced to about 790ms
> from 900ms.
>
> Signed-off-by: Zhonghui Fu 
> ---
>  drivers/i2c/i2c-core.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index ba8eb08..72d5466 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1564,6 +1564,8 @@ static int i2c_register_adapter(struct i2c_adapter 
> *adap)
>  
>   pm_runtime_no_callbacks(>dev);
>  
> + device_enable_async_suspend(>dev);
> +
>  #ifdef CONFIG_I2C_COMPAT
>   res = class_compat_create_link(i2c_adapter_compat_class, >dev,
>  adap->dev.parent);
> -- 1.7.1
>



Re: [PATCH 1/2] i2c: enable i2c device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui

Hi Wolfram,

What do you think about this patch?


Thanks,
Zhonghui



On 12/24/2015 10:41 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition dependency between devices. This patch
> enables i2c devices to suspend/resume asynchronously. This will take
> advantage of multicore and improve system suspend/resume speed. After
> enabling all i2c devices, i2c adapters and i2c controllers on ASUS
> T100TA tablet, the system suspend-to-idle time is reduced to about
> 510ms from 750ms, and the system resume time is reduced to about 790ms
> from 900ms.
>
> Signed-off-by: Zhonghui Fu 
> ---
>  drivers/i2c/i2c-core.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index ba8eb08..4ff620e 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1072,6 +1072,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
> i2c_board_info const *info)
>   client->dev.of_node = info->of_node;
>   client->dev.fwnode = info->fwnode;
>  
> + device_enable_async_suspend(>dev);
>   i2c_dev_set_name(adap, client);
>   status = device_register(>dev);
>   if (status)
> -- 1.7.1
>



Re: [PATCH 2/2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui


On 1/12/2016 10:43 PM, Ulf Hansson wrote:
> On 28 December 2015 at 16:41, Fu, Zhonghui  
> wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition dependency between devices. This patch
>> enables sdhci-acpi devices to suspend/resume asynchronously. This
>> will take advantage of multicore and improve system suspend/resume
>> speed. After enabling the sdhci-acpi devices and all their child
>> devices to suspend/resume asynchronously on ASUS T100TA, the system
>> suspend-to-idle time is reduced from 1645ms to 1089ms, and the
>> system resume time is reduced from 940ms to 908ms.
> Same comment as for patch 1.

I have updated the change log according to your comments and resent this patch 
- "[PATCH 2/2 v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume 
asynchronously".


Thanks,
Zhonghui


>
>> Signed-off-by: Zhonghui Fu 
>> ---
>>  drivers/mmc/host/sdhci-acpi.c |2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
>> index f6047fc..3d27f2d 100644
>> --- a/drivers/mmc/host/sdhci-acpi.c
>> +++ b/drivers/mmc/host/sdhci-acpi.c
>> @@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
>> pm_runtime_enable(dev);
>> }
>>
>> +   device_enable_async_suspend(dev);
>> +
>> return 0;
>>
>>  err_free:
>> -- 1.7.1
>>
> Otherwise, looks good!
>
> Kind regards
> Uffe



[PATCH 2/2 v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui
This patch enables sdhci-acpi devices to suspend/resume asynchronously.
This will improve system suspend/resume speed. After enabling the
sdhci-acpi devices and all their child devices to suspend/resume
asynchronously on ASUS T100TA, the system suspend-to-idle time is
reduced from 1645ms to 1089ms, and the system resume time is reduced
from 940ms to 908ms.

Signed-off-by: Zhonghui Fu 
---
Changes in v2:
- Update commit message

 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index f6047fc..3d27f2d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1



Re: [PATCH 1/2] mmc: enable mmc host device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui


On 1/12/2016 10:42 PM, Ulf Hansson wrote:
> On 28 December 2015 at 16:39, Fu, Zhonghui  
> wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition dependency between devices. This patch
>> enables mmc hosts to suspend/resume asynchronously. This will take
>> advantage of multicore and improve system suspend/resume speed.
>> After applying this patch and enabling all mmc hosts' child devices
>> to suspend/resume asynchronously on ASUS T100TA, the system
>> suspend-to-idle time is reduced from 1645ms to 1107ms, and the
>> system resume time is reduced from 940ms to 914ms.
> Please update the  change log as I don't think the above is really correct.
>
> I think you can simplify the change log quite a bit and just mention
> what and why we want this change.

I have updated the change log according to your comments and resent this patch 
- "[PATCH 1/2 v2] mmc: enable mmc host device to suspend/resume asynchronously".


Thanks,
Zhonghui
>
>> Signed-off-by: Zhonghui Fu 
>> ---
>>  drivers/mmc/core/host.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index da950c4..7222fd7 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
>> *dev)
>> host->class_dev.parent = dev;
>> host->class_dev.class = _host_class;
>> device_initialize(>class_dev);
>> +   device_enable_async_suspend(>class_dev);
>>
>> if (mmc_gpio_alloc(host)) {
>> put_device(>class_dev);
>> -- 1.7.1
>>
> Otherwise I think this looks good!
>
> Kind regards
> Uffe



[PATCH 1/2 v2] mmc: enable mmc host device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui
This patch enables mmc hosts to suspend/resume asynchronously.
This will improve system suspend/resume speed. After applying
this patch and enabling all mmc hosts' child devices to
suspend/resume asynchronously on ASUS T100TA, the system
suspend-to-idle time is reduced from 1645ms to 1107ms, and the
system resume time is reduced from 940ms to 914ms.

Signed-off-by: Zhonghui Fu 
Acked-by: Venu Byravarasu 
---
Changes in v2:
- Update commit message

 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 0aecd5c..1d94607 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1



Re: [PATCH 1/2] mmc: enable mmc host device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui


On 1/12/2016 10:42 PM, Ulf Hansson wrote:
> On 28 December 2015 at 16:39, Fu, Zhonghui <zhonghui...@linux.intel.com> 
> wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition dependency between devices. This patch
>> enables mmc hosts to suspend/resume asynchronously. This will take
>> advantage of multicore and improve system suspend/resume speed.
>> After applying this patch and enabling all mmc hosts' child devices
>> to suspend/resume asynchronously on ASUS T100TA, the system
>> suspend-to-idle time is reduced from 1645ms to 1107ms, and the
>> system resume time is reduced from 940ms to 914ms.
> Please update the  change log as I don't think the above is really correct.
>
> I think you can simplify the change log quite a bit and just mention
> what and why we want this change.

I have updated the change log according to your comments and resent this patch 
- "[PATCH 1/2 v2] mmc: enable mmc host device to suspend/resume asynchronously".


Thanks,
Zhonghui
>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> ---
>>  drivers/mmc/core/host.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index da950c4..7222fd7 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
>> *dev)
>> host->class_dev.parent = dev;
>> host->class_dev.class = _host_class;
>> device_initialize(>class_dev);
>> +   device_enable_async_suspend(>class_dev);
>>
>> if (mmc_gpio_alloc(host)) {
>> put_device(>class_dev);
>> -- 1.7.1
>>
> Otherwise I think this looks good!
>
> Kind regards
> Uffe



[PATCH 2/2 v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui
This patch enables sdhci-acpi devices to suspend/resume asynchronously.
This will improve system suspend/resume speed. After enabling the
sdhci-acpi devices and all their child devices to suspend/resume
asynchronously on ASUS T100TA, the system suspend-to-idle time is
reduced from 1645ms to 1089ms, and the system resume time is reduced
from 940ms to 908ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v2:
- Update commit message

 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index f6047fc..3d27f2d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1



[PATCH 1/2 v2] mmc: enable mmc host device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui
This patch enables mmc hosts to suspend/resume asynchronously.
This will improve system suspend/resume speed. After applying
this patch and enabling all mmc hosts' child devices to
suspend/resume asynchronously on ASUS T100TA, the system
suspend-to-idle time is reduced from 1645ms to 1107ms, and the
system resume time is reduced from 940ms to 914ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
Acked-by: Venu Byravarasu <vbyravar...@nvidia.com>
---
Changes in v2:
- Update commit message

 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 0aecd5c..1d94607 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1



Re: [PATCH 2/2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui


On 1/12/2016 10:43 PM, Ulf Hansson wrote:
> On 28 December 2015 at 16:41, Fu, Zhonghui <zhonghui...@linux.intel.com> 
> wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition dependency between devices. This patch
>> enables sdhci-acpi devices to suspend/resume asynchronously. This
>> will take advantage of multicore and improve system suspend/resume
>> speed. After enabling the sdhci-acpi devices and all their child
>> devices to suspend/resume asynchronously on ASUS T100TA, the system
>> suspend-to-idle time is reduced from 1645ms to 1089ms, and the
>> system resume time is reduced from 940ms to 908ms.
> Same comment as for patch 1.

I have updated the change log according to your comments and resent this patch 
- "[PATCH 2/2 v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume 
asynchronously".


Thanks,
Zhonghui


>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> ---
>>  drivers/mmc/host/sdhci-acpi.c |2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
>> index f6047fc..3d27f2d 100644
>> --- a/drivers/mmc/host/sdhci-acpi.c
>> +++ b/drivers/mmc/host/sdhci-acpi.c
>> @@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
>> pm_runtime_enable(dev);
>> }
>>
>> +   device_enable_async_suspend(dev);
>> +
>> return 0;
>>
>>  err_free:
>> -- 1.7.1
>>
> Otherwise, looks good!
>
> Kind regards
> Uffe



Re: [PATCH 1/2] i2c: enable i2c device to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui

Hi Wolfram,

What do you think about this patch?


Thanks,
Zhonghui



On 12/24/2015 10:41 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition dependency between devices. This patch
> enables i2c devices to suspend/resume asynchronously. This will take
> advantage of multicore and improve system suspend/resume speed. After
> enabling all i2c devices, i2c adapters and i2c controllers on ASUS
> T100TA tablet, the system suspend-to-idle time is reduced to about
> 510ms from 750ms, and the system resume time is reduced to about 790ms
> from 900ms.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
>  drivers/i2c/i2c-core.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index ba8eb08..4ff620e 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1072,6 +1072,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
> i2c_board_info const *info)
>   client->dev.of_node = info->of_node;
>   client->dev.fwnode = info->fwnode;
>  
> + device_enable_async_suspend(>dev);
>   i2c_dev_set_name(adap, client);
>   status = device_register(>dev);
>   if (status)
> -- 1.7.1
>



Re: [PATCH 2/2] i2c: enable i2c adapter to suspend/resume asynchronously

2016-01-21 Thread Fu, Zhonghui

Hi Wolfram,

What do you think about this patch?


Thanks,
Zhonghui



On 12/24/2015 10:44 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition dependency between devices. This patch
> enables i2c adapters to suspend/resume asynchronously. This will take
> advantage of multicore and improve system suspend/resume speed. After
> enabling all i2c devices, i2c adapters and i2c controllers on ASUS
> T100TA tablet, the system suspend-to-idle time is reduced to about
> 510ms from 750ms, and the system resume time is reduced to about 790ms
> from 900ms.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
>  drivers/i2c/i2c-core.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index ba8eb08..72d5466 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1564,6 +1564,8 @@ static int i2c_register_adapter(struct i2c_adapter 
> *adap)
>  
>   pm_runtime_no_callbacks(>dev);
>  
> + device_enable_async_suspend(>dev);
> +
>  #ifdef CONFIG_I2C_COMPAT
>   res = class_compat_create_link(i2c_adapter_compat_class, >dev,
>  adap->dev.parent);
> -- 1.7.1
>



[PATCH 2/2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-12-28 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables sdhci-acpi devices to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed. After enabling the sdhci-acpi devices and all their child
devices to suspend/resume asynchronously on ASUS T100TA, the system
suspend-to-idle time is reduced from 1645ms to 1089ms, and the
system resume time is reduced from 940ms to 908ms.

Signed-off-by: Zhonghui Fu 
---
 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index f6047fc..3d27f2d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] mmc: enable mmc host device to suspend/resume asynchronously

2015-12-28 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables mmc hosts to suspend/resume asynchronously. This will take
advantage of multicore and improve system suspend/resume speed.
After applying this patch and enabling all mmc hosts' child devices
to suspend/resume asynchronously on ASUS T100TA, the system
suspend-to-idle time is reduced from 1645ms to 1107ms, and the
system resume time is reduced from 940ms to 914ms.

Signed-off-by: Zhonghui Fu 
---
 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index da950c4..7222fd7 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-12-28 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables sdhci-acpi devices to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed. After enabling the sdhci-acpi devices and all their child
devices to suspend/resume asynchronously on ASUS T100TA, the system
suspend-to-idle time is reduced from 1645ms to 1089ms, and the
system resume time is reduced from 940ms to 908ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index f6047fc..3d27f2d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] mmc: enable mmc host device to suspend/resume asynchronously

2015-12-28 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables mmc hosts to suspend/resume asynchronously. This will take
advantage of multicore and improve system suspend/resume speed.
After applying this patch and enabling all mmc hosts' child devices
to suspend/resume asynchronously on ASUS T100TA, the system
suspend-to-idle time is reduced from 1645ms to 1107ms, and the
system resume time is reduced from 940ms to 914ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index da950c4..7222fd7 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] i2c: enable i2c adapter to suspend/resume asynchronously

2015-12-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables i2c adapters to suspend/resume asynchronously. This will take
advantage of multicore and improve system suspend/resume speed. After
enabling all i2c devices, i2c adapters and i2c controllers on ASUS
T100TA tablet, the system suspend-to-idle time is reduced to about
510ms from 750ms, and the system resume time is reduced to about 790ms
from 900ms.

Signed-off-by: Zhonghui Fu 
---
 drivers/i2c/i2c-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index ba8eb08..72d5466 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1564,6 +1564,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
pm_runtime_no_callbacks(>dev);
 
+   device_enable_async_suspend(>dev);
+
 #ifdef CONFIG_I2C_COMPAT
res = class_compat_create_link(i2c_adapter_compat_class, >dev,
   adap->dev.parent);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] i2c: enable i2c device to suspend/resume asynchronously

2015-12-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables i2c devices to suspend/resume asynchronously. This will take
advantage of multicore and improve system suspend/resume speed. After
enabling all i2c devices, i2c adapters and i2c controllers on ASUS
T100TA tablet, the system suspend-to-idle time is reduced to about
510ms from 750ms, and the system resume time is reduced to about 790ms
from 900ms.

Signed-off-by: Zhonghui Fu 
---
 drivers/i2c/i2c-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index ba8eb08..4ff620e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1072,6 +1072,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
i2c_board_info const *info)
client->dev.of_node = info->of_node;
client->dev.fwnode = info->fwnode;
 
+   device_enable_async_suspend(>dev);
i2c_dev_set_name(adap, client);
status = device_register(>dev);
if (status)
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-12-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables designware i2c controllers to suspend/resume asynchronously.
This will take advantage of multicore and improve system suspend/resume
speed. After enabling all i2c devices, i2c adapters and i2c controllers
on ASUS T100TA tablet, the system suspend-to-idle time is reduced to
about 510ms from 750ms, and the system resume time is reduced to about
790ms from 900ms.

Signed-off-by: Zhonghui Fu 
---
 drivers/i2c/busses/i2c-designware-platdrv.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
b/drivers/i2c/busses/i2c-designware-platdrv.c
index 6b00061..395130b 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -230,6 +230,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
}
 
adap = >adapter;
+   device_enable_async_suspend(>dev);
adap->owner = THIS_MODULE;
adap->class = I2C_CLASS_DEPRECATED;
ACPI_COMPANION_SET(>dev, ACPI_COMPANION(>dev));
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-12-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables designware i2c controllers to suspend/resume asynchronously.
This will take advantage of multicore and improve system suspend/resume
speed. After enabling all i2c devices, i2c adapters and i2c controllers
on ASUS T100TA tablet, the system suspend-to-idle time is reduced to
about 510ms from 750ms, and the system resume time is reduced to about
790ms from 900ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
b/drivers/i2c/busses/i2c-designware-platdrv.c
index 6b00061..395130b 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -230,6 +230,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
}
 
adap = >adapter;
+   device_enable_async_suspend(>dev);
adap->owner = THIS_MODULE;
adap->class = I2C_CLASS_DEPRECATED;
ACPI_COMPANION_SET(>dev, ACPI_COMPANION(>dev));
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] i2c: enable i2c device to suspend/resume asynchronously

2015-12-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables i2c devices to suspend/resume asynchronously. This will take
advantage of multicore and improve system suspend/resume speed. After
enabling all i2c devices, i2c adapters and i2c controllers on ASUS
T100TA tablet, the system suspend-to-idle time is reduced to about
510ms from 750ms, and the system resume time is reduced to about 790ms
from 900ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
 drivers/i2c/i2c-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index ba8eb08..4ff620e 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1072,6 +1072,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
i2c_board_info const *info)
client->dev.of_node = info->of_node;
client->dev.fwnode = info->fwnode;
 
+   device_enable_async_suspend(>dev);
i2c_dev_set_name(adap, client);
status = device_register(>dev);
if (status)
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] i2c: enable i2c adapter to suspend/resume asynchronously

2015-12-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables i2c adapters to suspend/resume asynchronously. This will take
advantage of multicore and improve system suspend/resume speed. After
enabling all i2c devices, i2c adapters and i2c controllers on ASUS
T100TA tablet, the system suspend-to-idle time is reduced to about
510ms from 750ms, and the system resume time is reduced to about 790ms
from 900ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
 drivers/i2c/i2c-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index ba8eb08..72d5466 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1564,6 +1564,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
pm_runtime_no_callbacks(>dev);
 
+   device_enable_async_suspend(>dev);
+
 #ifdef CONFIG_I2C_COMPAT
res = class_compat_create_link(i2c_adapter_compat_class, >dev,
   adap->dev.parent);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mmc: enable MMC/SD/SDIO device to suspend/resume asynchronously

2015-12-04 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables MMC/SD/SDIO card and SDIO function devices to suspend/resume
asynchronously. This will take advantage of multicore and improve
system suspend/resume speed. After applying this patch and enabling
all SDIO function's child devices to suspend/resume asynchronously
on ASUS T100TA, the system suspend-to-idle time is reduced from
1645ms to 1108ms, and the system resume time is reduced from 940ms
to 918ms.

Signed-off-by: Zhonghui Fu 
---
 drivers/mmc/core/bus.c  |2 ++
 drivers/mmc/core/sdio_bus.c |1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 972ff84..4bc48f1 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -349,6 +349,8 @@ int mmc_add_card(struct mmc_card *card)
 
card->dev.of_node = mmc_of_find_child_device(card->host, 0);
 
+   device_enable_async_suspend(>dev);
+
ret = device_add(>dev);
if (ret)
return ret;
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 7e327a6..86f5b32 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -322,6 +322,7 @@ int sdio_add_func(struct sdio_func *func)
 
sdio_set_of_node(func);
sdio_acpi_set_handle(func);
+   device_enable_async_suspend(>dev);
ret = device_add(>dev);
if (ret == 0)
sdio_func_set_present(func);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mmc: enable MMC/SD/SDIO device to suspend/resume asynchronously

2015-12-04 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition dependency between devices. This patch
enables MMC/SD/SDIO card and SDIO function devices to suspend/resume
asynchronously. This will take advantage of multicore and improve
system suspend/resume speed. After applying this patch and enabling
all SDIO function's child devices to suspend/resume asynchronously
on ASUS T100TA, the system suspend-to-idle time is reduced from
1645ms to 1108ms, and the system resume time is reduced from 940ms
to 918ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
 drivers/mmc/core/bus.c  |2 ++
 drivers/mmc/core/sdio_bus.c |1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 972ff84..4bc48f1 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -349,6 +349,8 @@ int mmc_add_card(struct mmc_card *card)
 
card->dev.of_node = mmc_of_find_child_device(card->host, 0);
 
+   device_enable_async_suspend(>dev);
+
ret = device_add(>dev);
if (ret)
return ret;
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 7e327a6..86f5b32 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -322,6 +322,7 @@ int sdio_add_func(struct sdio_func *func)
 
sdio_set_of_node(func);
sdio_acpi_set_handle(func);
+   device_enable_async_suspend(>dev);
ret = device_add(>dev);
if (ret == 0)
sdio_func_set_present(func);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-26 Thread Fu, Zhonghui


On 11/23/2015 11:26 PM, Ulf Hansson wrote:
> On 17 November 2015 at 14:48, Fu, Zhonghui  
> wrote:
>>
>> On 11/16/2015 7:30 PM, Ulf Hansson wrote:
>>> On 15 November 2015 at 14:53, Fu, Zhonghui  
>>> wrote:
>>>> Now, PM core supports asynchronous suspend/resume mode for devices
>>>> during system suspend/resume, and the power state transition of one
>>>> device may be completed in separate kernel thread. PM core ensures
>>>> all power state transition timing dependency between devices. This
> What "timing dependency"?
Sorry, "timing" should be needless word.
>
>>>> patch enables SDIO card and function devices to suspend/resume
>>>> asynchronously. This will take advantage of multicore and improve
>>>> system suspend/resume speed. After enabling the SDIO devices and all
>>>> their child devices to suspend/resume asynchronously on ASUS T100TA,
>>>> the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
>>>> the system resume time is reduced from 940ms to 918ms.
> Are these improvements achieved by $subject patch on its own or you
> need below patches:
>
> [PATCH v3] mmc: enable mmc host device to suspend/resume asynchronously [1]
>
> [PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume
> asynchronously [2]
This patch achieves these improvements by its own.
>
> Depending if you have SD/(e)MMC card slot(s), the below patch might
> affect your results. So it might be a good idea to re-run your test to
> get some fresh data.
>
> [PATCH 1/2] mmc: core: Make runtime resume default behavior for MMC/SD [3]
I didn't find this patch in mainline kernel, where is this patch?
>
>>>> Signed-off-by: Zhonghui Fu 
>>> I think this is an interesting change, but I wonder if you really
>>> understand how this affects the order of how devices may be
>>> suspended/resumed?
>>>
>>> Also, I believe you didn't answer my question for the earlier version
>>> of the patch, so let me try again.
>>>
>>> There are a strict dependency chain when suspending/resuming devices
>>> that must be maintained. Currently this is controlled via device
>>> registration/probe order.
>>>
>>> An SDIO func driver/device must always be suspended *before* the SDIO
>>> card device. Additionally the corresponding MMC host, must be
>>> suspended after the SDIO card device. Vice verse applies to the resume
>>> sequence.
>>>
>>> As this patch enables asynchronous suspend, I am worried that it will
>>> break this dependency chain. What do you think?
>> After enabling asynchronous suspend/resume, PM core still ensures the strict 
>> suspend/resume dependency between child and parent devices - child must be 
>> suspended before its parent, and parent must be resumed before its child. 
>> SDIO function is child of SDIO card, and SDIO card is child of MMC host, and 
>> MMC host is child of MMC controller. So the dependency chain is not broken. 
>> Actually,  many devices have been using asynchronous suspend/resume mode now.
>
> I believe your view of how the PM core works for devices that *don't*
> use async suspend is wrong! The PM core doesn't respect parent/child
> relations during the device system PM phase for these devices.
I agree with you for the following description. But, I never described how PM 
core works for devices that don't use async mode. Where did you get my view 
about this?  I just said that PM core still ensure the dependency between child 
and parent devices after using async mode, I never said that the method 
ensuring dependency is the same for sync devices and async devices.
>
> Instead it relies on that devices in the "dpm list" are ordered
> correctly. As I tried to describe earlier, that list is being updated
> during device registration and probing (there are some other special
> cases as well).
>
> So, by enabling async suspend for a device it will trigger the PM core
> durng device system PM, to start caring about device's parent/child
> relations. I would appreciate if you could add some of this
> information to the change log, as that's *why* it should work nicely
> for mmc/sd/sdio to use async suspend.

>
>> Thanks,
>> Zhonghui
>>> Kind regards
>>> Ulf Hansson
>>>
>>>> ---
>>>> Changes in v3:
>>>> - Add test result in commit message
>>>>
>>>>  drivers/mmc/core/sdio.c |4 
>>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/core/sdi

Re: [PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-26 Thread Fu, Zhonghui


On 11/23/2015 11:26 PM, Ulf Hansson wrote:
> On 17 November 2015 at 14:48, Fu, Zhonghui <zhonghui...@linux.intel.com> 
> wrote:
>>
>> On 11/16/2015 7:30 PM, Ulf Hansson wrote:
>>> On 15 November 2015 at 14:53, Fu, Zhonghui <zhonghui...@linux.intel.com> 
>>> wrote:
>>>> Now, PM core supports asynchronous suspend/resume mode for devices
>>>> during system suspend/resume, and the power state transition of one
>>>> device may be completed in separate kernel thread. PM core ensures
>>>> all power state transition timing dependency between devices. This
> What "timing dependency"?
Sorry, "timing" should be needless word.
>
>>>> patch enables SDIO card and function devices to suspend/resume
>>>> asynchronously. This will take advantage of multicore and improve
>>>> system suspend/resume speed. After enabling the SDIO devices and all
>>>> their child devices to suspend/resume asynchronously on ASUS T100TA,
>>>> the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
>>>> the system resume time is reduced from 940ms to 918ms.
> Are these improvements achieved by $subject patch on its own or you
> need below patches:
>
> [PATCH v3] mmc: enable mmc host device to suspend/resume asynchronously [1]
>
> [PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume
> asynchronously [2]
This patch achieves these improvements by its own.
>
> Depending if you have SD/(e)MMC card slot(s), the below patch might
> affect your results. So it might be a good idea to re-run your test to
> get some fresh data.
>
> [PATCH 1/2] mmc: core: Make runtime resume default behavior for MMC/SD [3]
I didn't find this patch in mainline kernel, where is this patch?
>
>>>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>>> I think this is an interesting change, but I wonder if you really
>>> understand how this affects the order of how devices may be
>>> suspended/resumed?
>>>
>>> Also, I believe you didn't answer my question for the earlier version
>>> of the patch, so let me try again.
>>>
>>> There are a strict dependency chain when suspending/resuming devices
>>> that must be maintained. Currently this is controlled via device
>>> registration/probe order.
>>>
>>> An SDIO func driver/device must always be suspended *before* the SDIO
>>> card device. Additionally the corresponding MMC host, must be
>>> suspended after the SDIO card device. Vice verse applies to the resume
>>> sequence.
>>>
>>> As this patch enables asynchronous suspend, I am worried that it will
>>> break this dependency chain. What do you think?
>> After enabling asynchronous suspend/resume, PM core still ensures the strict 
>> suspend/resume dependency between child and parent devices - child must be 
>> suspended before its parent, and parent must be resumed before its child. 
>> SDIO function is child of SDIO card, and SDIO card is child of MMC host, and 
>> MMC host is child of MMC controller. So the dependency chain is not broken. 
>> Actually,  many devices have been using asynchronous suspend/resume mode now.
>
> I believe your view of how the PM core works for devices that *don't*
> use async suspend is wrong! The PM core doesn't respect parent/child
> relations during the device system PM phase for these devices.
I agree with you for the following description. But, I never described how PM 
core works for devices that don't use async mode. Where did you get my view 
about this?  I just said that PM core still ensure the dependency between child 
and parent devices after using async mode, I never said that the method 
ensuring dependency is the same for sync devices and async devices.
>
> Instead it relies on that devices in the "dpm list" are ordered
> correctly. As I tried to describe earlier, that list is being updated
> during device registration and probing (there are some other special
> cases as well).
>
> So, by enabling async suspend for a device it will trigger the PM core
> durng device system PM, to start caring about device's parent/child
> relations. I would appreciate if you could add some of this
> information to the change log, as that's *why* it should work nicely
> for mmc/sd/sdio to use async suspend.

>
>> Thanks,
>> Zhonghui
>>> Kind regards
>>> Ulf Hansson
>>>
>>>> ---
>>>> Changes in v3:
>>>> - Add test result in commit message
>>>>
>>>>  drivers/mmc/core/sdio.c |4 
>>>>  1 fi

Re: [PATCH v2] i2c: enable i2c device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui


On 10/20/2015 11:02 PM, Wolfram Sang wrote:
> On Thu, Sep 24, 2015 at 02:26:23PM +0800, Fu, Zhonghui wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables i2c device to suspend/resume asynchronously. This will
>> take advantage of multicore and improve system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu 
> Does it always work when say a PMIC or clock controller is connected to
> the I2C bus?
Sorry for missing this mail.

Yes, it does not care about what device. The sole difference of asynchronous 
suspend/resume mode is that the suspend/resume operation of one device is 
carried out in a separate kernel thread, and PM core ensures all related 
dependency.


Thanks,
Zhonghui


>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] hid: enable hid device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui


On 11/16/2015 11:26 PM, Jiri Kosina wrote:
> On Mon, 16 Nov 2015, Fu, Zhonghui wrote:
>
>> Hi Jiri,
>>
>> Any comments about this patch?
>>
>> After enabling the HID devices suspend/resume asynchronously on ASUS 
>> T100TA(Baytrail-T platform), the system suspend-to-idle/resume time is 
>> reduced about 20ms. Although this improvement is not very significant. 
>> But, if the suspend/resume operation of HID devices is very 
>> time-consuming on some other platforms, this patch can improve 
>> significantly system suspend/resume speed on these platforms.
> Hi,
>
> I don't think the question I've raised at
>
>   
> http://lkml.kernel.org/r/alpine.lnx.2.00.1509251404130.30...@pobox.suse.cz
>
> has ever been answered or at least discussed ... ?
Sorry for missing this mail.

At present, the file(/sys/.../power/async) can be used to enable one device 
suspend/resume asynchronously.  My patch only changes the default value of this 
file from "disabled" to "enabled".
The sole difference of asynchronous suspend/resume mode is that the 
suspend/resume operation of one device is carried out in a separate kernel 
thread, and PM core ensures all related dependency. I have verified this patch 
on some platforms, such as ASUS T100TA. Actually, many other devices have used 
this feature for a long time.


Thanks,
Zhonghui
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui

On 11/16/2015 2:23 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables sdhci-acpi device to suspend/resume asynchronously.
> This will take advantage of multicore and improve system
> suspend/resume speed. After enabling the sdhci-acpi devices and all
> their child devices to suspend/resume asynchronously on ASUS T100TA,
> the system suspend-to-idle time is reduced from 1645ms to 1096ms, and
> the system resume time is reduced from 940ms to 908ms.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v3:
> - Add test result in commit message
>
>  drivers/mmc/host/sdhci-acpi.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index f6047fc..3d27f2d 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
>   pm_runtime_enable(dev);
>   }
>  
> + device_enable_async_suspend(dev);
> +
>   return 0;
>  
>  err_free:
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] mmc: enable mmc host device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui

On 11/16/2015 12:20 AM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables mmc host device to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed. After enabling the mmc host and all their child devices to
> suspend/resume asynchronously on ASUS T100TA, the system suspend-to-
> idle time is reduced from 1645ms to 1114ms, and the system resume
> time is reduced from 940ms to 914ms.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v3:
> - Add test result in commit message
>
>  drivers/mmc/core/host.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index da950c4..7222fd7 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
> *dev)
>   host->class_dev.parent = dev;
>   host->class_dev.class = _host_class;
>   device_initialize(>class_dev);
> + device_enable_async_suspend(>class_dev);
>  
>   if (mmc_gpio_alloc(host)) {
>   put_device(>class_dev);
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui


On 11/17/2015 9:48 PM, Fu, Zhonghui wrote:
>
> On 11/16/2015 7:30 PM, Ulf Hansson wrote:
>> On 15 November 2015 at 14:53, Fu, Zhonghui  
>> wrote:
>>> Now, PM core supports asynchronous suspend/resume mode for devices
>>> during system suspend/resume, and the power state transition of one
>>> device may be completed in separate kernel thread. PM core ensures
>>> all power state transition timing dependency between devices. This
>>> patch enables SDIO card and function devices to suspend/resume
>>> asynchronously. This will take advantage of multicore and improve
>>> system suspend/resume speed. After enabling the SDIO devices and all
>>> their child devices to suspend/resume asynchronously on ASUS T100TA,
>>> the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
>>> the system resume time is reduced from 940ms to 918ms.
>>>
>>> Signed-off-by: Zhonghui Fu 
>> I think this is an interesting change, but I wonder if you really
>> understand how this affects the order of how devices may be
>> suspended/resumed?
>>
>> Also, I believe you didn't answer my question for the earlier version
>> of the patch, so let me try again.
>>
>> There are a strict dependency chain when suspending/resuming devices
>> that must be maintained. Currently this is controlled via device
>> registration/probe order.
>>
>> An SDIO func driver/device must always be suspended *before* the SDIO
>> card device. Additionally the corresponding MMC host, must be
>> suspended after the SDIO card device. Vice verse applies to the resume
>> sequence.
>>
>> As this patch enables asynchronous suspend, I am worried that it will
>> break this dependency chain. What do you think?
> After enabling asynchronous suspend/resume, PM core still ensures the strict 
> suspend/resume dependency between child and parent devices - child must be 
> suspended before its parent, and parent must be resumed before its child. 
> SDIO function is child of SDIO card, and SDIO card is child of MMC host, and 
> MMC host is child of MMC controller. So the dependency chain is not broken. 
> Actually,  many devices have been using asynchronous suspend/resume mode now.

Any comments are welcome.


Thanks,
Zhonghui
>
> Thanks,
> Zhonghui
>> Kind regards
>> Ulf Hansson
>>
>>> ---
>>> Changes in v3:
>>> - Add test result in commit message
>>>
>>>  drivers/mmc/core/sdio.c |4 
>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>>> index 16d838e..530ce88 100644
>>> --- a/drivers/mmc/core/sdio.c
>>> +++ b/drivers/mmc/core/sdio.c
>>> @@ -1113,6 +1113,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>>> pm_runtime_enable(>dev);
>>> }
>>>
>>> +   device_enable_async_suspend(>dev);
>>> +
>>> /*
>>>  * The number of functions on the card is encoded inside
>>>  * the ocr.
>>> @@ -1133,6 +1135,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>>>  */
>>> if (host->caps & MMC_CAP_POWER_OFF_CARD)
>>> pm_runtime_enable(>sdio_func[i]->dev);
>>> +
>>> +   device_enable_async_suspend(>sdio_func[i]->dev);
>>> }
>>>
>>> /*
>>> -- 1.7.1
>>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] i2c: enable i2c device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui


On 10/20/2015 11:02 PM, Wolfram Sang wrote:
> On Thu, Sep 24, 2015 at 02:26:23PM +0800, Fu, Zhonghui wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables i2c device to suspend/resume asynchronously. This will
>> take advantage of multicore and improve system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> Does it always work when say a PMIC or clock controller is connected to
> the I2C bus?
Sorry for missing this mail.

Yes, it does not care about what device. The sole difference of asynchronous 
suspend/resume mode is that the suspend/resume operation of one device is 
carried out in a separate kernel thread, and PM core ensures all related 
dependency.


Thanks,
Zhonghui


>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] hid: enable hid device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui


On 11/16/2015 11:26 PM, Jiri Kosina wrote:
> On Mon, 16 Nov 2015, Fu, Zhonghui wrote:
>
>> Hi Jiri,
>>
>> Any comments about this patch?
>>
>> After enabling the HID devices suspend/resume asynchronously on ASUS 
>> T100TA(Baytrail-T platform), the system suspend-to-idle/resume time is 
>> reduced about 20ms. Although this improvement is not very significant. 
>> But, if the suspend/resume operation of HID devices is very 
>> time-consuming on some other platforms, this patch can improve 
>> significantly system suspend/resume speed on these platforms.
> Hi,
>
> I don't think the question I've raised at
>
>   
> http://lkml.kernel.org/r/alpine.lnx.2.00.1509251404130.30...@pobox.suse.cz
>
> has ever been answered or at least discussed ... ?
Sorry for missing this mail.

At present, the file(/sys/.../power/async) can be used to enable one device 
suspend/resume asynchronously.  My patch only changes the default value of this 
file from "disabled" to "enabled".
The sole difference of asynchronous suspend/resume mode is that the 
suspend/resume operation of one device is carried out in a separate kernel 
thread, and PM core ensures all related dependency. I have verified this patch 
on some platforms, such as ASUS T100TA. Actually, many other devices have used 
this feature for a long time.


Thanks,
Zhonghui
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] mmc: enable mmc host device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui

On 11/16/2015 12:20 AM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables mmc host device to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed. After enabling the mmc host and all their child devices to
> suspend/resume asynchronously on ASUS T100TA, the system suspend-to-
> idle time is reduced from 1645ms to 1114ms, and the system resume
> time is reduced from 940ms to 914ms.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v3:
> - Add test result in commit message
>
>  drivers/mmc/core/host.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index da950c4..7222fd7 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
> *dev)
>   host->class_dev.parent = dev;
>   host->class_dev.class = _host_class;
>   device_initialize(>class_dev);
> + device_enable_async_suspend(>class_dev);
>  
>   if (mmc_gpio_alloc(host)) {
>   put_device(>class_dev);
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui

On 11/16/2015 2:23 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables sdhci-acpi device to suspend/resume asynchronously.
> This will take advantage of multicore and improve system
> suspend/resume speed. After enabling the sdhci-acpi devices and all
> their child devices to suspend/resume asynchronously on ASUS T100TA,
> the system suspend-to-idle time is reduced from 1645ms to 1096ms, and
> the system resume time is reduced from 940ms to 908ms.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v3:
> - Add test result in commit message
>
>  drivers/mmc/host/sdhci-acpi.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index f6047fc..3d27f2d 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
>   pm_runtime_enable(dev);
>   }
>  
> + device_enable_async_suspend(dev);
> +
>   return 0;
>  
>  err_free:
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-22 Thread Fu, Zhonghui


On 11/17/2015 9:48 PM, Fu, Zhonghui wrote:
>
> On 11/16/2015 7:30 PM, Ulf Hansson wrote:
>> On 15 November 2015 at 14:53, Fu, Zhonghui <zhonghui...@linux.intel.com> 
>> wrote:
>>> Now, PM core supports asynchronous suspend/resume mode for devices
>>> during system suspend/resume, and the power state transition of one
>>> device may be completed in separate kernel thread. PM core ensures
>>> all power state transition timing dependency between devices. This
>>> patch enables SDIO card and function devices to suspend/resume
>>> asynchronously. This will take advantage of multicore and improve
>>> system suspend/resume speed. After enabling the SDIO devices and all
>>> their child devices to suspend/resume asynchronously on ASUS T100TA,
>>> the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
>>> the system resume time is reduced from 940ms to 918ms.
>>>
>>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> I think this is an interesting change, but I wonder if you really
>> understand how this affects the order of how devices may be
>> suspended/resumed?
>>
>> Also, I believe you didn't answer my question for the earlier version
>> of the patch, so let me try again.
>>
>> There are a strict dependency chain when suspending/resuming devices
>> that must be maintained. Currently this is controlled via device
>> registration/probe order.
>>
>> An SDIO func driver/device must always be suspended *before* the SDIO
>> card device. Additionally the corresponding MMC host, must be
>> suspended after the SDIO card device. Vice verse applies to the resume
>> sequence.
>>
>> As this patch enables asynchronous suspend, I am worried that it will
>> break this dependency chain. What do you think?
> After enabling asynchronous suspend/resume, PM core still ensures the strict 
> suspend/resume dependency between child and parent devices - child must be 
> suspended before its parent, and parent must be resumed before its child. 
> SDIO function is child of SDIO card, and SDIO card is child of MMC host, and 
> MMC host is child of MMC controller. So the dependency chain is not broken. 
> Actually,  many devices have been using asynchronous suspend/resume mode now.

Any comments are welcome.


Thanks,
Zhonghui
>
> Thanks,
> Zhonghui
>> Kind regards
>> Ulf Hansson
>>
>>> ---
>>> Changes in v3:
>>> - Add test result in commit message
>>>
>>>  drivers/mmc/core/sdio.c |4 
>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>>> index 16d838e..530ce88 100644
>>> --- a/drivers/mmc/core/sdio.c
>>> +++ b/drivers/mmc/core/sdio.c
>>> @@ -1113,6 +1113,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>>> pm_runtime_enable(>dev);
>>> }
>>>
>>> +   device_enable_async_suspend(>dev);
>>> +
>>> /*
>>>  * The number of functions on the card is encoded inside
>>>  * the ocr.
>>> @@ -1133,6 +1135,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>>>  */
>>> if (host->caps & MMC_CAP_POWER_OFF_CARD)
>>> pm_runtime_enable(>sdio_func[i]->dev);
>>> +
>>> +   device_enable_async_suspend(>sdio_func[i]->dev);
>>> }
>>>
>>> /*
>>> -- 1.7.1
>>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-17 Thread Fu, Zhonghui


On 11/16/2015 7:30 PM, Ulf Hansson wrote:
> On 15 November 2015 at 14:53, Fu, Zhonghui  
> wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables SDIO card and function devices to suspend/resume
>> asynchronously. This will take advantage of multicore and improve
>> system suspend/resume speed. After enabling the SDIO devices and all
>> their child devices to suspend/resume asynchronously on ASUS T100TA,
>> the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
>> the system resume time is reduced from 940ms to 918ms.
>>
>> Signed-off-by: Zhonghui Fu 
> I think this is an interesting change, but I wonder if you really
> understand how this affects the order of how devices may be
> suspended/resumed?
>
> Also, I believe you didn't answer my question for the earlier version
> of the patch, so let me try again.
>
> There are a strict dependency chain when suspending/resuming devices
> that must be maintained. Currently this is controlled via device
> registration/probe order.
>
> An SDIO func driver/device must always be suspended *before* the SDIO
> card device. Additionally the corresponding MMC host, must be
> suspended after the SDIO card device. Vice verse applies to the resume
> sequence.
>
> As this patch enables asynchronous suspend, I am worried that it will
> break this dependency chain. What do you think?
After enabling asynchronous suspend/resume, PM core still ensures the strict 
suspend/resume dependency between child and parent devices - child must be 
suspended before its parent, and parent must be resumed before its child. SDIO 
function is child of SDIO card, and SDIO card is child of MMC host, and MMC 
host is child of MMC controller. So the dependency chain is not broken. 
Actually,  many devices have been using asynchronous suspend/resume mode now.

Thanks,
Zhonghui
>
> Kind regards
> Ulf Hansson
>
>> ---
>> Changes in v3:
>> - Add test result in commit message
>>
>>  drivers/mmc/core/sdio.c |4 
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>> index 16d838e..530ce88 100644
>> --- a/drivers/mmc/core/sdio.c
>> +++ b/drivers/mmc/core/sdio.c
>> @@ -1113,6 +1113,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>> pm_runtime_enable(>dev);
>> }
>>
>> +   device_enable_async_suspend(>dev);
>> +
>> /*
>>  * The number of functions on the card is encoded inside
>>  * the ocr.
>> @@ -1133,6 +1135,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>>  */
>> if (host->caps & MMC_CAP_POWER_OFF_CARD)
>> pm_runtime_enable(>sdio_func[i]->dev);
>> +
>> +   device_enable_async_suspend(>sdio_func[i]->dev);
>> }
>>
>> /*
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-17 Thread Fu, Zhonghui


On 11/16/2015 7:30 PM, Ulf Hansson wrote:
> On 15 November 2015 at 14:53, Fu, Zhonghui <zhonghui...@linux.intel.com> 
> wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables SDIO card and function devices to suspend/resume
>> asynchronously. This will take advantage of multicore and improve
>> system suspend/resume speed. After enabling the SDIO devices and all
>> their child devices to suspend/resume asynchronously on ASUS T100TA,
>> the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
>> the system resume time is reduced from 940ms to 918ms.
>>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> I think this is an interesting change, but I wonder if you really
> understand how this affects the order of how devices may be
> suspended/resumed?
>
> Also, I believe you didn't answer my question for the earlier version
> of the patch, so let me try again.
>
> There are a strict dependency chain when suspending/resuming devices
> that must be maintained. Currently this is controlled via device
> registration/probe order.
>
> An SDIO func driver/device must always be suspended *before* the SDIO
> card device. Additionally the corresponding MMC host, must be
> suspended after the SDIO card device. Vice verse applies to the resume
> sequence.
>
> As this patch enables asynchronous suspend, I am worried that it will
> break this dependency chain. What do you think?
After enabling asynchronous suspend/resume, PM core still ensures the strict 
suspend/resume dependency between child and parent devices - child must be 
suspended before its parent, and parent must be resumed before its child. SDIO 
function is child of SDIO card, and SDIO card is child of MMC host, and MMC 
host is child of MMC controller. So the dependency chain is not broken. 
Actually,  many devices have been using asynchronous suspend/resume mode now.

Thanks,
Zhonghui
>
> Kind regards
> Ulf Hansson
>
>> ---
>> Changes in v3:
>> - Add test result in commit message
>>
>>  drivers/mmc/core/sdio.c |4 
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>> index 16d838e..530ce88 100644
>> --- a/drivers/mmc/core/sdio.c
>> +++ b/drivers/mmc/core/sdio.c
>> @@ -1113,6 +1113,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>> pm_runtime_enable(>dev);
>> }
>>
>> +   device_enable_async_suspend(>dev);
>> +
>> /*
>>  * The number of functions on the card is encoded inside
>>  * the ocr.
>> @@ -1133,6 +1135,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>>  */
>> if (host->caps & MMC_CAP_POWER_OFF_CARD)
>> pm_runtime_enable(>sdio_func[i]->dev);
>> +
>> +   device_enable_async_suspend(>sdio_func[i]->dev);
>> }
>>
>> /*
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui



On 9/24/2015 3:10 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables i2c controller to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/i2c/busses/i2c-designware-platdrv.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
> b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 3dd2de3..fec0fce 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -245,6 +245,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
>  
>   adap = >adapter;
>   i2c_set_adapdata(adap, dev);
> + device_enable_async_suspend(>dev);
>   adap->owner = THIS_MODULE;
>   adap->class = I2C_CLASS_DEPRECATED;
>   strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] i2c: enable i2c adapter to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui



On 9/24/2015 2:50 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables i2c adapter to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/i2c/i2c-core.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 5f89f1e..c273b55 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1528,6 +1528,8 @@ static int i2c_register_adapter(struct i2c_adapter 
> *adap)
>  
>   pm_runtime_no_callbacks(>dev);
>  
> + device_enable_async_suspend(>dev);
> +
>  #ifdef CONFIG_I2C_COMPAT
>   res = class_compat_create_link(i2c_adapter_compat_class, >dev,
>  adap->dev.parent);
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] i2c: enable i2c device to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Hi,

Any comments are welcome.


Thanks,
Zhonghui



On 9/24/2015 2:26 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables i2c device to suspend/resume asynchronously. This will
> take advantage of multicore and improve system suspend/resume speed.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/i2c/i2c-core.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 5f89f1e..74e322b 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1036,6 +1036,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
> i2c_board_info const *info)
>   client->dev.of_node = info->of_node;
>   client->dev.fwnode = info->fwnode;
>  
> + device_enable_async_suspend(>dev);
>   i2c_dev_set_name(adap, client);
>   status = device_register(>dev);
>   if (status)
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] hid: enable hid device to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Hi Jiri,

Any comments about this patch?

After enabling the HID devices suspend/resume asynchronously on ASUS 
T100TA(Baytrail-T platform), the system suspend-to-idle/resume time is reduced 
about 20ms. Although this improvement is not very significant. But, if the 
suspend/resume operation of HID devices is very time-consuming on some other 
platforms, this patch can improve significantly system suspend/resume speed on 
these platforms. 



Thanks,
Zhonghui 



On 9/24/2015 2:06 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables hid devices to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/hid/hid-core.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 70a11ac..357f3a3 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2652,6 +2652,7 @@ struct hid_device *hid_allocate_device(void)
>   device_initialize(>dev);
>   hdev->dev.release = hid_device_release;
>   hdev->dev.bus = _bus_type;
> + device_enable_async_suspend(>dev);
>  
>   hid_close_report(hdev);
>  
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui



On 9/24/2015 3:10 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables i2c controller to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/i2c/busses/i2c-designware-platdrv.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
> b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 3dd2de3..fec0fce 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -245,6 +245,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
>  
>   adap = >adapter;
>   i2c_set_adapdata(adap, dev);
> + device_enable_async_suspend(>dev);
>   adap->owner = THIS_MODULE;
>   adap->class = I2C_CLASS_DEPRECATED;
>   strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] hid: enable hid device to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Hi Jiri,

Any comments about this patch?

After enabling the HID devices suspend/resume asynchronously on ASUS 
T100TA(Baytrail-T platform), the system suspend-to-idle/resume time is reduced 
about 20ms. Although this improvement is not very significant. But, if the 
suspend/resume operation of HID devices is very time-consuming on some other 
platforms, this patch can improve significantly system suspend/resume speed on 
these platforms. 



Thanks,
Zhonghui 



On 9/24/2015 2:06 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables hid devices to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/hid/hid-core.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 70a11ac..357f3a3 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2652,6 +2652,7 @@ struct hid_device *hid_allocate_device(void)
>   device_initialize(>dev);
>   hdev->dev.release = hid_device_release;
>   hdev->dev.bus = _bus_type;
> + device_enable_async_suspend(>dev);
>  
>   hid_close_report(hdev);
>  
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] i2c: enable i2c adapter to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Any comments are welcome.


Thanks,
Zhonghui



On 9/24/2015 2:50 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables i2c adapter to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/i2c/i2c-core.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 5f89f1e..c273b55 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1528,6 +1528,8 @@ static int i2c_register_adapter(struct i2c_adapter 
> *adap)
>  
>   pm_runtime_no_callbacks(>dev);
>  
> + device_enable_async_suspend(>dev);
> +
>  #ifdef CONFIG_I2C_COMPAT
>   res = class_compat_create_link(i2c_adapter_compat_class, >dev,
>  adap->dev.parent);
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] i2c: enable i2c device to suspend/resume asynchronously

2015-11-16 Thread Fu, Zhonghui

Hi,

Any comments are welcome.


Thanks,
Zhonghui



On 9/24/2015 2:26 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables i2c device to suspend/resume asynchronously. This will
> take advantage of multicore and improve system suspend/resume speed.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/i2c/i2c-core.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 5f89f1e..74e322b 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1036,6 +1036,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
> i2c_board_info const *info)
>   client->dev.of_node = info->of_node;
>   client->dev.fwnode = info->fwnode;
>  
> + device_enable_async_suspend(>dev);
>   i2c_dev_set_name(adap, client);
>   status = device_register(>dev);
>   if (status)
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: [PATCH v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui


On 9/21/2015 5:32 PM, Andy Shevchenko wrote:
> On Mon, 2015-09-21 at 14:51 +0800, Fu, Zhonghui wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables sdhci-acpi device to suspend/resume asynchronously.
>> This will take advantage of multicore and improve system
>> suspend/resume speed.
>>
> It would be nice I think to put here statistics you collected as well.

Sorry for replying this mail after long leave.

I have added the test result into commit message and sent the latest version of 
this patch:"[PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to 
suspend/resume asynchronously".


Thanks,
Zhonghui

>
>> Signed-off-by: Zhonghui Fu 
>> ---
>> Changes in v2:
>> - Amend commit message.
>>
>>  drivers/mmc/host/sdhci-acpi.c |2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci
>> -acpi.c
>> index 22d929f..67e6263 100644
>> --- a/drivers/mmc/host/sdhci-acpi.c
>> +++ b/drivers/mmc/host/sdhci-acpi.c
>> @@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct 
>> platform_device *pdev)
>>  pm_runtime_enable(dev);
>>  }
>>  
>> +device_enable_async_suspend(dev);
>> +
>>  return 0;
>>  
>>  err_free:
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui

Please review the latest version: "[PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi 
device to suspend/resume asynchronously"


Thanks,
Zhonghui

On 9/21/2015 2:51 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables sdhci-acpi device to suspend/resume asynchronously.
> This will take advantage of multicore and improve system
> suspend/resume speed.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/mmc/host/sdhci-acpi.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 22d929f..67e6263 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
>   pm_runtime_enable(dev);
>   }
>  
> + device_enable_async_suspend(dev);
> +
>   return 0;
>  
>  err_free:
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables sdhci-acpi device to suspend/resume asynchronously.
This will take advantage of multicore and improve system
suspend/resume speed. After enabling the sdhci-acpi devices and all
their child devices to suspend/resume asynchronously on ASUS T100TA,
the system suspend-to-idle time is reduced from 1645ms to 1096ms, and
the system resume time is reduced from 940ms to 908ms.

Signed-off-by: Zhonghui Fu 
---
Changes in v3:
- Add test result in commit message

 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index f6047fc..3d27f2d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mmc: enable mmc host device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui

Please review the latest version: "[PATCH v3] mmc: enable mmc host device to 
suspend/resume asynchronously"


Thanks,
Zhonghui

On 9/21/2015 2:13 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables mmc host device to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/mmc/core/host.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index abd933b..8dfc011 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -577,6 +577,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
> *dev)
>   host->class_dev.parent = dev;
>   host->class_dev.class = _host_class;
>   device_initialize(>class_dev);
> + device_enable_async_suspend(>class_dev);
>  
>   if (mmc_gpio_alloc(host)) {
>   put_device(>class_dev);
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] mmc: enable mmc host device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables mmc host device to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed. After enabling the mmc host and all their child devices to
suspend/resume asynchronously on ASUS T100TA, the system suspend-to-
idle time is reduced from 1645ms to 1114ms, and the system resume
time is reduced from 940ms to 914ms.

Signed-off-by: Zhonghui Fu 
---
Changes in v3:
- Add test result in commit message

 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index da950c4..7222fd7 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: [PATCH] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui


On 9/21/2015 4:41 PM, Adrian Hunter wrote:
> On 21/09/15 11:15, Adrian Hunter wrote:
>> On 21/09/15 08:29, Fu, Zhonghui wrote:
>>>
>>> On 2015/8/24 15:07, Fu, Zhonghui wrote:
>>>> On 2015/8/17 14:48, Adrian Hunter wrote:
>>>>> On 17/08/15 06:26, Fu, Zhonghui wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Any comments are welcome.
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Zhonghui
>>>>>>
>>>>>> On 2015/7/30 15:40, Fu, Zhonghui wrote:
>>>>>>> Enable SDIO card and function device to suspend/resume asynchronously.
>>>>>>> This can improve system suspend/resume speed.
>>>>> For me, it needs more explanation.
>>>>>
>>>>> For example, why is this worth doing?  Can you give an example where it 
>>>>> does
>>>>> significantly improve suspend/resume speed?  Are there any cases where it
>>>>> could be worse?
>>>>>
>>>>> Why is it safe?  Presumably it is safe if there are no dependencies on the
>>>>> device outside the device hierarchy. Is that so?  Are there any other
>>>>> potential pitfalls to enabling async_suspend?
>>>> Now, PM core support asynchronous device suspend/resume mode. If one 
>>>> device has been set to support asynchronous PM mode, it's suspend/resume 
>>>> operation can be performed in a separate kernel thread and take advantage 
>>>> of multicore feature to improve overall system suspend/resume speed. The 
>>>> worst case is that all device suspend/resume threads will be scheduled to 
>>>> the same CPU, it hardly occur.
>>>>
>>>> PM core ensure all the suspend/resume dependency related to one device. 
>>>> Actually, async suspend/resume mode is one feature of PM core, every 
>>>> device subsystem may use it or not use it. Once one device subsystem 
>>>> choose to use this feature, its safety is up to PM core as long as device 
>>>> subsystem has initialized fully this device.
>>> The original suspend time is 1645ms and resume time is 940ms on ASUS T100TA
>>> machine. After enabling "wiphy device", "SDIO device", "mmc host" and
>>> "sdhci-acpi device" to suspend/resume asynchronously, the suspend time is
>>> 1096ms and resume time is 908ms. The test environment is listed as follows:
>>>
>>> OS: Ubuntu 14.04
>>> Kernel: mainline v4.1
>>> Machine: ASUS T100TA(Baytrail-T platform)
>>> Tool: analyze_suspend
>>> “analyze_suspend.py –f –m freeze” to suspend system
>>> Press power button to resume system
>>>
>>> I have resent this patch with updated commit message - "[PATCH v2] MMC/SDIO:
>>> enable SDIO device to suspend/resume asynchronously".
>> It is really cool that you tested this.  Thank you!
>>
>> I am a bit baffled and bemused that you didn't put a summary of the testing
>> and results in the commit message.  Can you do that.
>>
>> As I wrote, we are assuming that there are no dependencies on the device
>> outside the device hierarchy. That is a reasonable assumption for an SDIO
>> controller because it doesn't provide resources for other devices to use,
>> except for the card itself which is a child device, and therefore a
>> dependency that PM core knows about.
>>
>> Does that make sense?  If it does then shouldn't that explanation be added
>> to the commit message too.  i.e. this is why we think it is always going to
>> work?
> Just realized this patch is for the card, not the host controller, so those
> last 2 paragraphs don't apply.

Sorry for replying this mail after long leave.

Thanks for your comments. I have added the test result into commit message and 
sent the latest version of this patch: "[PATCH v3] MMC/SDIO: enable SDIO device 
to suspend/resume asynchronously"


Thanks,
Zhonghui
>
>>>
>>> Thanks,
>>> Zhonghui
>>>>
>>>> Thanks,
>>>> Zhonghui  
>>>>>>> Signed-off-by: Zhonghui Fu 
>>>>>>> ---
>>>>>>>  drivers/mmc/core/sdio.c |4 
>>>>>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>>>>>>> index b91abed..6719b77 100644
>>>>>>> --- a/drivers/mmc/core/sdio.c
>>>&

Re: [PATCH v2] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui


Please see the latest version: "[PATCH v3] MMC/SDIO: enable SDIO device to 
suspend/resume asynchronously".


Thanks,
Zhonghui

On 9/21/2015 12:30 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables SDIO card and function devices to suspend/resume
> asynchronously. This will take advantage of multicore and improve
> system suspend/resume speed.
>
> Signed-off-by: Zhonghui Fu 
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/mmc/core/sdio.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index b91abed..6719b77 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -1106,6 +1106,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>   pm_runtime_enable(>dev);
>   }
>  
> + device_enable_async_suspend(>dev);
> +
>   /*
>* The number of functions on the card is encoded inside
>* the ocr.
> @@ -1126,6 +1128,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>*/
>   if (host->caps & MMC_CAP_POWER_OFF_CARD)
>   pm_runtime_enable(>sdio_func[i]->dev);
> +
> + device_enable_async_suspend(>sdio_func[i]->dev);
>   }
>  
>   /*
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables SDIO card and function devices to suspend/resume
asynchronously. This will take advantage of multicore and improve
system suspend/resume speed. After enabling the SDIO devices and all
their child devices to suspend/resume asynchronously on ASUS T100TA,
the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
the system resume time is reduced from 940ms to 918ms.

Signed-off-by: Zhonghui Fu 
---
Changes in v3:
- Add test result in commit message

 drivers/mmc/core/sdio.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 16d838e..530ce88 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1113,6 +1113,8 @@ int mmc_attach_sdio(struct mmc_host *host)
pm_runtime_enable(>dev);
}
 
+   device_enable_async_suspend(>dev);
+
/*
 * The number of functions on the card is encoded inside
 * the ocr.
@@ -1133,6 +1135,8 @@ int mmc_attach_sdio(struct mmc_host *host)
 */
if (host->caps & MMC_CAP_POWER_OFF_CARD)
pm_runtime_enable(>sdio_func[i]->dev);
+
+   device_enable_async_suspend(>sdio_func[i]->dev);
}
 
/*
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui


Please see the latest version: "[PATCH v3] MMC/SDIO: enable SDIO device to 
suspend/resume asynchronously".


Thanks,
Zhonghui

On 9/21/2015 12:30 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables SDIO card and function devices to suspend/resume
> asynchronously. This will take advantage of multicore and improve
> system suspend/resume speed.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/mmc/core/sdio.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index b91abed..6719b77 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -1106,6 +1106,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>   pm_runtime_enable(>dev);
>   }
>  
> + device_enable_async_suspend(>dev);
> +
>   /*
>* The number of functions on the card is encoded inside
>* the ocr.
> @@ -1126,6 +1128,8 @@ int mmc_attach_sdio(struct mmc_host *host)
>*/
>   if (host->caps & MMC_CAP_POWER_OFF_CARD)
>   pm_runtime_enable(>sdio_func[i]->dev);
> +
> + device_enable_async_suspend(>sdio_func[i]->dev);
>   }
>  
>   /*
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mmc: enable mmc host device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui

Please review the latest version: "[PATCH v3] mmc: enable mmc host device to 
suspend/resume asynchronously"


Thanks,
Zhonghui

On 9/21/2015 2:13 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables mmc host device to suspend/resume asynchronously. This
> will take advantage of multicore and improve system suspend/resume
> speed.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/mmc/core/host.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index abd933b..8dfc011 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -577,6 +577,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
> *dev)
>   host->class_dev.parent = dev;
>   host->class_dev.class = _host_class;
>   device_initialize(>class_dev);
> + device_enable_async_suspend(>class_dev);
>  
>   if (mmc_gpio_alloc(host)) {
>   put_device(>class_dev);
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables SDIO card and function devices to suspend/resume
asynchronously. This will take advantage of multicore and improve
system suspend/resume speed. After enabling the SDIO devices and all
their child devices to suspend/resume asynchronously on ASUS T100TA,
the system suspend-to-idle time is reduced from 1645ms to 1119ms, and
the system resume time is reduced from 940ms to 918ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v3:
- Add test result in commit message

 drivers/mmc/core/sdio.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 16d838e..530ce88 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1113,6 +1113,8 @@ int mmc_attach_sdio(struct mmc_host *host)
pm_runtime_enable(>dev);
}
 
+   device_enable_async_suspend(>dev);
+
/*
 * The number of functions on the card is encoded inside
 * the ocr.
@@ -1133,6 +1135,8 @@ int mmc_attach_sdio(struct mmc_host *host)
 */
if (host->caps & MMC_CAP_POWER_OFF_CARD)
pm_runtime_enable(>sdio_func[i]->dev);
+
+   device_enable_async_suspend(>sdio_func[i]->dev);
}
 
/*
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: [PATCH] MMC/SDIO: enable SDIO device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui


On 9/21/2015 4:41 PM, Adrian Hunter wrote:
> On 21/09/15 11:15, Adrian Hunter wrote:
>> On 21/09/15 08:29, Fu, Zhonghui wrote:
>>>
>>> On 2015/8/24 15:07, Fu, Zhonghui wrote:
>>>> On 2015/8/17 14:48, Adrian Hunter wrote:
>>>>> On 17/08/15 06:26, Fu, Zhonghui wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Any comments are welcome.
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Zhonghui
>>>>>>
>>>>>> On 2015/7/30 15:40, Fu, Zhonghui wrote:
>>>>>>> Enable SDIO card and function device to suspend/resume asynchronously.
>>>>>>> This can improve system suspend/resume speed.
>>>>> For me, it needs more explanation.
>>>>>
>>>>> For example, why is this worth doing?  Can you give an example where it 
>>>>> does
>>>>> significantly improve suspend/resume speed?  Are there any cases where it
>>>>> could be worse?
>>>>>
>>>>> Why is it safe?  Presumably it is safe if there are no dependencies on the
>>>>> device outside the device hierarchy. Is that so?  Are there any other
>>>>> potential pitfalls to enabling async_suspend?
>>>> Now, PM core support asynchronous device suspend/resume mode. If one 
>>>> device has been set to support asynchronous PM mode, it's suspend/resume 
>>>> operation can be performed in a separate kernel thread and take advantage 
>>>> of multicore feature to improve overall system suspend/resume speed. The 
>>>> worst case is that all device suspend/resume threads will be scheduled to 
>>>> the same CPU, it hardly occur.
>>>>
>>>> PM core ensure all the suspend/resume dependency related to one device. 
>>>> Actually, async suspend/resume mode is one feature of PM core, every 
>>>> device subsystem may use it or not use it. Once one device subsystem 
>>>> choose to use this feature, its safety is up to PM core as long as device 
>>>> subsystem has initialized fully this device.
>>> The original suspend time is 1645ms and resume time is 940ms on ASUS T100TA
>>> machine. After enabling "wiphy device", "SDIO device", "mmc host" and
>>> "sdhci-acpi device" to suspend/resume asynchronously, the suspend time is
>>> 1096ms and resume time is 908ms. The test environment is listed as follows:
>>>
>>> OS: Ubuntu 14.04
>>> Kernel: mainline v4.1
>>> Machine: ASUS T100TA(Baytrail-T platform)
>>> Tool: analyze_suspend
>>> “analyze_suspend.py –f –m freeze” to suspend system
>>> Press power button to resume system
>>>
>>> I have resent this patch with updated commit message - "[PATCH v2] MMC/SDIO:
>>> enable SDIO device to suspend/resume asynchronously".
>> It is really cool that you tested this.  Thank you!
>>
>> I am a bit baffled and bemused that you didn't put a summary of the testing
>> and results in the commit message.  Can you do that.
>>
>> As I wrote, we are assuming that there are no dependencies on the device
>> outside the device hierarchy. That is a reasonable assumption for an SDIO
>> controller because it doesn't provide resources for other devices to use,
>> except for the card itself which is a child device, and therefore a
>> dependency that PM core knows about.
>>
>> Does that make sense?  If it does then shouldn't that explanation be added
>> to the commit message too.  i.e. this is why we think it is always going to
>> work?
> Just realized this patch is for the card, not the host controller, so those
> last 2 paragraphs don't apply.

Sorry for replying this mail after long leave.

Thanks for your comments. I have added the test result into commit message and 
sent the latest version of this patch: "[PATCH v3] MMC/SDIO: enable SDIO device 
to suspend/resume asynchronously"


Thanks,
Zhonghui
>
>>>
>>> Thanks,
>>> Zhonghui
>>>>
>>>> Thanks,
>>>> Zhonghui  
>>>>>>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>>>>>>> ---
>>>>>>>  drivers/mmc/core/sdio.c |4 
>>>>>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>>>>>>> index b91abed..6719b77 100644
>>>>>>&

[PATCH v3] mmc: enable mmc host device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables mmc host device to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed. After enabling the mmc host and all their child devices to
suspend/resume asynchronously on ASUS T100TA, the system suspend-to-
idle time is reduced from 1645ms to 1114ms, and the system resume
time is reduced from 940ms to 914ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v3:
- Add test result in commit message

 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index da950c4..7222fd7 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Re: [PATCH v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui


On 9/21/2015 5:32 PM, Andy Shevchenko wrote:
> On Mon, 2015-09-21 at 14:51 +0800, Fu, Zhonghui wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables sdhci-acpi device to suspend/resume asynchronously.
>> This will take advantage of multicore and improve system
>> suspend/resume speed.
>>
> It would be nice I think to put here statistics you collected as well.

Sorry for replying this mail after long leave.

I have added the test result into commit message and sent the latest version of 
this patch:"[PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to 
suspend/resume asynchronously".


Thanks,
Zhonghui

>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> ---
>> Changes in v2:
>> - Amend commit message.
>>
>>  drivers/mmc/host/sdhci-acpi.c |2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci
>> -acpi.c
>> index 22d929f..67e6263 100644
>> --- a/drivers/mmc/host/sdhci-acpi.c
>> +++ b/drivers/mmc/host/sdhci-acpi.c
>> @@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct 
>> platform_device *pdev)
>>  pm_runtime_enable(dev);
>>  }
>>  
>> +device_enable_async_suspend(dev);
>> +
>>  return 0;
>>  
>>  err_free:
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables sdhci-acpi device to suspend/resume asynchronously.
This will take advantage of multicore and improve system
suspend/resume speed. After enabling the sdhci-acpi devices and all
their child devices to suspend/resume asynchronously on ASUS T100TA,
the system suspend-to-idle time is reduced from 1645ms to 1096ms, and
the system resume time is reduced from 940ms to 908ms.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v3:
- Add test result in commit message

 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index f6047fc..3d27f2d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -388,6 +388,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-11-15 Thread Fu, Zhonghui

Please review the latest version: "[PATCH v3] mmc/sdhci-acpi: enable sdhci-acpi 
device to suspend/resume asynchronously"


Thanks,
Zhonghui

On 9/21/2015 2:51 PM, Fu, Zhonghui wrote:
> Now, PM core supports asynchronous suspend/resume mode for devices
> during system suspend/resume, and the power state transition of one
> device may be completed in separate kernel thread. PM core ensures
> all power state transition timing dependency between devices. This
> patch enables sdhci-acpi device to suspend/resume asynchronously.
> This will take advantage of multicore and improve system
> suspend/resume speed.
>
> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
> ---
> Changes in v2:
> - Amend commit message.
>
>  drivers/mmc/host/sdhci-acpi.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 22d929f..67e6263 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
>   pm_runtime_enable(dev);
>   }
>  
> + device_enable_async_suspend(dev);
> +
>   return 0;
>  
>  err_free:
> -- 1.7.1
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui

Hi,

I have resent this patch with updated commit message - "[PATCH v2] 
i2c/designware: enable i2c controller to suspend/resume asynchronously".


Thanks,
Zhonghui

On 2015/8/24 23:23, Fu, Zhonghui wrote:
> Hi,
>
> Any comments are welcome.
>
>
> Thanks,
> Zhonghui
>
>
>
> On 2015/8/18 0:36, Fu, Zhonghui wrote:
>> Enable i2c controller to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu 
>> ---
>>  drivers/i2c/busses/i2c-designware-platdrv.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
>> b/drivers/i2c/busses/i2c-designware-platdrv.c
>> index 3dd2de3..fec0fce 100644
>> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
>> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
>> @@ -245,6 +245,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
>>  
>>  adap = >adapter;
>>  i2c_set_adapdata(adap, dev);
>> +device_enable_async_suspend(>dev);
>>  adap->owner = THIS_MODULE;
>>  adap->class = I2C_CLASS_DEPRECATED;
>>  strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables i2c controller to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu 
---
Changes in v2:
- Amend commit message.

 drivers/i2c/busses/i2c-designware-platdrv.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
b/drivers/i2c/busses/i2c-designware-platdrv.c
index 3dd2de3..fec0fce 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -245,6 +245,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
 
adap = >adapter;
i2c_set_adapdata(adap, dev);
+   device_enable_async_suspend(>dev);
adap->owner = THIS_MODULE;
adap->class = I2C_CLASS_DEPRECATED;
strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i2c: enable i2c adapter to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui

Hi,

I have resent this patch with updated commit message - "[PATCH v2] i2c: enable 
i2c adapter to suspend/resume asynchronously".


Thanks,
Zhonghui

On 2015/8/24 23:22, Fu, Zhonghui wrote:
> Hi,
>
> Any comments are welcome.
>
>
> Thanks,
> Zhonghui
>
>
>
> On 2015/8/18 0:17, Fu, Zhonghui wrote:
>> Enable i2c adapter to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu 
>> ---
>>  drivers/i2c/i2c-core.c |2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
>> index c83e4d1..90251be 100644
>> --- a/drivers/i2c/i2c-core.c
>> +++ b/drivers/i2c/i2c-core.c
>> @@ -1439,6 +1439,8 @@ static int i2c_register_adapter(struct i2c_adapter 
>> *adap)
>>  
>>  pm_runtime_no_callbacks(>dev);
>>  
>> +device_enable_async_suspend(>dev);
>> +
>>  #ifdef CONFIG_I2C_COMPAT
>>  res = class_compat_create_link(i2c_adapter_compat_class, >dev,
>> adap->dev.parent);
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] i2c: enable i2c adapter to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables i2c adapter to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu 
---
Changes in v2:
- Amend commit message.

 drivers/i2c/i2c-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 5f89f1e..c273b55 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1528,6 +1528,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
pm_runtime_no_callbacks(>dev);
 
+   device_enable_async_suspend(>dev);
+
 #ifdef CONFIG_I2C_COMPAT
res = class_compat_create_link(i2c_adapter_compat_class, >dev,
   adap->dev.parent);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i2c: enable i2c device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui

Hi,

I have resent this patch with updated commit message - "[PATCH v2] i2c: enable 
i2c device to suspend/resume asynchronously".


Thanks,
Zhonghui

On 2015/8/24 23:18, Fu, Zhonghui wrote:
> Hi,
>
> Any comments are welcome.
>
>
> Thanks,
> Zhonghui
>
>
>
> On 2015/8/18 0:07, Fu, Zhonghui wrote:
>> Enable i2c device to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu 
>> ---
>>  drivers/i2c/i2c-core.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
>> index c83e4d1..6587681 100644
>> --- a/drivers/i2c/i2c-core.c
>> +++ b/drivers/i2c/i2c-core.c
>> @@ -987,6 +987,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
>> i2c_board_info const *info)
>>  client->dev.of_node = info->of_node;
>>  client->dev.fwnode = info->fwnode;
>>  
>> +device_enable_async_suspend(>dev);
>>  i2c_dev_set_name(adap, client);
>>  status = device_register(>dev);
>>  if (status)
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] i2c: enable i2c device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables i2c device to suspend/resume asynchronously. This will
take advantage of multicore and improve system suspend/resume speed.

Signed-off-by: Zhonghui Fu 
---
Changes in v2:
- Amend commit message.

 drivers/i2c/i2c-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 5f89f1e..74e322b 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1036,6 +1036,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
i2c_board_info const *info)
client->dev.of_node = info->of_node;
client->dev.fwnode = info->fwnode;
 
+   device_enable_async_suspend(>dev);
i2c_dev_set_name(adap, client);
status = device_register(>dev);
if (status)
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] hid: enable hid device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui


On 2015/9/4 21:10, Jiri Kosina wrote:
> On Mon, 17 Aug 2015, Fu, Zhonghui wrote:
>
>> Enable hid device to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
> How well was this tested?
>
> Power management is notorious for not being really in excellent shape on 
> many HID devices.
>
> So I'd like to be careful.
I were on leave these days, so sorry for late reply.

This can reduce system suspend/resume time about 20ms, from 1030ms to 1010ms on 
ASUS T100TA machine. Although the improvement is not very significant, but this 
can let your parent/child device suspend/resume more asynchronously and take 
advantage of multicore to improve overall system suspend/resume speed.

I have resent this patch with updated commit message - "[PATCH v2] hid: enable 
hid device to suspend/resume asynchronously".


Thanks,
Zhonghui

>
> Thanks,
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] hid: enable hid device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables hid devices to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu 
---
Changes in v2:
- Amend commit message.

 drivers/hid/hid-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 70a11ac..357f3a3 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2652,6 +2652,7 @@ struct hid_device *hid_allocate_device(void)
device_initialize(>dev);
hdev->dev.release = hid_device_release;
hdev->dev.bus = _bus_type;
+   device_enable_async_suspend(>dev);
 
hid_close_report(hdev);
 
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] hid: enable hid device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui


On 2015/9/4 21:10, Jiri Kosina wrote:
> On Mon, 17 Aug 2015, Fu, Zhonghui wrote:
>
>> Enable hid device to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
> How well was this tested?
>
> Power management is notorious for not being really in excellent shape on 
> many HID devices.
>
> So I'd like to be careful.
I were on leave these days, so sorry for late reply.

This can reduce system suspend/resume time about 20ms, from 1030ms to 1010ms on 
ASUS T100TA machine. Although the improvement is not very significant, but this 
can let your parent/child device suspend/resume more asynchronously and take 
advantage of multicore to improve overall system suspend/resume speed.

I have resent this patch with updated commit message - "[PATCH v2] hid: enable 
hid device to suspend/resume asynchronously".


Thanks,
Zhonghui

>
> Thanks,
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i2c: enable i2c device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui

Hi,

I have resent this patch with updated commit message - "[PATCH v2] i2c: enable 
i2c device to suspend/resume asynchronously".


Thanks,
Zhonghui

On 2015/8/24 23:18, Fu, Zhonghui wrote:
> Hi,
>
> Any comments are welcome.
>
>
> Thanks,
> Zhonghui
>
>
>
> On 2015/8/18 0:07, Fu, Zhonghui wrote:
>> Enable i2c device to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> ---
>>  drivers/i2c/i2c-core.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
>> index c83e4d1..6587681 100644
>> --- a/drivers/i2c/i2c-core.c
>> +++ b/drivers/i2c/i2c-core.c
>> @@ -987,6 +987,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
>> i2c_board_info const *info)
>>  client->dev.of_node = info->of_node;
>>  client->dev.fwnode = info->fwnode;
>>  
>> +device_enable_async_suspend(>dev);
>>  i2c_dev_set_name(adap, client);
>>  status = device_register(>dev);
>>  if (status)
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] i2c: enable i2c device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables i2c device to suspend/resume asynchronously. This will
take advantage of multicore and improve system suspend/resume speed.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v2:
- Amend commit message.

 drivers/i2c/i2c-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 5f89f1e..74e322b 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1036,6 +1036,7 @@ i2c_new_device(struct i2c_adapter *adap, struct 
i2c_board_info const *info)
client->dev.of_node = info->of_node;
client->dev.fwnode = info->fwnode;
 
+   device_enable_async_suspend(>dev);
i2c_dev_set_name(adap, client);
status = device_register(>dev);
if (status)
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables i2c controller to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v2:
- Amend commit message.

 drivers/i2c/busses/i2c-designware-platdrv.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
b/drivers/i2c/busses/i2c-designware-platdrv.c
index 3dd2de3..fec0fce 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -245,6 +245,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
 
adap = >adapter;
i2c_set_adapdata(adap, dev);
+   device_enable_async_suspend(>dev);
adap->owner = THIS_MODULE;
adap->class = I2C_CLASS_DEPRECATED;
strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] hid: enable hid device to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables hid devices to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v2:
- Amend commit message.

 drivers/hid/hid-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 70a11ac..357f3a3 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -2652,6 +2652,7 @@ struct hid_device *hid_allocate_device(void)
device_initialize(>dev);
hdev->dev.release = hid_device_release;
hdev->dev.bus = _bus_type;
+   device_enable_async_suspend(>dev);
 
hid_close_report(hdev);
 
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i2c: enable i2c adapter to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui

Hi,

I have resent this patch with updated commit message - "[PATCH v2] i2c: enable 
i2c adapter to suspend/resume asynchronously".


Thanks,
Zhonghui

On 2015/8/24 23:22, Fu, Zhonghui wrote:
> Hi,
>
> Any comments are welcome.
>
>
> Thanks,
> Zhonghui
>
>
>
> On 2015/8/18 0:17, Fu, Zhonghui wrote:
>> Enable i2c adapter to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> ---
>>  drivers/i2c/i2c-core.c |2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
>> index c83e4d1..90251be 100644
>> --- a/drivers/i2c/i2c-core.c
>> +++ b/drivers/i2c/i2c-core.c
>> @@ -1439,6 +1439,8 @@ static int i2c_register_adapter(struct i2c_adapter 
>> *adap)
>>  
>>  pm_runtime_no_callbacks(>dev);
>>  
>> +device_enable_async_suspend(>dev);
>> +
>>  #ifdef CONFIG_I2C_COMPAT
>>  res = class_compat_create_link(i2c_adapter_compat_class, >dev,
>> adap->dev.parent);
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] i2c: enable i2c adapter to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables i2c adapter to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v2:
- Amend commit message.

 drivers/i2c/i2c-core.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 5f89f1e..c273b55 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1528,6 +1528,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
pm_runtime_no_callbacks(>dev);
 
+   device_enable_async_suspend(>dev);
+
 #ifdef CONFIG_I2C_COMPAT
res = class_compat_create_link(i2c_adapter_compat_class, >dev,
   adap->dev.parent);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] i2c/designware: enable i2c controller to suspend/resume asynchronously

2015-09-24 Thread Fu, Zhonghui

Hi,

I have resent this patch with updated commit message - "[PATCH v2] 
i2c/designware: enable i2c controller to suspend/resume asynchronously".


Thanks,
Zhonghui

On 2015/8/24 23:23, Fu, Zhonghui wrote:
> Hi,
>
> Any comments are welcome.
>
>
> Thanks,
> Zhonghui
>
>
>
> On 2015/8/18 0:36, Fu, Zhonghui wrote:
>> Enable i2c controller to suspend/resume asynchronously. This can improve
>> system suspend/resume speed.
>>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> ---
>>  drivers/i2c/busses/i2c-designware-platdrv.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c 
>> b/drivers/i2c/busses/i2c-designware-platdrv.c
>> index 3dd2de3..fec0fce 100644
>> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
>> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
>> @@ -245,6 +245,7 @@ static int dw_i2c_probe(struct platform_device *pdev)
>>  
>>  adap = >adapter;
>>  i2c_set_adapdata(adap, dev);
>> +device_enable_async_suspend(>dev);
>>  adap->owner = THIS_MODULE;
>>  adap->class = I2C_CLASS_DEPRECATED;
>>  strlcpy(adap->name, "Synopsys DesignWare I2C adapter",
>> -- 1.7.1
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] net/wireless: enable wiphy device to suspend/resume asynchronously

2015-09-22 Thread Fu, Zhonghui

Hi johannes,

Could you please tell me which kernel version will merge this patch?


Thanks,
Zhonghui

 
On 2015/9/22 22:05, Johannes Berg wrote:
> On Sat, 2015-09-19 at 10:40 +0800, Fu, Zhonghui wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables wiphy device to suspend/resume asynchronously. This can
>> take advantage of multicore and improve system suspend/resume speed.
>>
> Applied.
>
> johannes
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] net/wireless: enable wiphy device to suspend/resume asynchronously

2015-09-22 Thread Fu, Zhonghui

Hi johannes,

Could you please tell me which kernel version will merge this patch?


Thanks,
Zhonghui

 
On 2015/9/22 22:05, Johannes Berg wrote:
> On Sat, 2015-09-19 at 10:40 +0800, Fu, Zhonghui wrote:
>> Now, PM core supports asynchronous suspend/resume mode for devices
>> during system suspend/resume, and the power state transition of one
>> device may be completed in separate kernel thread. PM core ensures
>> all power state transition timing dependency between devices. This
>> patch enables wiphy device to suspend/resume asynchronously. This can
>> take advantage of multicore and improve system suspend/resume speed.
>>
> Applied.
>
> johannes
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui


On 2015/8/24 23:14, Fu, Zhonghui wrote:
>
> On 2015/8/17 14:51, Adrian Hunter wrote:
>> On 17/08/15 06:38, Fu, Zhonghui wrote:
>>> Hi,
>>>
>>> Any comments are welcome.
>> Same comments as here:
>>
>>  http://marc.info/?l=linux-kernel=143979428424353=2
> Now, PM core support asynchronous device suspend/resume mode. If one device 
> has been set to support asynchronous PM mode, it's suspend/resume operation 
> can be performed in a separate kernel thread and take advantage of multicore 
> feature to improve overall system suspend/resume speed. The worst case is 
> that all device suspend/resume threads will be scheduled to the same CPU, it 
> hardly occur.
>
> PM core ensure all the suspend/resume dependency related to one device. 
> Actually, async suspend/resume mode is one feature of PM core, every device 
> subsystem may use it or not use it. Once one device subsystem choose to use 
> this feature, its safety is up to PM core as long as device subsystem has 
> initialized fully this device.

The original suspend time is 1645ms and resume time is 940ms on ASUS T100TA 
machine. After enabling "wiphy device", "SDIO device", "mmc host" and 
"sdhci-acpi device" to suspend/resume asynchronously, the suspend time is 
1096ms and resume time is 908ms. The test environment is listed as follows:

OS: Ubuntu 14.04
Kernel: mainline v4.1
Machine: ASUS T100TA(Baytrail-T platform)
Tool: analyze_suspend
“analyze_suspend.py –f –m freeze” to suspend system
Press power button to resume system

I have resent this patch with updated commit message - "[PATCH v2] 
mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously".


Thanks,
Zhonghui


>
>
> Thanks,
> Zhonghui
>
>
>>> Thanks,
>>> Zhonghui
>>>
>>> On 2015/8/3 21:10, Fu, Zhonghui wrote:
>>>> Enable sdhci-acpi device to suspend/resume asynchronously.
>>>> This can improve system suspend/resume speed.
>>>>
>>>> Signed-off-by: Zhonghui Fu 
>>>> ---
>>>>  drivers/mmc/host/sdhci-acpi.c |2 ++
>>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
>>>> index 22d929f..67e6263 100644
>>>> --- a/drivers/mmc/host/sdhci-acpi.c
>>>> +++ b/drivers/mmc/host/sdhci-acpi.c
>>>> @@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct platform_device 
>>>> *pdev)
>>>>pm_runtime_enable(dev);
>>>>}
>>>>  
>>>> +  device_enable_async_suspend(dev);
>>>> +
>>>>return 0;
>>>>  
>>>>  err_free:
>>>> -- 1.7.1
>>>>
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables sdhci-acpi device to suspend/resume asynchronously.
This will take advantage of multicore and improve system
suspend/resume speed.

Signed-off-by: Zhonghui Fu 
---
Changes in v2:
- Amend commit message.

 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 22d929f..67e6263 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mmc: enable mmc host device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui


On 2015/8/27 21:05, Ulf Hansson wrote:
> On 3 August 2015 at 14:39, Fu, Zhonghui  wrote:
>> Enable mmc host device to suspend/resume asynchronously.
>> This can improve system suspend/resume speed.
> Can or will?
>
> It would be nice to see some statistics of this to justify the change.
> Can you share that?
>
> Moreover we already have the runtime PM support, which enables the
> reinitialization sequence of the mmc/sd card to be postponed from the
> system PM resume path. Instead that's done when the next
> pm_runtime_get_sync() for the card's device gets called. You my tried
> that feature by enabling MMC_CAP_RUNTIME_RESUME for the mmc hosts.
This "will" improve system suspend/resume speed. I have resent this patch with 
updated commit message - "[PATCH v2] mmc: enable mmc host device to 
suspend/resume asynchronously".

The original suspend time is 1645ms and resume time is 940ms on ASUS T100TA 
machine. After enabling "wiphy device", "SDIO device", "mmc host" and 
"sdhci-acpi device" to suspend/resume asynchronously, the suspend time is 
1096ms and resume time is 908ms. The test environment is listed as follows:

OS: Ubuntu 14.04
Kernel: mainline v4.1
Machine: ASUS T100TA(Baytrail-T platform)
Tool: analyze_suspend
“analyze_suspend.py –f –m freeze” to suspend system
Press power button to resume system

System PM is independent from runtime PM. Now, PM core supports asynchronous 
suspend/resume mode for devices during system suspend/resume, and the power 
state transition of one
device may be completed in separate kernel thread. PM core ensures all power 
state transition timing dependency between devices. This patch enables mmc host 
device to suspend/resume asynchronously. This will take advantage of multicore 
and improve system suspend/resume speed.


Thanks,
Zhonghui
> Kind regards
> Uffe
>
>> Signed-off-by: Zhonghui Fu 
>> ---
>>  drivers/mmc/core/host.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index 99a9c90..85f2bbb 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -577,6 +577,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
>> *dev)
>> host->class_dev.parent = dev;
>> host->class_dev.class = _host_class;
>> device_initialize(>class_dev);
>> +   device_enable_async_suspend(>class_dev);
>>
>> if (mmc_gpio_alloc(host)) {
>> put_device(>class_dev);
>> -- 1.7.1
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] mmc: enable mmc host device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables mmc host device to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu 
---
Changes in v2:
- Amend commit message.

 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index abd933b..8dfc011 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -577,6 +577,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] mmc: enable mmc host device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables mmc host device to suspend/resume asynchronously. This
will take advantage of multicore and improve system suspend/resume
speed.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v2:
- Amend commit message.

 drivers/mmc/core/host.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index abd933b..8dfc011 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -577,6 +577,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
*dev)
host->class_dev.parent = dev;
host->class_dev.class = _host_class;
device_initialize(>class_dev);
+   device_enable_async_suspend(>class_dev);
 
if (mmc_gpio_alloc(host)) {
put_device(>class_dev);
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mmc: enable mmc host device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui


On 2015/8/27 21:05, Ulf Hansson wrote:
> On 3 August 2015 at 14:39, Fu, Zhonghui <zhonghui...@linux.intel.com> wrote:
>> Enable mmc host device to suspend/resume asynchronously.
>> This can improve system suspend/resume speed.
> Can or will?
>
> It would be nice to see some statistics of this to justify the change.
> Can you share that?
>
> Moreover we already have the runtime PM support, which enables the
> reinitialization sequence of the mmc/sd card to be postponed from the
> system PM resume path. Instead that's done when the next
> pm_runtime_get_sync() for the card's device gets called. You my tried
> that feature by enabling MMC_CAP_RUNTIME_RESUME for the mmc hosts.
This "will" improve system suspend/resume speed. I have resent this patch with 
updated commit message - "[PATCH v2] mmc: enable mmc host device to 
suspend/resume asynchronously".

The original suspend time is 1645ms and resume time is 940ms on ASUS T100TA 
machine. After enabling "wiphy device", "SDIO device", "mmc host" and 
"sdhci-acpi device" to suspend/resume asynchronously, the suspend time is 
1096ms and resume time is 908ms. The test environment is listed as follows:

OS: Ubuntu 14.04
Kernel: mainline v4.1
Machine: ASUS T100TA(Baytrail-T platform)
Tool: analyze_suspend
“analyze_suspend.py –f –m freeze” to suspend system
Press power button to resume system

System PM is independent from runtime PM. Now, PM core supports asynchronous 
suspend/resume mode for devices during system suspend/resume, and the power 
state transition of one
device may be completed in separate kernel thread. PM core ensures all power 
state transition timing dependency between devices. This patch enables mmc host 
device to suspend/resume asynchronously. This will take advantage of multicore 
and improve system suspend/resume speed.


Thanks,
Zhonghui
> Kind regards
> Uffe
>
>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>> ---
>>  drivers/mmc/core/host.c |1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
>> index 99a9c90..85f2bbb 100644
>> --- a/drivers/mmc/core/host.c
>> +++ b/drivers/mmc/core/host.c
>> @@ -577,6 +577,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device 
>> *dev)
>> host->class_dev.parent = dev;
>> host->class_dev.class = _host_class;
>> device_initialize(>class_dev);
>> +   device_enable_async_suspend(>class_dev);
>>
>> if (mmc_gpio_alloc(host)) {
>> put_device(>class_dev);
>> -- 1.7.1
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui
Now, PM core supports asynchronous suspend/resume mode for devices
during system suspend/resume, and the power state transition of one
device may be completed in separate kernel thread. PM core ensures
all power state transition timing dependency between devices. This
patch enables sdhci-acpi device to suspend/resume asynchronously.
This will take advantage of multicore and improve system
suspend/resume speed.

Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
---
Changes in v2:
- Amend commit message.

 drivers/mmc/host/sdhci-acpi.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 22d929f..67e6263 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
}
 
+   device_enable_async_suspend(dev);
+
return 0;
 
 err_free:
-- 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously

2015-09-21 Thread Fu, Zhonghui


On 2015/8/24 23:14, Fu, Zhonghui wrote:
>
> On 2015/8/17 14:51, Adrian Hunter wrote:
>> On 17/08/15 06:38, Fu, Zhonghui wrote:
>>> Hi,
>>>
>>> Any comments are welcome.
>> Same comments as here:
>>
>>  http://marc.info/?l=linux-kernel=143979428424353=2
> Now, PM core support asynchronous device suspend/resume mode. If one device 
> has been set to support asynchronous PM mode, it's suspend/resume operation 
> can be performed in a separate kernel thread and take advantage of multicore 
> feature to improve overall system suspend/resume speed. The worst case is 
> that all device suspend/resume threads will be scheduled to the same CPU, it 
> hardly occur.
>
> PM core ensure all the suspend/resume dependency related to one device. 
> Actually, async suspend/resume mode is one feature of PM core, every device 
> subsystem may use it or not use it. Once one device subsystem choose to use 
> this feature, its safety is up to PM core as long as device subsystem has 
> initialized fully this device.

The original suspend time is 1645ms and resume time is 940ms on ASUS T100TA 
machine. After enabling "wiphy device", "SDIO device", "mmc host" and 
"sdhci-acpi device" to suspend/resume asynchronously, the suspend time is 
1096ms and resume time is 908ms. The test environment is listed as follows:

OS: Ubuntu 14.04
Kernel: mainline v4.1
Machine: ASUS T100TA(Baytrail-T platform)
Tool: analyze_suspend
“analyze_suspend.py –f –m freeze” to suspend system
Press power button to resume system

I have resent this patch with updated commit message - "[PATCH v2] 
mmc/sdhci-acpi: enable sdhci-acpi device to suspend/resume asynchronously".


Thanks,
Zhonghui


>
>
> Thanks,
> Zhonghui
>
>
>>> Thanks,
>>> Zhonghui
>>>
>>> On 2015/8/3 21:10, Fu, Zhonghui wrote:
>>>> Enable sdhci-acpi device to suspend/resume asynchronously.
>>>> This can improve system suspend/resume speed.
>>>>
>>>> Signed-off-by: Zhonghui Fu <zhonghui...@linux.intel.com>
>>>> ---
>>>>  drivers/mmc/host/sdhci-acpi.c |2 ++
>>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
>>>> index 22d929f..67e6263 100644
>>>> --- a/drivers/mmc/host/sdhci-acpi.c
>>>> +++ b/drivers/mmc/host/sdhci-acpi.c
>>>> @@ -379,6 +379,8 @@ static int sdhci_acpi_probe(struct platform_device 
>>>> *pdev)
>>>>pm_runtime_enable(dev);
>>>>}
>>>>  
>>>> +  device_enable_async_suspend(dev);
>>>> +
>>>>return 0;
>>>>  
>>>>  err_free:
>>>> -- 1.7.1
>>>>
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   >