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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D647C636CA for ; Tue, 20 Jul 2021 10:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6624E6113B for ; Tue, 20 Jul 2021 10:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236514AbhGTJra convert rfc822-to-8bit (ORCPT ); Tue, 20 Jul 2021 05:47:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236471AbhGTJoR (ORCPT ); Tue, 20 Jul 2021 05:44:17 -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 D2C8EC0613DD for ; Tue, 20 Jul 2021 03:23:20 -0700 (PDT) Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5mu4-0001g8-Aw; Tue, 20 Jul 2021 12:23:08 +0200 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1m5mu3-0002S8-Sy; Tue, 20 Jul 2021 12:23:07 +0200 Message-ID: Subject: Re: [PATCH v2 2/5] can: rcar_canfd: Add support for RZ/G2L family From: Philipp Zabel To: Lad Prabhakar , Geert Uytterhoeven , Rob Herring , Fabrizio Castro , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , Michael Turquette , Stephen Boyd Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das Date: Tue, 20 Jul 2021 12:23:07 +0200 In-Reply-To: <20210719143811.2135-3-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20210719143811.2135-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20210719143811.2135-3-prabhakar.mahadev-lad.rj@bp.renesas.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org On Mon, 2021-07-19 at 15:38 +0100, Lad Prabhakar wrote: > CANFD block on RZ/G2L SoC is almost identical to one found on > R-Car Gen3 SoC's. On RZ/G2L SoC interrupt sources for each channel > are split into different sources and the IP doesn't divide (1/2) > CANFD clock within the IP. > > This patch adds compatible string for RZ/G2L family and registers > the irq handlers required for CANFD operation. IRQ numbers are now > fetched based on names instead of indices. For backward compatibility > on non RZ/G2L SoC's we fallback reading based on indices. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Biju Das > --- > drivers/net/can/rcar/rcar_canfd.c | 178 ++++++++++++++++++++++++------ > 1 file changed, 147 insertions(+), 31 deletions(-) > > diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c > index 311e6ca3bdc4..d4affc002fb3 100644 > --- a/drivers/net/can/rcar/rcar_canfd.c > +++ b/drivers/net/can/rcar/rcar_canfd.c > @@ -37,9 +37,15 @@ [...] > + if (gpriv->chip_id == RENESAS_RZG2L) { > + gpriv->rstc1 = devm_reset_control_get_exclusive_by_index(&pdev->dev, 0); > + if (IS_ERR(gpriv->rstc1)) { > + dev_err(&pdev->dev, "failed to get reset index 0\n"); Please consider requesting the reset controls by name instead of by index. See also my reply to the binding patch. > + return PTR_ERR(gpriv->rstc1); > + } > + > + err = reset_control_reset(gpriv->rstc1); > + if (err) > + return err; I suggest to wait until after all resource requests have succeeded before triggering the resets, i.e. first get all reset controls and clocks, etc., and only then trigger resets, enable clocks, and so on. That way there will be no spurious resets in case of probe deferrals. regards Philipp