From: Frank Li <Frank.li@nxp.com>
To: haibo.chen@nxp.com
Cc: mkl@pengutronix.de, mailhol.vincent@wanadoo.fr,
ciprianmarian.costea@oss.nxp.com, han.xu@nxp.com,
u.kleine-koenig@baylibre.com, linux-can@vger.kernel.org,
linux-kernel@vger.kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v2 2/2] can: flexcan: disable transceiver during system PM
Date: Thu, 6 Mar 2025 10:04:16 -0500 [thread overview]
Message-ID: <Z8m5cCC597WZq8uO@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250306065921.2329517-2-haibo.chen@nxp.com>
On Thu, Mar 06, 2025 at 02:59:21PM +0800, haibo.chen@nxp.com wrote:
> From: Haibo Chen <haibo.chen@nxp.com>
>
> During system PM, if no wakeup requirement, disable transceiver to
> save power.
>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> Changes for V2:
> - add return check for flexcan_transceiver_disable
> - disable transceiver if flexcan_chip_start() failed
> ---
> drivers/net/can/flexcan/flexcan-core.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
> index 8415ef71f1b1..6c59c2cfcf05 100644
> --- a/drivers/net/can/flexcan/flexcan-core.c
> +++ b/drivers/net/can/flexcan/flexcan-core.c
> @@ -2292,6 +2292,9 @@ static int __maybe_unused flexcan_suspend(struct device *device)
> return err;
>
> flexcan_chip_interrupts_disable(dev);
> + err = flexcan_transceiver_disable(priv);
> + if (err)
> + return err;
>
> err = pinctrl_pm_select_sleep_state(device);
> if (err)
> @@ -2324,10 +2327,16 @@ static int __maybe_unused flexcan_resume(struct device *device)
> if (err)
> return err;
>
> - err = flexcan_chip_start(dev);
> + err = flexcan_transceiver_enable(priv);
> if (err)
> return err;
>
> + err = flexcan_chip_start(dev);
> + if (err) {
> + flexcan_transceiver_disable(priv);
> + return err;
> + }
> +
> flexcan_chip_interrupts_enable(dev);
> }
> }
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-03-06 15:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 6:59 [PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE when resume has no issue haibo.chen
2025-03-06 6:59 ` [PATCH v2 2/2] can: flexcan: disable transceiver during system PM haibo.chen
2025-03-06 7:15 ` Vincent Mailhol
2025-03-06 15:04 ` Frank Li [this message]
2025-03-06 7:15 ` [PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE when resume has no issue Vincent Mailhol
2025-03-06 15:03 ` Frank Li
2025-03-14 9:13 ` Marc Kleine-Budde
2025-03-14 9:42 ` Marc Kleine-Budde
2025-03-14 9:48 ` Bough Chen
2025-03-14 9:53 ` Marc Kleine-Budde
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=Z8m5cCC597WZq8uO@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=haibo.chen@nxp.com \
--cc=han.xu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mkl@pengutronix.de \
--cc=u.kleine-koenig@baylibre.com \
/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®