Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3292936rwl; Mon, 27 Mar 2023 11:52:16 -0700 (PDT) X-Google-Smtp-Source: AKy350ZxmWK+ncSirAkRhsV/0p1lLTgyf697yWSiiPgshIotxnvSQj9jfAjiL3ZcjTacWOO5g0FX X-Received: by 2002:a17:902:fa48:b0:1a0:7508:daf2 with SMTP id lb8-20020a170902fa4800b001a07508daf2mr12575527plb.2.1679943136692; Mon, 27 Mar 2023 11:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679943136; cv=none; d=google.com; s=arc-20160816; b=Xje5htR4O3pLVY5H7CGoNNYNMMqNgTsWkOmTIxwyxYfbUlEDXzhy1wx+TTuVnPtEtx 0XPBXsrKMgplaSPAK5aBQVcguIEqUxP7eF5dcf4lQXdwrdyk7DIIiwuIQKAFnnhww9zT I2bZwL9VU5u3RQeT6CzdQOdkBbkB9FWBC+r377g8EpFOecz0zM1PK9zUi1jSjUDRRQyD 70+PYSOm5u9uKE8wc/icSbens9xwTlCsHpcyfQDvwAnlmNw8WaAifvG5BULi2upy0DhU JhchnHMwBQ6N6EW0v/wQtcGjtmWQ/1VjehEdAAUKPLH58hCkUp/ME9wGfQoDjQwxHHgo 5rTw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WV8Ob0uf4bBIKDlLtZZnzrbTAhR4hy3V64r28D4o5YY=; b=BEXyeuromdyZ6fuY58eTBEKh1XXAikSF1Ge2gTlBmfwIWOJlPr0A8ZFJNMiIolZd7U MpPYSRomu+6NhjkhRSQ60GHJpjyceRYWN35jTj/3i+6mCHRs7h1LQsDS70T/yWwyNGkP tqSG1TMCkwt/tZpD6RN8Z9QgIe/2p0a6mDZvtMOABKCoJnMauZh8FxxzsgSGmUwkTD1X LJmNRhia5DRr5K0JlaLnnJoMIyfcfTnPoU5XImvPUdN48xEgzj6zUP85pmxp+ti0Wapo j9X3QuYFxBKjzFgHsZ4d+hFI/LqF7gFgAhmzcqX6q8RDze+tjx1vMlrjDC0BJcSOH4OL 0zQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Gqu/bFJ3"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020a170902d48d00b0019b7766afdfsi28714806plg.626.2023.03.27.11.52.05; Mon, 27 Mar 2023 11:52:16 -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=@gmail.com header.s=20210112 header.b="Gqu/bFJ3"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229525AbjC0SuJ (ORCPT + 99 others); Mon, 27 Mar 2023 14:50:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbjC0St6 (ORCPT ); Mon, 27 Mar 2023 14:49:58 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 527931709; Mon, 27 Mar 2023 11:49:49 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id eh3so40123745edb.11; Mon, 27 Mar 2023 11:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679942988; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=WV8Ob0uf4bBIKDlLtZZnzrbTAhR4hy3V64r28D4o5YY=; b=Gqu/bFJ31hSb6EVqByUP2G55oy+x+jxUsnrUTS9y/idimRggaf3K4hUFSzP+hG9MRI sQfcvDM5RNFMd5ZDGyrznKLDx6NMzwD7SsllmCmntS4xXcKolnrK4SYXEncVSWCjcRRL ncut7EiyGFCMxso6b2qPxijfjp7cdtfRPUII5fzp4l31zRGZtGd+VwfkUzSowqA3Htq3 wokXFQRRkH7XOQAtjUDnqjcxcfpQ4e2MyXfjc3NKEGCddkxy7hiCNDfUBbZlUa001tt9 qJl1aqUEQ31uhApIu1qt02Lh8KzRABWxTuZGK6rcjgkuclGDQYi++LLK5FyNx5RdjYxN 3YFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679942988; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WV8Ob0uf4bBIKDlLtZZnzrbTAhR4hy3V64r28D4o5YY=; b=u+QRZTsPPqtqxn1vpFf3vDt3wXRwbdl8izk2rPMHvQNVqPFVmNj6umjeHoyL0KiZFn bG38/BNDbnOi+kB7ekTuMPn26bipUa8OOfhlWxiugGoSgMawaW0sEo+u+J6oQ4HqKAR0 YBwnPDDfTOCmGxXBWHh5o31ezXfVBrVy0KKfEzRd4gXMW/KIy8oh4Ua4YjoMfAEVhJOy hBMYsJO5NrytxbI2ROBuDad2nrWE5CEYBeVUx9Dr0ouDQ6R4cDGmAH76ZMszYoJgz/4l G+Q0fterqVpG0rgYy6xgpJM5naIeP7SE1h46OeDQbddJByHJsV48qxaFy+kl3y4UdHx7 8YQA== X-Gm-Message-State: AAQBX9ej6CWIGn5ZJdfw6wI360tXXX5RxLrIcDynjyCBCRIfw3ICoouO LXP6Uu7D952v1Q5jg7c6acQ= X-Received: by 2002:a17:907:8b88:b0:925:f788:d76d with SMTP id tb8-20020a1709078b8800b00925f788d76dmr13593874ejc.27.1679942987666; Mon, 27 Mar 2023 11:49:47 -0700 (PDT) Received: from skbuf ([188.27.184.189]) by smtp.gmail.com with ESMTPSA id b26-20020a170906195a00b00930a4e5b46bsm14301659eje.211.2023.03.27.11.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 11:49:47 -0700 (PDT) Date: Mon, 27 Mar 2023 21:49:44 +0300 From: Vladimir Oltean To: arinc9.unal@gmail.com 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?B?UmVuw6k=?= van Dorst , =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , 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 Subject: Re: [PATCH net 2/7] net: dsa: mt7530: fix phylink for port 5 and fix port 5 modes Message-ID: <20230327184944.oahce2iizpauw4nm@skbuf> References: <20230326140818.246575-1-arinc.unal@arinc9.com> <20230326140818.246575-3-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230326140818.246575-3-arinc.unal@arinc9.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, 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 Sun, Mar 26, 2023 at 05:08:13PM +0300, arinc9.unal@gmail.com wrote: > From: Arınç ÜNAL > > There're two call paths for setting up port 5: > > mt7530_setup() > -> mt7530_setup_port5() > > mt753x_phylink_mac_config() > -> mt753x_mac_config() > -> mt7530_mac_config() > -> mt7530_setup_port5() > > The first call path is supposed to run when phy muxing is being used. In > this case, port 5 is somewhat of a hidden port. It won't be defined on the > devicetree so phylink can't be used to manage the port. > > The second call path used to call mt7530_setup_port5() directly under case > 5 on mt7530_phylink_mac_config() before it was moved to mt7530_mac_config() > with 88bdef8be9f6 ("net: dsa: mt7530: Extend device data ready for adding a > new hardware"). mt7530_setup_port5() will never run through this call path > because the current code on mt7530_setup() bypasses phylink for all cases > of port 5. > > Leave it to phylink if port 5 is used as a CPU port or a user port. For the > cases of phy muxing or the port being disabled, call mt7530_setup_port5() > directly from mt7530_setup_port5() without involving phylink. You probably don't mean "call X() from X()" (that would make it recursive), but maybe from mt7530_setup(). But it was already called from mt7530_setup(), so I don't understand what is being transmitted here... > > Move setting the interface and P5_DISABLED mode to a more specific > location. They're supposed to be overwritten if phy muxing is detected. > > Add comments which explain the process. > > Fixes: 38f790a80560 ("net: dsa: mt7530: Add support for port 5") > Tested-by: Arınç ÜNAL > Signed-off-by: Arınç ÜNAL > --- Sorry, I didn't understand... so what was the problem, and how does the movement of the mt7530_setup_port5() call that isn't under phylink solve that problem?