Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp488994imk; Sun, 3 Jul 2022 01:32:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sqLjKht+G+KSXrf0hBRgks9NliPlksFt7uEW6elwOIYn3TtJbe43pVUv+Sx/zpGJKmaDsf X-Received: by 2002:a17:903:32c4:b0:16a:4201:45e4 with SMTP id i4-20020a17090332c400b0016a420145e4mr29829021plr.108.1656837174359; Sun, 03 Jul 2022 01:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656837174; cv=none; d=google.com; s=arc-20160816; b=FO5zCO7UuxKW7vATlLAZ2I6jQp8QQKmbwgmRwENPIPb1XNZrrFpydisccC0ThoQCzu wXwTk0FqkFb3eDfUpvgAvBZgqofe7Dl5XX9bJ8/LSFQAY7+KVzkoAexucpCPtYIbqJla Ap7Qw6olyBaxoSh1oHynQE0pEUO87Csbgxp4zOSqWxI6qC6r7wgZcZX9QVzNnaDEyLUm 0+QslZIqpEg7uimgTbc25woUos0byAq+iWH9MnxhbmbAD/Wxdk4LtmAucY3z1aYCY2zk CSXUKuQjcXUq1JPfifJY3rmYdbB5lEkKIbiY0tEgWCipre0/W8J3KTLcMDde60NeKRwK X0Gw== 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=+SfM9HlEHW+utw0YPWFQceipfhlF/XTYEhgziTkf1+I=; b=xHhBsbEG/1fLVnx11Xn5GjEtYEQ9Q7OPnLnbYxsegGOBX1Zpi7hvUlkn4ONp2PR+1o GYJonP0UlEDKfMUgv5/27ggTU1yHW+7sKxkorqEEOjQO2kOPBfo1W+AjvuNZwN6zptiz Q3UA0UxggBfURaGg6m8YfRG8ZlSHUQqz0xphGh8D/WkBAKTsapbui6uk2GzrOqpb7/CZ LKAgLMgoE+Ioo2TggRVVKZO9itnv3wAMgyBmBbNoKlMi5AVYsW7kg6TO2ZOZiMrg+HyF /VOfOTydliAP6ad7K10z4187028YZtX70AuZ9J+sma7Ud03ev4A4Wz7ItekhLDo1JMV+ vvRw== 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 z14-20020a170902d54e00b00153b7df656asi28009plf.490.2022.07.03.01.32.41; Sun, 03 Jul 2022 01:32:54 -0700 (PDT) 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 S231648AbiGCIOs (ORCPT + 99 others); Sun, 3 Jul 2022 04:14:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231495AbiGCIOl (ORCPT ); Sun, 3 Jul 2022 04:14:41 -0400 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 3D8A465A0 for ; Sun, 3 Jul 2022 01:14:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7ukG-0000kC-99; Sun, 03 Jul 2022 10:14:20 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1o7uk9-0048UC-IY; Sun, 03 Jul 2022 10:14:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1o7ukC-002h2n-7I; Sun, 03 Jul 2022 10:14:16 +0200 Date: Sun, 3 Jul 2022 10:14:12 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Biju Das Cc: Marc Kleine-Budde , Wolfgang Grandegger , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "linux-can@vger.kernel.org" , "netdev@vger.kernel.org" , Geert Uytterhoeven , Chris Paterson , Biju Das , "linux-renesas-soc@vger.kernel.org" , "linux-clk@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 6/6] can: sja1000: Add support for RZ/N1 SJA1000 CAN Controller Message-ID: <20220703081412.75t6w5lgt4n3tup2@pengutronix.de> References: <20220702140130.218409-1-biju.das.jz@bp.renesas.com> <20220702140130.218409-7-biju.das.jz@bp.renesas.com> <20220702164018.ztizq3ftto4lsabr@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fx47dwq5sofzh2mk" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@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,T_SCC_BODY_TEXT_LINE 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 --fx47dwq5sofzh2mk Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 03, 2022 at 07:15:16AM +0000, Biju Das wrote: > Hi Marc and Uwe, >=20 > > Subject: Re: [PATCH 6/6] can: sja1000: Add support for RZ/N1 SJA1000 CAN > > Controller > >=20 > > On 02.07.2022 15:01:30, Biju Das wrote: > > > The SJA1000 CAN controller on RZ/N1 SoC has some differences compared > > > to others like it has no clock divider register (CDR) support and it > > > has no HW loopback(HW doesn't see tx messages on rx). > > > > > > This patch adds support for RZ/N1 SJA1000 CAN Controller. > > > > > > Signed-off-by: Biju Das > > > --- > > > drivers/net/can/sja1000/sja1000_platform.c | 34 > > > ++++++++++++++++++---- > > > 1 file changed, 29 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/net/can/sja1000/sja1000_platform.c > > > b/drivers/net/can/sja1000/sja1000_platform.c > > > index 5f3d362e0da5..8e63af76a013 100644 > > > --- a/drivers/net/can/sja1000/sja1000_platform.c > > > +++ b/drivers/net/can/sja1000/sja1000_platform.c > > [...] > > > @@ -262,6 +276,16 @@ static int sp_probe(struct platform_device *pdev) > > > priv->reg_base =3D addr; > > > > > > if (of) { > > > + clk =3D devm_clk_get_optional(&pdev->dev, "can_clk"); > > > + if (IS_ERR(clk)) > > > + return dev_err_probe(&pdev->dev, PTR_ERR(clk), "no CAN > > clk"); > > > + > > > + if (clk) { > > > + priv->can.clock.freq =3D clk_get_rate(clk) / 2; > > > + if (!priv->can.clock.freq) > > > + return dev_err_probe(&pdev->dev, -EINVAL, "Zero > > CAN clk rate"); > > > + } > >=20 > > There's no clk_prepare_enable in the driver. You might go the quick and > > dirty way an enable the clock right here. IIRC there's a new convenience > > function to get and enable a clock, managed bei devm. Uwe (Cc'ed) can > > point you in the right direction. >=20 > + clk >=20 > As per the patch history devm version for clk_prepare_enable is rejected[= 1], so the individual drivers implemented the same using devm_add_action_or= _reset [2]. > So shall I implement devm version here as well? You want to make use of 7ef9651e9792b08eb310c6beb202cbc947f43cab (which is currently in next). If you cherry-pick this to an older kernel version, make sure to also pick 8b3d743fc9e2542822826890b482afabf0e7522a. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --fx47dwq5sofzh2mk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmLBT9IACgkQwfwUeK3K 7Alptgf/SWE8eashOILFfLmPuRKFKypJmOjW7PCEqdYeTQ/d2XK0WtqvmzgYDTjm Vjvna6c/6jmEE0bVCVQ90n+0KIHQ4n8D3IGXBvrEjF809xp5BPeO82qChKwjZ7lk vm9fDLj3Wy2PS7sNn7D0nIjQKt/HafqAAclKSIQU3xWWeZjuiL+zBCbn2ttYOoJ2 jPUSwFQ9NYR9uoRnvWdTrlPXLuD0o/h7Czf9bNeuEclZ+KoDulqh4Pll11ipYZ1q C/yvoJa8B9UDVyzflKPkdwZBqaF89DXMh2NtUnCy+XgGQDSwdvBDLg4S94iCzIe6 zVS779Af/9w5w/PB0SO17B0dcjqs9A== =UInt -----END PGP SIGNATURE----- --fx47dwq5sofzh2mk--