Re: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to support hibernation

2018-06-13 Thread Jiri Kosina
On Fri, 12 Feb 2016, Even Xu wrote:

> Current ISH driver only registers suspend/resume PM callbacks which don't
> support hibernation (suspend to disk). Basically after hiberation, the ISH
> can't resume properly and user may not see sensor events
> (for example: screen rotation may not work).
> 
> User will not see a crash or panic or anything except the following message
> in log:
> hid-sensor-hub 001F:8086:22D8.0001: timeout waiting for response from ISHTP 
> device
> 
> So this patch adds support for S4/hiberbation to ISH by using the
> SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly. The suspend
> and resume functions will now be used for both suspend to RAM and hibernation.
> 
> If power management is disabled, SIMPLE_DEV_PM_OPS will do nothing, the 
> suspend
> and resume related functions won't be used, so mark them as __maybe_unused to
> clarify that this is the intended behavior, and remove #ifdefs for power
> management.
> 
> Cc: sta...@vger.kernel.org
> Signed-off-by: Even Xu 
> Acked-by: Srinivas Pandruvada 

Applied to hid.git#for-4.18/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs



Re: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to support hibernation

2018-06-12 Thread Srinivas Pandruvada
On Wed, 2018-06-13 at 00:05 +, Xu, Even wrote:
> Ok, sure, I will update patch comments and resubmit.
Can you also add in the sign-off area


Cc: sta...@vger.kernel.org

Thanks,
Srinivas

> Thanks Srinivas!
> 
> Best Regards,
> Even Xu
> 
> 
> 
> -Original Message-
> From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com
> ] 
> Sent: Tuesday, June 12, 2018 11:31 PM
> To: Jiri Kosina ; Xu, Even 
> Cc: benjamin.tissoi...@redhat.com; linux-in...@vger.kernel.org; linux
> -ker...@vger.kernel.org; Xu, Even 
> Subject: Re: [PATCH] hid: intel_ish-hid: ipc: register more pm
> callbacks to support hibernation
> 
> On Tue, 2018-06-12 at 16:53 +0200, Jiri Kosina wrote:
> > On Sun, 10 Jun 2018, Srinivas Pandruvada wrote:
> > 
> > > From: Even Xu 
> > > 
> > > Current ish driver only register resume/suspend PM callbacks
> > > which 
> > > don't support hibernation (suspend to disk). Now use the
> > > SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly.
> > > The suspend and resume functions will now be used for both
> > > suspend 
> > > to RAM and hibernation.
> > > 
> > > If power management is disable, SIMPLE_DEV_PM_OPS will do
> > > nothing, 
> > > the suspend and resume related functions won't be used, so mark
> > > them 
> > > as __maybe_unused to clarify that this is intended behavior, and 
> > > remove #ifdefs for power management.
> > 
> > This describes details the patch does on code level, but what are
> > the 
> > user observable effects? Hibernation resume doesn't fail any more?
> > Hibernation
> > is possible (and wasn't before)? Did kernel crash while trying to 
> > hibernate and this is the fix? Or ... ?
> 
> Even,
> Can you add more details and resubmit ASAP?
> 
> Basically after hiberation, the ISH can't resume properly and user
> may not see sensor events (for example: screen rotation may not
> work).
> User will not see a crash or panic or anything except the following
> message in log:
> hid-sensor-hub 001F:8086:22D8.0001: timeout waiting for response from
> ISHTP device 
> 
> So this is adding support for S4/hiberbation to ISH.
> 
> 
> 
> Thanks,
> Srinivas
> 
> > 
> > Thanks,
> > 


RE: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to support hibernation

2018-06-12 Thread Xu, Even
Ok, sure, I will update patch comments and resubmit.
Thanks Srinivas!

Best Regards,
Even Xu



-Original Message-
From: Srinivas Pandruvada [mailto:srinivas.pandruv...@linux.intel.com] 
Sent: Tuesday, June 12, 2018 11:31 PM
To: Jiri Kosina ; Xu, Even 
Cc: benjamin.tissoi...@redhat.com; linux-in...@vger.kernel.org; 
linux-kernel@vger.kernel.org; Xu, Even 
Subject: Re: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to 
support hibernation

On Tue, 2018-06-12 at 16:53 +0200, Jiri Kosina wrote:
> On Sun, 10 Jun 2018, Srinivas Pandruvada wrote:
> 
> > From: Even Xu 
> > 
> > Current ish driver only register resume/suspend PM callbacks which 
> > don't support hibernation (suspend to disk). Now use the
> > SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly.
> > The suspend and resume functions will now be used for both suspend 
> > to RAM and hibernation.
> > 
> > If power management is disable, SIMPLE_DEV_PM_OPS will do nothing, 
> > the suspend and resume related functions won't be used, so mark them 
> > as __maybe_unused to clarify that this is intended behavior, and 
> > remove #ifdefs for power management.
> 
> This describes details the patch does on code level, but what are the 
> user observable effects? Hibernation resume doesn't fail any more?
> Hibernation
> is possible (and wasn't before)? Did kernel crash while trying to 
> hibernate and this is the fix? Or ... ?
Even,
Can you add more details and resubmit ASAP?

Basically after hiberation, the ISH can't resume properly and user may not see 
sensor events (for example: screen rotation may not work).
User will not see a crash or panic or anything except the following message in 
log:
hid-sensor-hub 001F:8086:22D8.0001: timeout waiting for response from ISHTP 
device 

So this is adding support for S4/hiberbation to ISH.



Thanks,
Srinivas

> 
> Thanks,
> 


RE: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to support hibernation

2018-06-12 Thread Xu, Even
Hi, Jiri Kosina,

If without this patch, the platform with ISH, its hibernation resume will take 
more than 10s because of ISH resume failure, it will also cause ISH not 
functional.
With this patch, everything will go will.

Best Regards,
Even Xu


-Original Message-
From: Jiri Kosina [mailto:ji...@kernel.org] 
Sent: Tuesday, June 12, 2018 10:53 PM
To: Srinivas Pandruvada 
Cc: benjamin.tissoi...@redhat.com; linux-in...@vger.kernel.org; 
linux-kernel@vger.kernel.org; Xu, Even 
Subject: Re: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to 
support hibernation

On Sun, 10 Jun 2018, Srinivas Pandruvada wrote:

> From: Even Xu 
> 
> Current ish driver only register resume/suspend PM callbacks which 
> don't support hibernation (suspend to disk). Now use the
> SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly.
> The suspend and resume functions will now be used for both suspend to 
> RAM and hibernation.
> 
> If power management is disable, SIMPLE_DEV_PM_OPS will do nothing, the 
> suspend and resume related functions won't be used, so mark them as 
> __maybe_unused to clarify that this is intended behavior, and remove 
> #ifdefs for power management.

This describes details the patch does on code level, but what are the user 
observable effects? Hibernation resume doesn't fail any more? Hibernation is 
possible (and wasn't before)? Did kernel crash while trying to hibernate and 
this is the fix? Or ... ?

Thanks,

--
Jiri Kosina
SUSE Labs



Re: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to support hibernation

2018-06-12 Thread Srinivas Pandruvada
On Tue, 2018-06-12 at 16:53 +0200, Jiri Kosina wrote:
> On Sun, 10 Jun 2018, Srinivas Pandruvada wrote:
> 
> > From: Even Xu 
> > 
> > Current ish driver only register resume/suspend PM callbacks which
> > don't support hibernation (suspend to disk). Now use the
> > SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly.
> > The suspend and resume functions will now be used for both suspend
> > to RAM and hibernation.
> > 
> > If power management is disable, SIMPLE_DEV_PM_OPS will do nothing,
> > the suspend and resume related functions won't be used, so mark
> > them
> > as __maybe_unused to clarify that this is intended behavior, and
> > remove #ifdefs for power management.
> 
> This describes details the patch does on code level, but what are the
> user 
> observable effects? Hibernation resume doesn't fail any more?
> Hibernation 
> is possible (and wasn't before)? Did kernel crash while trying to 
> hibernate and this is the fix? Or ... ?
Even,
Can you add more details and resubmit ASAP?

Basically after hiberation, the ISH can't resume properly and user may
not see sensor events (for example: screen rotation may not work).
User will not see a crash or panic or anything except the following
message in log:
hid-sensor-hub 001F:8086:22D8.0001: timeout waiting for response from 
ISHTP device 

So this is adding support for S4/hiberbation to ISH.



Thanks,
Srinivas

> 
> Thanks,
> 


Re: [PATCH] hid: intel_ish-hid: ipc: register more pm callbacks to support hibernation

2018-06-12 Thread Jiri Kosina
On Sun, 10 Jun 2018, Srinivas Pandruvada wrote:

> From: Even Xu 
> 
> Current ish driver only register resume/suspend PM callbacks which
> don't support hibernation (suspend to disk). Now use the
> SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly.
> The suspend and resume functions will now be used for both suspend
> to RAM and hibernation.
> 
> If power management is disable, SIMPLE_DEV_PM_OPS will do nothing,
> the suspend and resume related functions won't be used, so mark them
> as __maybe_unused to clarify that this is intended behavior, and
> remove #ifdefs for power management.

This describes details the patch does on code level, but what are the user 
observable effects? Hibernation resume doesn't fail any more? Hibernation 
is possible (and wasn't before)? Did kernel crash while trying to 
hibernate and this is the fix? Or ... ?

Thanks,

-- 
Jiri Kosina
SUSE Labs