lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250813-important-wisteria-toucan-35763e-mkl@pengutronix.de>
Date: Wed, 13 Aug 2025 10:34:12 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Philipp Zabel <p.zabel@...gutronix.de>
Cc: Chandrasekar Ramakrishnan <rcsekar@...sung.com>, 
	Vincent Mailhol <mailhol.vincent@...adoo.fr>, Patrik Flykt <patrik.flykt@...ux.intel.com>, 
	Dong Aisheng <b29396@...escale.com>, Fengguang Wu <fengguang.wu@...el.com>, 
	Varka Bhadram <varkabhadram@...il.com>, Wu Bo <wubo.oduw@...il.com>, 
	Markus Schneider-Pargmann <msp@...libre.com>, linux-can@...r.kernel.org, linux-kernel@...r.kernel.org, 
	kernel@...gutronix.de
Subject: Re: [PATCH 7/7] can: m_can: add optional support for reset

On 13.08.2025 10:17:52, Philipp Zabel wrote:
> On Di, 2025-08-12 at 19:36 +0200, Marc Kleine-Budde wrote:
> > In some SoCs (observed on the STM32MP15) the M_CAN IP core keeps the
> > CAN state and CAN error counters over an internal reset cycle. The
> > STM32MP15 SoC provides an external reset, which is shared between both
> > M_CAN cores.
> > 
> > Add support for an optional external reset. Take care of shared
> > resets, de-assert reset during the probe phase in
> > m_can_class_register() and while the interface is up, assert the reset
> > otherwise.
> >
> > Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
> > ---
> >  drivers/net/can/m_can/m_can.c | 26 +++++++++++++++++++++++---
> >  drivers/net/can/m_can/m_can.h |  1 +
> >  2 files changed, 24 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> > index c24ea0e5599f..0a6d4b523c33 100644
> > --- a/drivers/net/can/m_can/m_can.c
> > +++ b/drivers/net/can/m_can/m_can.c
> > @@ -23,6 +23,7 @@
> >  #include <linux/pinctrl/consumer.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/pm_runtime.h>
> > +#include <linux/reset.h>
> >  
> >  #include "m_can.h"
> >  
> > @@ -1833,6 +1834,7 @@ static int m_can_close(struct net_device *dev)
> >  
> >  	close_candev(dev);
> >  
> > +	reset_control_assert(cdev->rsts);
> 
> Nitpick, "rsts" as in plural?

fixed.

> 
> [...]
> > @@ -2462,8 +2478,10 @@ int m_can_class_register(struct m_can_classdev *cdev)
> >  		 KBUILD_MODNAME, cdev->net->irq, cdev->version);
> >  
> >  	/* Probe finished
> > -	 * Stop clocks. They will be reactivated once the M_CAN device is opened
> > +	 * Assert rest and stop clocks.
> 
> Typo, s/rest/reset/.

fixed.

> 
> Otherwise,
> 
> 
> Reviewed-by: Philipp Zabel <p.zabel@...gutronix.de>

Thanks, hmmm, why doesn't b4 pick that up?

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   |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ