RE: [PATCH] can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> Sent: 2020年11月18日 23:02
> To: linux-can@xxxxxxxxxxxxxxx
> Cc: Joakim Zhang <qiangqing.zhang@xxxxxxx>; kernel@xxxxxxxxxxxxxx; Marc
> Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxxx>
Reviewed-by: Joakim Zhang <qiangqing.zhang@xxxxxxx>

Best Regards,
Joakim Zhang




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux