Netdev List
 help / color / mirror / Atom feed
* [PATCH] can: m_can: remove redundant check for pm_clock_support
@ 2024-01-04 23:57 Francesco Dolcini
  2024-01-15  9:52 ` Markus Schneider-Pargmann
  2024-02-16  7:45 ` Francesco Dolcini
  0 siblings, 2 replies; 4+ messages in thread
From: Francesco Dolcini @ 2024-01-04 23:57 UTC (permalink / raw)
  To: Chandrasekar Ramakrishnan, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Francesco Dolcini, linux-can, netdev, linux-kernel

From: Francesco Dolcini <francesco.dolcini@toradex.com>

m_can_clk_start() already skip starting the clock when
clock support is disabled, remove the redundant check in
m_can_class_register().

This also solves the imbalance with m_can_clk_stop() that is called
afterward in the same function before the return.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
I spotted the issue while debugging some other part of the code,
the patch is only compile-tested.
---
 drivers/net/can/m_can/m_can.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 16ecc11c7f62..bd1d1626684d 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -2056,11 +2056,9 @@ int m_can_class_register(struct m_can_classdev *cdev)
 {
 	int ret;
 
-	if (cdev->pm_clock_support) {
-		ret = m_can_clk_start(cdev);
-		if (ret)
-			return ret;
-	}
+	ret = m_can_clk_start(cdev);
+	if (ret)
+		return ret;
 
 	if (cdev->is_peripheral) {
 		ret = can_rx_offload_add_manual(cdev->net, &cdev->offload,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: m_can: remove redundant check for pm_clock_support
  2024-01-04 23:57 [PATCH] can: m_can: remove redundant check for pm_clock_support Francesco Dolcini
@ 2024-01-15  9:52 ` Markus Schneider-Pargmann
  2024-02-16  7:45 ` Francesco Dolcini
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Schneider-Pargmann @ 2024-01-15  9:52 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Chandrasekar Ramakrishnan, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Francesco Dolcini, linux-can, netdev, linux-kernel

On Fri, Jan 05, 2024 at 12:57:23AM +0100, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> m_can_clk_start() already skip starting the clock when
> clock support is disabled, remove the redundant check in
> m_can_class_register().
> 
> This also solves the imbalance with m_can_clk_stop() that is called
> afterward in the same function before the return.
> 
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>

Best,
Markus

> ---
> I spotted the issue while debugging some other part of the code,
> the patch is only compile-tested.
> ---
>  drivers/net/can/m_can/m_can.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 16ecc11c7f62..bd1d1626684d 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -2056,11 +2056,9 @@ int m_can_class_register(struct m_can_classdev *cdev)
>  {
>  	int ret;
>  
> -	if (cdev->pm_clock_support) {
> -		ret = m_can_clk_start(cdev);
> -		if (ret)
> -			return ret;
> -	}
> +	ret = m_can_clk_start(cdev);
> +	if (ret)
> +		return ret;
>  
>  	if (cdev->is_peripheral) {
>  		ret = can_rx_offload_add_manual(cdev->net, &cdev->offload,
> -- 
> 2.39.2
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: m_can: remove redundant check for pm_clock_support
  2024-01-04 23:57 [PATCH] can: m_can: remove redundant check for pm_clock_support Francesco Dolcini
  2024-01-15  9:52 ` Markus Schneider-Pargmann
@ 2024-02-16  7:45 ` Francesco Dolcini
  2024-02-16  7:56   ` Marc Kleine-Budde
  1 sibling, 1 reply; 4+ messages in thread
From: Francesco Dolcini @ 2024-02-16  7:45 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol
  Cc: Chandrasekar Ramakrishnan, Wolfgang Grandegger, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Francesco Dolcini,
	linux-can, netdev, linux-kernel

Hello Marc and Vincent,

On Fri, Jan 05, 2024 at 12:57:23AM +0100, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> m_can_clk_start() already skip starting the clock when
> clock support is disabled, remove the redundant check in
> m_can_class_register().
> 
> This also solves the imbalance with m_can_clk_stop() that is called
> afterward in the same function before the return.
> 
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Did you missed this? Or do you have some concern with it?

Francesco



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] can: m_can: remove redundant check for pm_clock_support
  2024-02-16  7:45 ` Francesco Dolcini
@ 2024-02-16  7:56   ` Marc Kleine-Budde
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2024-02-16  7:56 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: Vincent Mailhol, Chandrasekar Ramakrishnan, Wolfgang Grandegger,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Francesco Dolcini, linux-can, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

On 16.02.2024 08:45:27, Francesco Dolcini wrote:
> Hello Marc and Vincent,
> 
> On Fri, Jan 05, 2024 at 12:57:23AM +0100, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > 
> > m_can_clk_start() already skip starting the clock when
> > clock support is disabled, remove the redundant check in
> > m_can_class_register().
> > 
> > This also solves the imbalance with m_can_clk_stop() that is called
> > afterward in the same function before the return.
> > 
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> Did you missed this? Or do you have some concern with it?

Somehow missed it in the last PR, but already part of the next PR.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-16  7:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04 23:57 [PATCH] can: m_can: remove redundant check for pm_clock_support Francesco Dolcini
2024-01-15  9:52 ` Markus Schneider-Pargmann
2024-02-16  7:45 ` Francesco Dolcini
2024-02-16  7:56   ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox