Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1744858rwe; Fri, 2 Sep 2022 03:09:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR57k/B0bIIbHyAdS6lBsGwYQRO4bp5utC0Tkqy2a3YIw+Hyi8pPm9LF0KR4C23+xry+oIsW X-Received: by 2002:a17:903:d5:b0:173:3307:bcf with SMTP id x21-20020a17090300d500b0017333070bcfmr35020931plc.87.1662113375519; Fri, 02 Sep 2022 03:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662113375; cv=none; d=google.com; s=arc-20160816; b=K8cOBrA1uAieTktWuG9a7g+2MzPikJ9GnYuMez3AzEJdOM46YOFTvhoQXLd9ID32rn P2HFnR4Mk1p4qKDuMOCtejZ/SM2YSETOB0MNTmkYEWrRIOp5aGQwI0YP7HT13Ivkjw8V mwxnI9ibLYEY0/LsGbN9B0p3RkeuXjtZ/NWGXWPpcwxHD2I+7sOzHcT5F1Ejivu2QqxS pVGanfX1GiQADP3Z+9UHTqlsM6uuD1nNgxa6l3DcCL7qYN49NNve+yKHvO6EhsKwzTxX WMdaAd3joJJrrJZzJhCWljAT9Dg4gOG33M+WtapVrNPqmCeycGvYR+HT9vJ8daVrAZ4g Hm2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=RD1yx/PsqytJ6OQjWWks7esAzyalayp1G8TZ1RVwt+g=; b=cwmf9UyL1yINXb+mDwBNaQtuiv3puG03NReYQw6+Sa37Nd8GdEppQtIl+UlT2KTRpx oaE9AH9RaXMaYCKR0lyfC6+Y/Odb8sKi3dWzWULIGAzACFUrc3vIDsItslsfMLEm/aUZ Na9x2b7SPqALocGRZYlGDzg8TdMwMC8fW4m7N2fv1M1RjnLieM+pDlpsulFMjJ1mKCkV GT0O2PR+qT22aC4zX9UzvLiBc9mQpXYBtShOsIh27uWCbEV9aXBXFWB6pGmG4trcvGFx Oxniix7vnEOTZ+k7zsXkZWP/g1A+VZsH3BIAlk1kGlLWkBk016nUb1YIkwqsLQ7F0L+O FprA== 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 u20-20020a056a00159400b0052ad3d43859si1763086pfk.23.2022.09.02.03.09.24; Fri, 02 Sep 2022 03:09:35 -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 S235431AbiIBJ5X (ORCPT + 99 others); Fri, 2 Sep 2022 05:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234836AbiIBJ5U (ORCPT ); Fri, 2 Sep 2022 05:57:20 -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 8A87DD124C for ; Fri, 2 Sep 2022 02:57:17 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oU3QC-0006vm-Ff; Fri, 02 Sep 2022 11:57:08 +0200 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oU3QB-0005Eq-97; Fri, 02 Sep 2022 11:57:07 +0200 Date: Fri, 2 Sep 2022 11:57:07 +0200 From: Oleksij Rempel To: Vladimir Oltean Cc: Arun.Ramadoss@microchip.com, andrew@lunn.ch, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, vivien.didelot@gmail.com, san@skov.dk, linux@armlinux.org.uk, f.fainelli@gmail.com, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, Woojung.Huh@microchip.com, davem@davemloft.net Subject: Re: [Patch net-next v2 0/9] net: dsa: microchip: add support for phylink mac config and link up Message-ID: <20220902095707.GA15827@pengutronix.de> References: <20220830065533.GA18106@pengutronix.de> <67690ec6367c9dc6d2df720dcf98e6e332d2105b.camel@microchip.com> <20220830095830.flxd3fw4sqyn425m@skbuf> <20220830160546.GB16715@pengutronix.de> <20220831074324.GD16715@pengutronix.de> <20220831151859.ubpkt5aljrp3hiph@skbuf> <20220831161055.GA2479@pengutronix.de> <6c4666fd48ce41f84dbdad63a5cd6f4d3be25f4a.camel@microchip.com> <20220901112721.GB2479@pengutronix.de> <20220901124737.mrfo3fefjsn4scuy@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220901124737.mrfo3fefjsn4scuy@skbuf> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ore@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=ham 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 Hi Vladimir, On Thu, Sep 01, 2022 at 03:47:37PM +0300, Vladimir Oltean wrote: > On Thu, Sep 01, 2022 at 01:27:21PM +0200, Oleksij Rempel wrote: > > > The global register 0x06 responsibilities are bit 4 for 10/100mbps > > > speed selection, bit 5 for flow control and bit 6 for duplex > > > operation. Since these three are new features added during refactoring > > > I overlooked it. > > > To fix this, either I need to return from the ksz_set_100_10mbit & > > > ksz_duplex_flowctrl function if the chip_id is ksz87xx or add > > > dev->dev_ops for this alone. Kindly suggest on how to proceed. > > > > I would prefer to got ops way, to clean things up. > > I can't say that that one approach is better or worse than the other. > Indirect function calls are going to be more expensive than conditionals > on dev->chip_id, but we aren't in a fast path here, so it doesn't matter > too much. > > Having indirect function calls will in theory help simplify the logic of > the main function, but will require good forethought for what constitutes > an atom of functionality, in a high enough level such as to abstract > switch differences. Whereas conditionals don't require thinking that far, > you put them where you need them. > > Also, indirect function calls will move the bloat somewhere else. I have > seen complaints in the past about the mv88e6xxx driver's layered structure, > making it difficult to see exactly what gets done for a certain chip. > > It is probable that we don't want to mix these styles too much within a > single driver, so if work has already started towards dev_ops for > everything, then dev_ops be it, I guess. > > Oleksij, are you going to submit patches with your proposal? I have send one simple patch for net to make it work. After this one will pop-up in then net-next i'll send other patches depending on this patch. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |