Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2657768lqb; Tue, 28 May 2024 06:51:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjvbXrXeNG37QjVPyQG5nnPLmBStBY8TQ1kNGgGXFTGNh1Kc47LNSnARWdxkWnECmd8QiitQoUBI7/TzyMRUN/By6AOjjHFrHi3/AvhA== X-Google-Smtp-Source: AGHT+IHPkmORaNwPtvrlmfB+eEWj3WnxV22w34KwOikNdJfW+U8mocsUVJgScmhpQDU8MfrQ/siC X-Received: by 2002:a05:6e02:20c4:b0:371:b12b:756a with SMTP id e9e14a558f8ab-3737b32f348mr130589655ab.18.1716904260823; Tue, 28 May 2024 06:51:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716904260; cv=pass; d=google.com; s=arc-20160816; b=yy8jMHL1qoo42yziyyJYN8bsuSy7ynbkADYCNi8vSnNAvs3L5VnyMPmkhrUKIXitXJ hVf8/JwLhHTO3p8Ydm9pBxLCRd6ABt9/Whol2S+4t9PdPOveapfJ9wOmBvuERLRrukAL KruLdNm56cOVNb7P0ptq52VfeSW/MzsgU/dxdBsdD/fRBufUKQ7Sm8DRuEQrrXG4FmcR InIn94fmhntQDdAeuWxr+8juwHk5RNZcUQ3n11t20XIef0eHXtJG0EMi+9ZiFA62Wrw0 wzsz/3DTAgp0Yn8ZZ6Z/EIvAjDyJvw/RD2ogwSsF02zm7758FyjY6SYT/DYrerFpgIzt 1I1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=bcL5Ip+ULpuB+Sj/Uzy3nPVLUQDaL2VYSy9OngOR8j0=; fh=iBZeW2uUFc5W9bqcc/SOjsDdBhTYCozacyFHavdjckQ=; b=dEhll3HujyfhrlyYMQysM+V+j2s4b9P2jhsh5V/YXJ8u2+gCD140bET1ZGmwHVWnlO 8XRK4BnMIh7V0Q/r1xTezYGdfkSYY0tb9Cd5JHToAPxu0lyDU4cmKyeQ4aR+w4kpyqhr Hbh4a2+mQ+gs5Lmj4qye93R2teIGQ4ws1es91SQm6ayA8mq7zAdpuR6dvGYpra7Svtxv lCaV9+HdBTOKPOCKfzTV+iDFivah341jz1J7ZEriUus6kyJp6HD3C39hKqqzCAqXw2lQ SdoixnOGuCtFJBk3IKfMfpuGFOsA8N32u70+A/9Y6L34LzecDKL+AtxdU93tQjGNNKFL Rpjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192442-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-682288e7a58si8499236a12.469.2024.05.28.06.51.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 06:51:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-192442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192442-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A514BB20FF6 for ; Tue, 28 May 2024 13:44:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B1D516F27E; Tue, 28 May 2024 13:43:58 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8F3016F0EF for ; Tue, 28 May 2024 13:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716903837; cv=none; b=jCYz4nPINIKdklUrY7e0ZN+Lc5h7fojnMjnPp9dF9aj27wejeH/GiRPqt6FlpX0eO3WvkYq9U5D2vpsxMtolP5nvr3195uefxd0p7fkx8of4Z+ks/IzMIZLORYji96GZpXDLcRJJ9xE7XsLoDLLfyyQmdu3COTQpcSnXCvNHacs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716903837; c=relaxed/simple; bh=IzhMLTVoe+JLkOeDdoPH3boHn8s9m41hRq6prvUJ9dE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZN45NW9bNLrD2yDBwjs5sHEVTDEqpWQcTA8Juc/RVHxOUHxh7RpdZblzFYiZg2jjhrv+q0Lzh53I7Umpwi6leiF8oEnm42s0H+sXtHEBILcg0SUMbAhAO3eBdwLXWpYUSZ88QPx+2uLzKAQaDqYwij2GHmvM2Ql7K83/aanmhPI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sBx76-0002B7-W6; Tue, 28 May 2024 15:43:41 +0200 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sBx74-003KpZ-HM; Tue, 28 May 2024 15:43:38 +0200 Received: from pengutronix.de (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 232FB2DB98C; Tue, 28 May 2024 13:43:38 +0000 (UTC) Date: Tue, 28 May 2024 15:43:37 +0200 From: Marc Kleine-Budde To: Markus Schneider-Pargmann Cc: Martin =?utf-8?Q?Hundeb=C3=B8ll?= , Chandrasekar Ramakrishnan , Vincent Mailhol , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] can: m_can: don't enable transceiver when probing Message-ID: <20240528-beautiful-teal-of-attack-a6d106-mkl@pengutronix.de> References: <20240501124204.3545056-1-martin@geanix.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dw25iobgk3zzmc32" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --dw25iobgk3zzmc32 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 07.05.2024 14:29:57, Markus Schneider-Pargmann wrote: > Hi Martin, >=20 > On Wed, May 01, 2024 at 02:42:03PM +0200, Martin Hundeb=C3=B8ll 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. > >=20 > > 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. > >=20 > > Signed-off-by: Martin Hundeb=C3=B8ll > > --- > >=20 > > 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() >=20 > Thanks for addressing these. >=20 > In general this looks good: > Reviewed-by: Markus Schneider-Pargmann >=20 > 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 --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --dw25iobgk3zzmc32 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEUEC6huC2BN0pvD5fKDiiPnotvG8FAmZV34YACgkQKDiiPnot vG8W0gf+OXBFxXnx3JnC+bhlMxgn5v7NSRKsE4GU5mE0Z5uaUZXpEjavklwP2cDg Yirkaai/61+NRkVLn0vNlQsLTDIY3t4Q/N1edYBql44XMua3XrCGZ3071yzF/4Uo kOE6y9DNZei1vDsCbukXwWmaynXNtrLtnOh0u2vzENPE3StE1Z6gozPmPhwgFmna G5JcdA9Bx3765cKBx1PPCZqPeTJHJc+GVJNMUgwaAJXdGRMOn/mqu5tSFuDevANZ vwDMQoH8jxoWGu+/ReavCS99tVcizLPilpjiZsBiPaE1Y68Awl4IUEl1gAQ7urO+ nc+sfDgheyINWOeig9Or08N22NNC9A== =fHzh -----END PGP SIGNATURE----- --dw25iobgk3zzmc32--