Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9038839rwb; Thu, 24 Nov 2022 07:20:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4poBSJrK6eVczHm4mq2Xc1s6VXaRzdiZHM2v8M4smj76Ez56SO3Aym3a3hnVpfkE+KxXCO X-Received: by 2002:a17:906:9c47:b0:78d:8fa5:c326 with SMTP id fg7-20020a1709069c4700b0078d8fa5c326mr17276770ejc.25.1669303229738; Thu, 24 Nov 2022 07:20:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669303229; cv=none; d=google.com; s=arc-20160816; b=e4hAVYs//eCaNtihJ6003u8fG+wuqo20ghJVMRACEOQX2sWC3WachaKp4xuiOU8FgN usK8H7vS192BUZ57HYDsAZ/itPbWijq21UZZbbERJ3jwZTm0+95nBHh92psz449jl3Rw PSwKmpqqOlf7zY7wccrqu+GGBRuM0lyBeaA4sKATl2XN8Xm19LeY52NFiFRHbODE/sxb gyzmEf3gMAKaN0Tx2dHQdCmEn4tbIv7/0Fj8TEgZIxgV0+NWPnEoaRiWpzoG7TySYxQK EhVTlOZB6a72OGpXSuR7tJXPqAhDmCyk/AjIquxcWtKyX0VQKZQxFdnVJ+BDPkWMF35/ F0Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=o7Muevm5ZY/+zITMs05V4rtsAWMT4V+jcgLSqeiI+aQ=; b=pjQDuH8ozHyJw0z2RwM9N6hyRiOt8eFeRf50cW+X4+J3iN4ADt8/Z0NYaiHdyek814 jWO4aa8hYPT+agyIRyEKEcpADzawPrkKolxRyfXFq47MBYAPTrlX1lYCXg6h1e9cOqJm Rn1oXHKtx2dj1bSOZhNhGeACD0s8uNSrBLkcBXUAQv2E/pMoFJzuOvTRI6npW+BmGIFo aAVFdEJypxxwZ6Iygvg3fn/ad4s7s1ZuTiIp9foqoVyuvRzx3fyB7MqoyGl8VL4q+Ce3 NhuGBGQ+QLQ/EIEqdy08u83/ihEHPdB+kVpiXNGNLz89AbJ8NUDNxBGqUqfp0OBPZNoT HhEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw5-20020a170906478500b00781dbeebeb1si1186013ejc.585.2022.11.24.07.20.08; Thu, 24 Nov 2022 07:20:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229477AbiKXOyv (ORCPT + 86 others); 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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--