lkml.org 
[lkml]   [2020]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: [PATCH] can: flexcan: Fix runtime PM imbalance on error
Date

> -----Original Message-----
> From: linux-can-owner@vger.kernel.org <linux-can-owner@vger.kernel.org>
> On Behalf Of Dinghao Liu
> Sent: 2020年5月22日 17:44
> To: dinghao.liu@zju.edu.cn; kjlu@umn.edu
> Cc: Wolfgang Grandegger <wg@grandegger.com>; Marc Kleine-Budde
> <mkl@pengutronix.de>; David S. Miller <davem@davemloft.net>; Jakub
> Kicinski <kuba@kernel.org>; linux-can@vger.kernel.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] can: flexcan: Fix runtime PM imbalance on error
>
> When register_flexcandev() returns an error code, a pairing runtime PM
> usage counter decrement is needed to keep the counter balanced.
>
> Also, call pm_runtime_disable() when register_flexcandev() returns an error
> code.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

A patch has already been sent out to fix this issue:
https://www.spinics.net/lists/linux-can/msg03052.html

Reviewed-by: Joakim Zhang <qiangqing.zhang@nxp.com>

Best Regards,
Joakim Zhang
> ---
> drivers/net/can/flexcan.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index
> 94d10ec954a0..ea193426e5ae 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -1666,6 +1666,8 @@ static int flexcan_probe(struct platform_device
> *pdev)
> return 0;
>
> failed_register:
> + pm_runtime_put_noidle(&pdev->dev);
> + pm_runtime_disable(&pdev->dev);
> free_candev(dev);
> return err;
> }
> --
> 2.17.1

\
 
 \ /
  Last update: 2020-05-25 03:36    [W:0.044 / U:10.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site