All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joakim Zhang <qiangqing.zhang@nxp.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>
Subject: RE: [PATCH] can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery
Date: Thu, 19 Nov 2020 00:59:15 +0000	[thread overview]
Message-ID: <DB8PR04MB6795CE8D32EB70C084AC07C7E6E00@DB8PR04MB6795.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20201118150148.2664024-1-mkl@pengutronix.de>


> -----Original Message-----
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Sent: 2020年11月18日 23:02
> To: linux-can@vger.kernel.org
> Cc: Joakim Zhang <qiangqing.zhang@nxp.com>; kernel@pengutronix.de; Marc
> Kleine-Budde <mkl@pengutronix.de>
> Subject: [PATCH] can: flexcan: flexcan_chip_start(): fix erroneous
> flexcan_transceiver_enable() during bus-off recovery
> 
> If the CAN controller goes into bus off, the do_set_mode() callback with
> CAN_MODE_START can be used to recover the controller, which then calls
> flexcan_chip_start(). If configured, this is done automatically by the framework
> or manually by the user.
> 
> In flexcan_chip_start() there is an explicit call to flexcan_transceiver_enable(),
> which does a regulator_enable() on the transceiver regulator. This results in a
> net usage counter increase, as there is no corresponding
> flexcan_transceiver_disable() in the bus off code path.
> This further leads to the transceiver stuck enabled, even if the CAN interface is
> shut down.
> 
> To fix this problem the
> flexcan_transceiver_enable()/flexcan_transceiver_disable() are moved out of
> flexcan_chip_start()/flexcan_chip_stop() into flexcan_open()/flexcan_close().
> 
> Fixes: e955cead0311 ("CAN: Add Flexcan CAN controller driver")
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Reviewed-by: Joakim Zhang <qiangqing.zhang@nxp.com>

Best Regards,
Joakim Zhang

      reply	other threads:[~2020-11-19  0:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 15:01 [PATCH] can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery Marc Kleine-Budde
2020-11-19  0:59 ` Joakim Zhang [this message]

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=DB8PR04MB6795CE8D32EB70C084AC07C7E6E00@DB8PR04MB6795.eurprd04.prod.outlook.com \
    --to=qiangqing.zhang@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.