From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Yen-Chi Huang <jesse.huang@portwell.com.tw>
Cc: Hans de Goede <hdegoede@redhat.com>,
jdelvare@suse.com, linux@roeck-us.net, wim@linux-watchdog.org,
LKML <linux-kernel@vger.kernel.org>,
platform-driver-x86@vger.kernel.org,
linux-hwmon@vger.kernel.org, linux-watchdog@vger.kernel.org,
jay.chen@canonical.com
Subject: Re: [PATCH v3 1/2] platform/x86: portwell-ec: Add suspend/resume support for watchdog
Date: Tue, 19 Aug 2025 12:51:39 +0300 (EEST) [thread overview]
Message-ID: <6584da3e-fc86-7a47-f783-da77049b2215@linux.intel.com> (raw)
In-Reply-To: <e11e542b-b630-4f18-8a60-a36fe31c0133@portwell.com.tw>
On Mon, 28 Jul 2025, Yen-Chi Huang wrote:
> Portwell EC does not disable the watchdog during suspend. To avoid unwanted
> resets, this patch adds suspend and resume callbacks (pwec_suspend() and
> pwec_resume()) to the driver.
>
> The watchdog is stopped in pwec_suspend() and restarted in pwec_resume() if
> it was active before suspend.
>
> Signed-off-by: Yen-Chi Huang <jesse.huang@portwell.com.tw>
> ---
> drivers/platform/x86/portwell-ec.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/platform/x86/portwell-ec.c b/drivers/platform/x86/portwell-ec.c
> index 3e019c51913e..7f473e3032e2 100644
> --- a/drivers/platform/x86/portwell-ec.c
> +++ b/drivers/platform/x86/portwell-ec.c
> @@ -246,11 +246,29 @@ static int pwec_probe(struct platform_device *pdev)
> return 0;
> }
>
> +static int pwec_suspend(struct platform_device *pdev, pm_message_t message)
> +{
> + if (watchdog_active(&ec_wdt_dev))
> + return pwec_wdt_stop(&ec_wdt_dev);
> +
> + return 0;
> +}
> +
> +static int pwec_resume(struct platform_device *pdev)
> +{
> + if (watchdog_active(&ec_wdt_dev))
> + return pwec_wdt_start(&ec_wdt_dev);
> +
> + return 0;
> +}
> +
> static struct platform_driver pwec_driver = {
> .driver = {
> .name = "portwell-ec",
> },
> .probe = pwec_probe,
> + .suspend = pm_ptr(pwec_suspend),
> + .resume = pm_ptr(pwec_resume),
These are legacy handlers, please use .pm under .driver and the macros to
create the struct dev_pm_ops.
--
i.
next prev parent reply other threads:[~2025-08-19 9:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 11:56 [PATCH v3 0/2] platform/x86: portwell-ec: Add watchdog suspend/resume and hwmon Yen-Chi Huang
2025-07-28 11:58 ` [PATCH v3 1/2] platform/x86: portwell-ec: Add suspend/resume support for watchdog Yen-Chi Huang
2025-08-19 9:51 ` Ilpo Järvinen [this message]
2025-08-26 9:43 ` Yen-Chi Huang
2025-07-28 12:01 ` [PATCH v3 2/2] platform/x86: portwell-ec: Add hwmon support for voltage and temperature Yen-Chi Huang
2025-08-07 9:45 ` [PATCH v3 0/2] platform/x86: portwell-ec: Add watchdog suspend/resume and hwmon Yen-Chi Huang
2025-08-26 9:58 ` Yen-Chi Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6584da3e-fc86-7a47-f783-da77049b2215@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=jay.chen@canonical.com \
--cc=jdelvare@suse.com \
--cc=jesse.huang@portwell.com.tw \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=platform-driver-x86@vger.kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®