From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A653C46467 for ; Thu, 24 Nov 2022 14:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbiKXOyv (ORCPT ); Thu, 24 Nov 2022 09:54:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbiKXOyg (ORCPT ); Thu, 24 Nov 2022 09:54:36 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD02FA1A0 for ; Thu, 24 Nov 2022 06:54:35 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyDcB-00049Y-5E; Thu, 24 Nov 2022 15:54:11 +0100 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:5507:4aba:5e0a:4c27]) (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 9A1041286A3; Thu, 24 Nov 2022 14:54:07 +0000 (UTC) Date: Thu, 24 Nov 2022 15:54:05 +0100 From: Marc Kleine-Budde To: Vivek Yadav Cc: rcsekar@samsung.com, krzysztof.kozlowski+dt@linaro.org, wg@grandegger.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pankaj.dubey@samsung.com, ravi.patel@samsung.com, alim.akhtar@samsung.com, linux-fsd@tesla.com, robh+dt@kernel.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, aswani.reddy@samsung.com, sriranjani.p@samsung.com Subject: Re: RE: [PATCH v3 1/2] can: m_can: Move mram init to mcan device setup Message-ID: <20221124145405.d67cb6xmoiqfdsq3@pengutronix.de> References: <20221122105455.39294-1-vivek.2311@samsung.com> <20221122105455.39294-2-vivek.2311@samsung.com> <20221123224146.iic52cuhhnwqk2te@pengutronix.de> <01a101d8ffe4$1797f290$46c7d7b0$@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7molxfrf5k54fpwk" Content-Disposition: inline In-Reply-To: <01a101d8ffe4$1797f290$46c7d7b0$@samsung.com> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7molxfrf5k54fpwk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 24.11.2022 14:36:48, Vivek Yadav wrote: > > Why not call the RAM init directly from m_can_chip_config()? > >=20 > m_can_chip_config function is called from m_can open. >=20 > Configuring RAM init every time we open the CAN instance is not > needed, I think only once during the probe is enough. That probably depends on you power management. If I add a regulator to power the external tcan4x5x chip and power it up during open(), I need to initialize the RAM. > If message RAM init failed then fifo Transmit and receive will fail > and there will be no communication. So there is no point to "open and > Configure CAN chip". For mmio devices the RAM init will probably not fail. There are return values and error checking for the SPI attached devices. Where the SPI communication will fail. However if this is problem, I assume the chip will not be detected in the first place. > From my understanding it's better to keep RAM init inside the probe > and if there is a failure happened goes to CAN probe failure. Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --7molxfrf5k54fpwk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmN/hYsACgkQrX5LkNig 01087Qf9Gx/Nk41SCCj7+rrggRE7qKHXE5G+Qk02d7IXfzxLbUmsgUk5dsi29H/Z P7czNTvipDDshilhlAfYDGZKD01XfogCP2DAwVIBE0kCxRAfpBpC1xmEhGSG7mtV SHlKTj8cHNQ7J+IFmzCUq9R3ywgRyrX+PYgwg9danzR1dv049+kP/ptoTSUBOjqk OWbU4BsTtl/iIs/3pOxfoq9NMEXnS44zAHgJlkA10LGESj7wCfTMX2oG2V/10C+J /odw2rODOYOdcE30Lk5xEKvbbiHwIpMwQ2+8LSBckoqYhklPuC8H9oGrE0sIkCz8 T4zcFCce6yQGR1tpOZ2JxMXb0qDsTQ== =rGjh -----END PGP SIGNATURE----- --7molxfrf5k54fpwk--