Re: [PATCH] watchdog: qcom: Add suspend/resume support

2019-01-17 Thread Sai Prakash Ranjan
Hi Guenter, On 1/17/2019 8:00 PM, Guenter Roeck wrote: I personally very much prefer __maybe_unused over #ifdef, for the reasons stated above. Other maintainers may think differently. Thanks for making your preference clear. I will post the second version soon with the changes. - Sai --

Re: [PATCH] watchdog: qcom: Add suspend/resume support

2019-01-17 Thread Guenter Roeck
On Thu, Jan 17, 2019 at 06:30:41PM +0530, Sai Prakash Ranjan wrote: > On 1/17/2019 4:57 PM, Brian Masney wrote: > > > >That attribute suppresses a warning from the compiler if the function is > >unused when PM_SLEEP is disabled. I don't consider it hackish since the > >function name no longer

Re: [PATCH] watchdog: qcom: Add suspend/resume support

2019-01-17 Thread Sai Prakash Ranjan
On 1/17/2019 4:57 PM, Brian Masney wrote: That attribute suppresses a warning from the compiler if the function is unused when PM_SLEEP is disabled. I don't consider it hackish since the function name no longer appears outside the #ifdef. For example: #ifdef CONFIG_PM_SLEEP

Re: [PATCH] watchdog: qcom: Add suspend/resume support

2019-01-17 Thread Brian Masney
On Thu, Jan 17, 2019 at 04:08:52PM +0530, Sai Prakash Ranjan wrote: > On 1/17/2019 3:01 PM, Brian Masney wrote: > > > > You can use the __maybe_unused attribute to remove the #ifdef: > > > > static int __maybe_unused qcom_wdt_suspend(struct device *dev) > > > > Thanks for looking into this. >

Re: [PATCH] watchdog: qcom: Add suspend/resume support

2019-01-17 Thread Sai Prakash Ranjan
Hi Brian, On 1/17/2019 3:01 PM, Brian Masney wrote: You can use the __maybe_unused attribute to remove the #ifdef: static int __maybe_unused qcom_wdt_suspend(struct device *dev) Thanks for looking into this. As for __maybe_unused, I think it's better to keep #ifdef rather than this

Re: [PATCH] watchdog: qcom: Add suspend/resume support

2019-01-17 Thread Brian Masney
On Thu, Jan 17, 2019 at 02:45:55PM +0530, Sai Prakash Ranjan wrote: > +#ifdef CONFIG_PM_SLEEP > +static int qcom_wdt_suspend(struct device *dev) > +{ > + struct qcom_wdt *wdt = dev_get_drvdata(dev); > + > + if (watchdog_active(>wdd)) > + qcom_wdt_stop(>wdd); > + > + return

[PATCH] watchdog: qcom: Add suspend/resume support

2019-01-17 Thread Sai Prakash Ranjan
This adds the support for qcom watchdog suspend and resume when entering and exiting deep sleep states. Otherwise having watchdog active after suspend would result in unwanted crashes/resets if resume happens after a long time. Signed-off-by: Sai Prakash Ranjan --- drivers/watchdog/qcom-wdt.c |