Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1018018rwl; Fri, 31 Mar 2023 05:50:29 -0700 (PDT) X-Google-Smtp-Source: AKy350aOcomCtaeE/wCW8itH/xMZ0xYxzj3ZLSIJinuiHxRhV43qvHSBxBx3qul+wgio8MuLuQfS X-Received: by 2002:a05:6402:2811:b0:4bb:c3ce:63fc with SMTP id h17-20020a056402281100b004bbc3ce63fcmr30674433ede.3.1680267029076; Fri, 31 Mar 2023 05:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680267029; cv=none; d=google.com; s=arc-20160816; b=bLrkm2TxIzJSQDPwQEAs8brYml8MpIrQI3FChbZkwU/ob/IkHgXOU2Al0Z31q2Z7nD 6GhAjISuyDige1zIClY7VzF2UCVmJC7pVqHo0dbeLyWtopjf7qhzQtb6T+FIpvIQZ+BA Vn5AgX16E0kpFYWxQyJni+6BywQQoNbd6tXIehqX+0Zzgt40xr/LdamoG4aX+oVxUcgq IzWC6wUiJWKjy1+B3kt0Xrw8cWYVnlXHC45fJwjR+N0K1gfyqqN6xiZZcolhfcT6gInb PEORSdKK4qQLbY11d7woiLzRbSW0c+CxsNB8S23xaRBUdya7KMkI+uoj3yisc800vPUk Nnvg== 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:dkim-signature; bh=kBywTnPm98K4P6whYiX2rvcllzM1t6Zix8WFENn7dyQ=; b=z8YrlopvWKBS+dhJ0+kIsdlCcg4vVLxxO8najqifMJLyareCy4xqrFZH4tcpYNY3ZR e9rnCTWarha0irn1HHwKJ0LajA752QzPRy4/pOakbslkFcqcc5j4uaupjuKE2Md67wzw VJQ+tNoNgmbZPI37jGMaJBR9v2aCAcYeX5t3GZTwmX8tgDjelfUXrsj86iJRvSX61i7O y9q5cY9eh5VdNiHDD7J+GjhSZ9uaq70lTjShZechPmipxfFjaIaGmTQbSZHPPVEfoCvk vVlk8K48lZcevDdqIHqnrHSqX5nY4tbU+Hsktrfw1w01lqSE7eJ94MnmCEq+2VL+F0Z2 08Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=KqMXOvG3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s16-20020a056402165000b004aab36d2eb8si1478491edx.62.2023.03.31.05.50.04; Fri, 31 Mar 2023 05:50:29 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=KqMXOvG3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231944AbjCaMpw (ORCPT + 99 others); Fri, 31 Mar 2023 08:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbjCaMpq (ORCPT ); Fri, 31 Mar 2023 08:45:46 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABBB72063F; Fri, 31 Mar 2023 05:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=kBywTnPm98K4P6whYiX2rvcllzM1t6Zix8WFENn7dyQ=; b=KqMXOvG33G8QTvnyKl/bzvRcMq zhiVH2CBklpNfSSxBlIcUVZlzs1blc6QDBaVsCdpZPL5rIUxzKOrHcPIA8Bz+XcXJlls+beSFZUhF l10FhK4iKQaCd1eqwIY3Vgyyj0yIfuhdi+bibCLJVtA1dpxofOSGK3bm4iSseTr202jo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1piE7p-0091hJ-FY; Fri, 31 Mar 2023 14:45:01 +0200 Date: Fri, 31 Mar 2023 14:45:01 +0200 From: Andrew Lunn To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Daniel Golle , netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau , Luiz Angelo Daros de Luca Subject: Re: [PATCH net-next 14/15] net: dsa: mt7530: introduce driver for MT7988 built-in switch Message-ID: <387b3105-2d70-4906-9573-cfac20a55d3a@lunn.ch> References: <6a7c5f81-a8a3-27b5-4af3-7175a3313f9a@arinc9.com> <7d0acaef-0cec-91b9-a5c6-d094b71e3dbd@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7d0acaef-0cec-91b9-a5c6-d094b71e3dbd@arinc9.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 > Firstly, all of the functions on the mt7530-mmio driver should be changed > from mt7988_* to mt7530_mmio_*. Same goes for the mt7530-mdio driver too as > some of the functions don't start with mt7530_mdio_*. The MDIO and MMIO > drivers are supposed to be used for the switches the MT7530 DSA driver > supports. The mt7530_ prefix is derived from that. The mmio_ or mdio_ prefix > is derived from, well, the driver itself. There are examples of similar naming schemes in other DSA drivers. For the marvell mv88e6xxx driver, all generic functions use the mv88e6xxx_ prefix. For functions which are specific to a family of marvell switches, we use a prefix for when the feature was introduced. So for example we have mv88e6352_g1_reset(), where that method of resetting the devices was introduced in the mv88e6352. This also gives us some namespace space, so we can also have mv88e6185_g1_reset() which is used for a different family. So i personally don't have a problem using different prefixes within one driver, if it helps with understanding and name space issues. > What I'm going to say next depends on how generic the MMIO and MDIO drivers > are so that they can be used on all MediaTek architecture switches. Let's > say, a new MediaTek switch is introduced. It seems likely that either the > MMIO or MDIO driver will be used to control the switch. Maybe the driver for > this new switch won't be under mt7530.c, like on Realtek, but that doesn't > change the outcome. My experience with silicon vendors is that they like to change the hardware in none backwards compatible ways. So i would actually avoid generic names, it makes it harder to deal with different variants. Andrew