[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240528-beautiful-teal-of-attack-a6d106-mkl@pengutronix.de>
Date: Tue, 28 May 2024 15:43:37 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Markus Schneider-Pargmann <msp@...libre.com>
Cc: Martin Hundebøll <martin@...nix.com>,
Chandrasekar Ramakrishnan <rcsekar@...sung.com>, Vincent Mailhol <mailhol.vincent@...adoo.fr>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, linux-can@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] can: m_can: don't enable transceiver when probing
On 07.05.2024 14:29:57, Markus Schneider-Pargmann wrote:
> Hi Martin,
>
> On Wed, May 01, 2024 at 02:42:03PM +0200, Martin Hundebøll wrote:
> > The m_can driver sets and clears the CCCR.INIT bit during probe (both
> > when testing the NON-ISO bit, and when configuring the chip). After
> > clearing the CCCR.INIT bit, the transceiver enters normal mode, where it
> > affects the CAN bus (i.e. it ACKs frames). This can cause troubles when
> > the m_can node is only used for monitoring the bus, as one cannot setup
> > listen-only mode before the device is probed.
> >
> > Rework the probe flow, so that the CCCR.INIT bit is only cleared when
> > upping the device. First, the tcan4x5x driver is changed to stay in
> > standby mode during/after probe. This in turn requires changes when
> > setting bits in the CCCR register, as its CSR and CSA bits are always
> > high in standby mode.
> >
> > Signed-off-by: Martin Hundebøll <martin@...nix.com>
> > ---
> >
> > Changes since v1:
> > * Implement Markus review comments:
> > - Rename m_can_cccr_wait_bits() to m_can_cccr_update_bits()
> > - Explicitly set CCCR_INIT bit in m_can_dev_setup()
> > - Revert to 5 timeouts/tries to 10
> > - Use m_can_config_{en|dis}able() in m_can_niso_supported()
> > - Revert move of call to m_can_enable_all_interrupts()
> > - Return -EBUSY on failure to enter normal mode
> > - Use tcan4x5x_clear_interrupts() in tcan4x5x_can_probe()
>
> Thanks for addressing these.
>
> In general this looks good:
> Reviewed-by: Markus Schneider-Pargmann <msp@...libre.com>
>
> A few small things commented below, mostly nit-picks.
> @Marc: Up to you if you want to merge it or not. I hope the review was
> early enough for your PR :)
> I don't have time to test it this week, but I can do that next week.
Martin, please address the review feedback by Markus and send a v3.
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 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists