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 F3F11C4338F for ; Mon, 9 Aug 2021 12:06:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3F0460F35 for ; Mon, 9 Aug 2021 12:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234254AbhHIMHI (ORCPT ); Mon, 9 Aug 2021 08:07:08 -0400 Received: from mail-ua1-f41.google.com ([209.85.222.41]:37470 "EHLO mail-ua1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233785AbhHIMHA (ORCPT ); Mon, 9 Aug 2021 08:07:00 -0400 Received: by mail-ua1-f41.google.com with SMTP id 67so6889326uaq.4; Mon, 09 Aug 2021 05:06:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wdIFyUpYOmARtbdZwtri8h0Sw2cLxyVaWTJ/k1Vbtto=; b=Iizz70hccW5JxKqLqyNkk1STfrgW3E7I63kAVQZIo4ROz6B/8bVDSelg/eIkhKNn8E jDVH/eiLevOGDcZ4YKYgv9CXCX9AuDpAUZkl10WMcGiYi4gOQRw8tXE5gwyt+ILrVJyw bEt4Opz6JIuNisX22PjGR6OPNmMR6gwRa3YT4TobOow9a/9fiqviJFGVfIA9gGqhlOTz vxmKsBJfbwx3CC+p8YX+Akeso72i7+k/lAM7xt9Vc4xN0J2qUmJFhgtP0fw2b7UkTWsj /39gLa3OnN5JDxblQie0vSaeCqZTneTwy355v+Fg+VjAFNnXnGlY5UHpwS31kOduvgYJ mHfw== X-Gm-Message-State: AOAM533UmPWVCzsH4S1OrWh/kcIVZQwpPhgPZb/3ERftcfTdVEEnxLpk /y4yivPYqJRb7x/CNPTgAz3h0CqeJliweiifZ3U= X-Google-Smtp-Source: ABdhPJzBjr9L/a/cJN4lt6cJw4cNlR1lJHDRbtmJgzlVTgNnjLG9tozWGcTvQaVgjF0HAOrpkA3PCyvZDLMwp0sJ5FM= X-Received: by 2002:ab0:60c9:: with SMTP id g9mr15368667uam.100.1628510799843; Mon, 09 Aug 2021 05:06:39 -0700 (PDT) MIME-Version: 1.0 References: <20210802102654.5996-1-biju.das.jz@bp.renesas.com> <20210802102654.5996-2-biju.das.jz@bp.renesas.com> In-Reply-To: <20210802102654.5996-2-biju.das.jz@bp.renesas.com> From: Geert Uytterhoeven Date: Mon, 9 Aug 2021 14:06:28 +0200 Message-ID: Subject: Re: [PATCH net-next v2 1/8] ravb: Add struct ravb_hw_info to driver data To: Biju Das Cc: "David S. Miller" , Jakub Kicinski , Sergei Shtylyov , Geert Uytterhoeven , Sergey Shtylyov , Adam Ford , Andrew Lunn , Yuusuke Ashizuka , Yoshihiro Shimoda , netdev , Linux-Renesas , Chris Paterson , Biju Das , Prabhakar Mahadev Lad Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Biju, On Mon, Aug 2, 2021 at 12:27 PM Biju Das wrote: > The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC are > similar to the R-Car Ethernet AVB IP. With a few changes in the driver we > can support both IPs. > > Currently a runtime decision based on the chip type is used to distinguish > the HW differences between the SoC families. > > The number of TX descriptors for R-Car Gen3 is 1 whereas on R-Car Gen2 and > RZ/G2L it is 2. For cases like this it is better to select the number of > TX descriptors by using a structure with a value, rather than a runtime > decision based on the chip type. > > This patch adds the num_tx_desc variable to struct ravb_hw_info and also > replaces the driver data chip type with struct ravb_hw_info by moving chip > type to it. > > Signed-off-by: Biju Das > Reviewed-by: Lad Prabhakar Thanks for your patch! > --- a/drivers/net/ethernet/renesas/ravb.h > +++ b/drivers/net/ethernet/renesas/ravb.h > @@ -988,6 +988,11 @@ enum ravb_chip_id { > RCAR_GEN3, > }; > > +struct ravb_hw_info { > + enum ravb_chip_id chip_id; > + int num_tx_desc; Why not "unsigned int"? ... This comment applies to a few more subsequent patches. > +}; > + > struct ravb_private { > struct net_device *ndev; > struct platform_device *pdev; > @@ -1040,6 +1045,8 @@ struct ravb_private { > unsigned txcidm:1; /* TX Clock Internal Delay Mode */ > unsigned rgmii_override:1; /* Deprecated rgmii-*id behavior */ > int num_tx_desc; /* TX descriptors per packet */ ... oh, here's the original culprit. > + > + const struct ravb_hw_info *info; > }; > Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds