Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3484776rwl; Mon, 27 Mar 2023 15:02:42 -0700 (PDT) X-Google-Smtp-Source: AKy350auYXSJm9hm13bGC1Q8s9eqzbFRaycUyq0Mt7a0/YY5ZmHHaW1tiZS5U0TQx7URbATVMDaY X-Received: by 2002:a17:907:1622:b0:878:4497:380e with SMTP id hb34-20020a170907162200b008784497380emr16639807ejc.4.1679954562693; Mon, 27 Mar 2023 15:02:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679954562; cv=pass; d=google.com; s=arc-20160816; b=ViCiqHOhjZVrfKT6h39+fnR6+eH2Bj44QJKIOD1Urjm21ObnvCZttzzpHOaA2bIhlF LHcF4wAP6Uj4K+36p/2c3c+Zv1gdTZssNBhk0O52jv2wDN4VGbBd0FlkP5MIvtMx9r/4 FMelK+DvsJ8MKTh4SF30qy02z1vgq53g0tzM0N6wQ9fPnLlMm52uDkQDZwW08SnvgzzE QKf4o7tTqsFzqsWVtmTWXAG8/mzqjzvhFy/FtSp8uQnCddEHUMyPkTPI8qq6t/fRsK/z mp1tUCN7V0E7yQmj6WoqTw5UpTFNesEreRRp7DF4JRYoGemJFLHc+YlHw5rlvaTFFHqV GYaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=m3Nxnw2EJKi8PgND390b4ttccCknFAa+VCeuBtlni8M=; b=AeGtRWwXvqeT44VQ6P+fxI+dlL3DI0UT6jK+0f2PH2dLdQqyoq0HP2Eo2ZtidmGE5E 0Y+kqTDiEuhUpkioeoXXf3BkAYusTZxdNiEhN4kmWAIRC7Vqte4d3nyvWwCkDDOz4JCi LiSxxDM5aQ1rjb02bt8wp2FELVzAFjRWmX9HmM4F0aTZ4t4U4lcjwhkMfjRHkBZtF3Nq wPraDXOX7VWmEOGP2aj9cI5mQUSRyQOjv0dumU87cdYNUxi/2yL4jPw4ZUxn2D5EUykd Jpd6cCEmE4wvQak+AcZ8wyxILXqgDViAKLXxnOxkwKpSwArLpcRbTiYEaoqLebvLSpid 9Ibg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=zmail header.b=ciE8XK1P; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.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 nd18-20020a170907629200b00946bd53bbc8si218762ejc.403.2023.03.27.15.02.15; Mon, 27 Mar 2023 15:02:42 -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=@arinc9.com header.s=zmail header.b=ciE8XK1P; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.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 S230208AbjC0V7P (ORCPT + 99 others); Mon, 27 Mar 2023 17:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbjC0V7J (ORCPT ); Mon, 27 Mar 2023 17:59:09 -0400 Received: from sender4-op-o10.zoho.com (sender4-op-o10.zoho.com [136.143.188.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4118D30D3; Mon, 27 Mar 2023 14:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679954286; cv=none; d=zohomail.com; s=zohoarc; b=anV16UVMtNp/NW2ItYLiRB4AQ1SLN50vfbExP7irbCMV9YCnPN8JgnZff1N4KZ4OCApLXdn/m/9f1OKbZRLTniTMpR0AeV9WVbxb88/xdMM5opnS2lF1cpi0s7NDNV9t0JUItFQaoKsCvj0bf0qwd9tB8WCVYOGC7y0oEC52xao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679954286; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=m3Nxnw2EJKi8PgND390b4ttccCknFAa+VCeuBtlni8M=; b=F99QbKOhBuUMdCEMnGaJw5EdSw2SS4kCm822f0A913FJ4g3N0PXHDdc70fCskgcCR1Pb0KZ7Znobd572rOywpd3Dt86MZ3S7v1dy3ewywfxnw1IlyAXhVhlscqLGVyND4piXdfLuqVa8Tn7lIpw95yyjChuhNZpeL6BoIIu5B2o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=arinc9.com; spf=pass smtp.mailfrom=arinc.unal@arinc9.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1679954286; s=zmail; d=arinc9.com; i=arinc.unal@arinc9.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=m3Nxnw2EJKi8PgND390b4ttccCknFAa+VCeuBtlni8M=; b=ciE8XK1PKqy/bE+GnsMM82LHIa2TtViiZ1rMMxc0lyZi2Wde8VL628n6LTpIyEgK ETSgndvMVoSDkOx8t99wmW5jnfweSGjh+yza1K3XxQzaJ3ZhM9ChFTJIpqJI0ncSlFR CfeKkCTQr0Azx2Qy12XWLcb+6ofC0oS1/EZErJus= Received: from [10.10.10.3] (149.91.1.15 [149.91.1.15]) by mx.zohomail.com with SMTPS id 1679954284745209.8283533930612; Mon, 27 Mar 2023 14:58:04 -0700 (PDT) Message-ID: <8450084e-1474-17fa-32c2-a4653b74ff17@arinc9.com> Date: Tue, 28 Mar 2023 00:57:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH net 4/7] net: dsa: mt7530: set both CPU port interfaces to PHY_INTERFACE_MODE_NA Content-Language: en-US To: Vladimir Oltean Cc: Sean Wang , Landen Chao , DENG Qingfang , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , =?UTF-8?Q?Ren=c3=a9_van_Dorst?= , Russell King , Ilya Lipnitskiy , Richard van Schagen , Richard van Schagen , Frank Wunderlich , erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230326140818.246575-1-arinc.unal@arinc9.com> <20230326140818.246575-5-arinc.unal@arinc9.com> <20230327191242.4qabzrn3vtx3l2a7@skbuf> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20230327191242.4qabzrn3vtx3l2a7@skbuf> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,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 On 27.03.2023 22:12, Vladimir Oltean wrote: > On Sun, Mar 26, 2023 at 05:08:15PM +0300, arinc9.unal@gmail.com wrote: >> From: Arınç ÜNAL >> >> Set interfaces of both CPU ports to PHY_INTERFACE_MODE_NA. Either phylink >> or mt7530_setup_port5() on mt7530_setup() will handle the rest. >> >> This is already being done for port 6, do it for port 5 as well. >> >> Fixes: 38f790a80560 ("net: dsa: mt7530: Add support for port 5") > > This is getting comical.. I think I'm putting too much energy in > trying to understand the hidden meaning of this patch set. > > In include/linux/phy.h we have: > > typedef enum { > PHY_INTERFACE_MODE_NA, > > In lack of other initializer, the first element of an enum gets the > value 0 in C. > > Then, "priv" is allocated by this driver with devm_kzalloc(), which > means that its entire memory is zero-filled. So priv->p5_interface and > priv->p6_interface are already set to 0, or PHY_INTERFACE_MODE_NA. > > There is no code path between the devm_kzalloc() and the position in > mt7530_setup() that would change the value of priv->p5_interface or > priv->p6_interface from their value of 0 (PHY_INTERFACE_MODE_NA). > For example, mt753x_phylink_mac_config() can only be called from > phylink, after dsa_port_phylink_create() was called. But > dsa_port_phylink_create() comes later than ds->ops->setup() - one comes > from dsa_tree_setup_ports(), and the other from dsa_tree_setup_switches(). > > The movement of the priv->p6_interface assignment with a few lines > earlier does not change anything relative to the other call sites which > assign different values to priv->p6_interface, so there isn't any > functional change there, either. > > So this patch is putting 0 into a variable containing 0, and claiming, > through the presence of the Fixes: tag and the submission to the "net" > tree, that it is a bug fix which should be backported to "stable". > > Can it be that you are abusing the meaning of a "bug fix", and that I'm > trying too hard to take this patch set seriously? I don't appreciate your consistent use of the word "abuse" on my patches. I'm by no means a senior C programmer. I'm doing my best to correct the driver. Thank you for explaining the process of phylink with DSA, I will adjust my patches accordingly. I suggest you don't take my patches seriously for a while, until I know better. Arınç