Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4590744pxb; Tue, 22 Feb 2022 02:02:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLHoxZBcv5RHHqv7awVi8zP8hCvn18/RVrDIQ9ofYgu+ZBcJErCo7O+e98/p1wrTbTlk9F X-Received: by 2002:a17:902:ead1:b0:14f:a8e2:4005 with SMTP id p17-20020a170902ead100b0014fa8e24005mr10449570pld.10.1645524129692; Tue, 22 Feb 2022 02:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645524129; cv=none; d=google.com; s=arc-20160816; b=eRIjJz/SsRuI7QSFQbs76kN1LmAaMAacc+eJblR1Awl6VB8AbLwgfeXTYkjmiN9+yi VfdZE2//uan6gHjvkTOrSo8N5WJpo8zmO5o+492LonauxFa2nSCO7r0OsVAGmn2Zpf+i 5Y2JchZHUKh7quyQ2EyUohvzM4VgjsJoT2kBxSxrDbqfQdFjA6z+EjXlATsjHOkI9uSB dlUMptfNTm8m6JjSyIrGAjaChKKHHnri4rvIoT1/OTXOVdu8DSjZPyjJWL1Ka/uxkgA+ ssjCasrlQGUoLf0ZXuAdDVbNFuax/nb8t3HJ1+xkvbCGdWT9pp33WPvgv5Tv+L+pVlOk Z3mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=dWKZOFQ+HIvrBNvfir4obwb7uVDZZb0beIIECXtlDkQ=; b=lenE4dBbCdES1W1hzckamTxNuUOTv7RBQiSf+WmFagZB2WrpuAcRb86EGclQ6aWDBU gYNrrups59N5hEeSOtb4cmLxJVWF+xiQE9N5apIYJ+E2B4RWlqUxs2oKOMNObgnyUn2b no+r/7d25+G0pLOxXWy3g8j3CA1OayJ8cWZrNGqV0j1UUCaXaJ5/NKFLv0/b2CLZxTYG wvVGiicK7Zli13RUAirdMDfVcFepd5uewVHwj1FJD+zQt4uF/kktHf3HCbf+6k45k8+M ynMmmp2RDlnZjN2mzCFk4ah1r2qZYfHYs3GEjJpcw6+WoMcKwhQZdYGj9LJ2ddqPuhmK YODg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fpond.eu header.s=strato-dkim-0002 header.b=exfJhR7j; 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 b8si3558288plh.468.2022.02.22.02.01.56; Tue, 22 Feb 2022 02:02:09 -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; dkim=pass header.i=@fpond.eu header.s=strato-dkim-0002 header.b=exfJhR7j; 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 S230283AbiBVJ74 (ORCPT + 99 others); Tue, 22 Feb 2022 04:59:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbiBVJ7y (ORCPT ); Tue, 22 Feb 2022 04:59:54 -0500 X-Greylist: delayed 174 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 22 Feb 2022 01:59:28 PST Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9513D21FD for ; Tue, 22 Feb 2022 01:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1645523606; s=strato-dkim-0002; d=fpond.eu; h=Subject:References:In-Reply-To:Message-ID:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=dWKZOFQ+HIvrBNvfir4obwb7uVDZZb0beIIECXtlDkQ=; b=exfJhR7jvCtg4CEw/NPhwh4CrS/VHlNeZhrary/CFZIVX0kpWMYhA10vK6naSw4iMY nYyBeUC8Afyiu/qE7odMcG7NAQIFB9J41nU7dVAbQVLO3QmiY9cqp8faFxXIuGMFbzYw KziTMkmXEwB0XAmjIkyE1GVV2nH4Qns92uFRI3zyIg3TuW0nw4D9ww1mn7FyJAorGnHE yhJOqiyDQWnA+5Ll8RxVVFOQynKJ4EfD8iKLZPtJud/ZaaItB2dsBwDSW1j7BsbqkEv2 vRPmVu+o5PWG/mzREGV0C/+iZQ7OS3P/V0Qs4GgJCXRDBdkQbYoJK/vPtVecD9MMkLpF EA5A== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":OWANVUa4dPFUgKR/3dpvnYP0Np73amq+g13rqGzvv3qxio1R8fCs/87J2o0=" X-RZG-CLASS-ID: mo00 Received: from oxapp05-05.back.ox.d0m.de by smtp-ox.front (RZmta 47.40.0 AUTH) with ESMTPSA id 6c30c7y1M9rQ2KB (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Tue, 22 Feb 2022 10:53:26 +0100 (CET) Date: Tue, 22 Feb 2022 10:53:26 +0100 (CET) From: Ulrich Hecht To: Lad Prabhakar , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , linux-can@vger.kernel.org, Pavel Machek Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Ulrich Hecht , Prabhakar , Biju Das Message-ID: <1103141484.974980.1645523606875@webmail.strato.com> In-Reply-To: <20220221225935.12300-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20220221225935.12300-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Subject: Re: [PATCH] can: rcar_canfd: Register the CAN device when fully ready MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.5-Rev38 X-Originating-Client: open-xchange-appsuite X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, 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 > On 02/21/2022 11:59 PM Lad Prabhakar wrote: > > > Register the CAN device only when all the necessary initialization > is completed. This patch makes sure all the data structures and locks are > initialized before registering the CAN device. > > Reported-by: Pavel Machek > Signed-off-by: Lad Prabhakar > --- > drivers/net/can/rcar/rcar_canfd.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c > index 3ad3a6f6a1dd..8c378b20b2aa 100644 > --- a/drivers/net/can/rcar/rcar_canfd.c > +++ b/drivers/net/can/rcar/rcar_canfd.c > @@ -1783,15 +1783,15 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch, > > netif_napi_add(ndev, &priv->napi, rcar_canfd_rx_poll, > RCANFD_NAPI_WEIGHT); > + spin_lock_init(&priv->tx_lock); > + devm_can_led_init(ndev); > + gpriv->ch[priv->channel] = priv; > err = register_candev(ndev); > if (err) { > dev_err(&pdev->dev, > "register_candev() failed, error %d\n", err); > goto fail_candev; > } > - spin_lock_init(&priv->tx_lock); > - devm_can_led_init(ndev); > - gpriv->ch[priv->channel] = priv; > dev_info(&pdev->dev, "device registered (channel %u)\n", priv->channel); > return 0; > > -- > 2.17.1 Reviewed-by: Ulrich Hecht CU Uli