Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2629375rdb; Wed, 15 Nov 2023 06:25:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTmqp2Yro2+egettfbNz2bs/uuWPB5YOcQEJp5ao8RsVS6ReyKYmAnK6I21B3VAu41AwlS X-Received: by 2002:a05:6a21:a583:b0:187:63b1:94c with SMTP id gd3-20020a056a21a58300b0018763b1094cmr2413319pzc.56.1700058302336; Wed, 15 Nov 2023 06:25:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700058302; cv=none; d=google.com; s=arc-20160816; b=ECCXCoHexsgsk1HPShBZnBzbEaPWOo3qQIwdnoLekqOKHZ+EnyiQgR3/E/UJEuQgKw /HuP0r6+O97rvFA7BN2XQD7BUWl2JetH22D1VtuA/2T5/nu+KC7tIALCd1A6IN2T54sU xGoRLIghTMeLQJeFjNvrC72Jjhnt/2w4LkoN6JhbC6/0CSz34pcthFonSqlOmTFkCPcC jrtg8+0Acukv7zonknpWtUxYUQAUYnM2Qrv9SWUs4GH/JXrTKy/qcmGWkLndKGOxRODj TrV0wsvttbHiML87VX9mS2YuIZdlW1lUynC3BkbGxU3YR7K+FYOfkCXbmwCFbOyRqxT7 IMrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=o95CTeV4om7p3zXCFThJzE74VGhCEm09N2PyQwbv0X8=; fh=OydBOjRH2VSVVSqnJy989a6Z8by/BoOGpLedHOC+Ecw=; b=D6HaAXv8v3uGf+bEj0ue48SK9DMrMMVpt2+757ziJ5D7onOya6C7rZ/9oj8CNH95/o rKlA2l4Skase+9B85XjmGazq9x+Czk747dtp7I6C2b8FGiNuGXrl6Yz3PLmq3P9Ntz/G TH1dVi/2CEnFyVspwd3MJhxOuk5enKcjROP8EFX4YQzriyCSfezMrBwDPsGwvWXCCEuF NLj2BsKObm6jtT+UH0+MkunsHlftVBVQtykWjVn0GwheZ6ulcxDSZvWm0qa344Ie7eSN cdCjIsQh3xlfjmFmNTS42tDEhrGmyZMtE21EancgEdD/9kw6eF4dNvv+nAPC+sOcvLxR nwuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Bn2RZwDO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id e21-20020a635455000000b005b8de051ac6si9737635pgm.111.2023.11.15.06.24.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:25:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Bn2RZwDO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 747A98026D88; Wed, 15 Nov 2023 06:24:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344191AbjKOOYd (ORCPT + 99 others); Wed, 15 Nov 2023 09:24:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344116AbjKOOYc (ORCPT ); Wed, 15 Nov 2023 09:24:32 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D636E7; Wed, 15 Nov 2023 06:24:26 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5D90C1BF203; Wed, 15 Nov 2023 14:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700058264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=o95CTeV4om7p3zXCFThJzE74VGhCEm09N2PyQwbv0X8=; b=Bn2RZwDOGrLsOcdbw80S3FjkZg7GLKrKK763aTT81E0zWNQCwiDk1Q6dKKi95CYXBXbMWe hQ0FICnfz/3E8jN94UUhgQBV6jlXnQCt5+Y4oH2It4S/cig9DXuM3aFZzM0C+uQ0e1aSR8 jcGsya9AKRBnGFpFHRr2NXbO2B5cOm1/mDtFR2M81jXivDAQa6/o29BjA5RVURAL2t5i+2 bpXS+S8XMI5gceb8FbuZIbxGiOq1U+5S9R9TYuyTAO9K5EzSYxa1GFqT/VVU38ojZiHhq2 F5TeyBWYTyBUhjQqH8TzvjmLxcCSsu0h4mq2fyYysK9/kfJM2o1bJvGab9chdw== Date: Wed, 15 Nov 2023 15:24:37 +0100 (CET) From: Romain Gantois To: Andrew Lunn cc: Romain Gantois , davem@davemloft.net, Rob Herring , Krzysztof Kozlowski , Jakub Kicinski , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko , Andy Gross , Bjorn Andersson , Konrad Dybcio Subject: Re: [PATCH net-next v3 3/8] net: qualcomm: ipqess: introduce the Qualcomm IPQESS driver In-Reply-To: Message-ID: References: <20231114105600.1012056-1-romain.gantois@bootlin.com> <20231114105600.1012056-4-romain.gantois@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-GND-Sasl: romain.gantois@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 06:24:40 -0800 (PST) On Tue, 14 Nov 2023, Andrew Lunn wrote: ... > > + phy_support_asym_pause(phy); > > + > > + ipqess_port_set_state_now(port, BR_STATE_FORWARDING, false); > > + > > + if (port->pl) > > + phylink_start(port->pl); > > That looks odd. You unconditionally call phy_support_asym_pause() yet > conditionally call phylink_start(). I would expect there to always be > a phylink instance. > > Also, you should be telling phylink about the pause capabilities in > config->mac_capabilities. It is then phylinks problem to tell the PHY, > or the PCS driving the SFP etc about pause. You are correct. I probably fumbled this when splitting the calibration code. > > + if (tx_pause || port->index == 0) > > + reg |= QCA8K_PORT_STATUS_TXFLOW; > > + } > > + > > + reg |= QCA8K_PORT_STATUS_TXMAC | QCA8K_PORT_STATUS_RXMAC; > > + > > + qca8k_write(priv, QCA8K_REG_PORT_STATUS(port->index), reg); > > +} > > qca8k_phylink_mac_link_up() with some refactoring can be > reused. Please look through the driver and find other instances like > this where you can reuse more code. I tried to be conservative with modifying qca8k-common.c when it required modifying qca8k-8xxx.c. But I'll factor this code more aggressively since you think it is preferable. Best, -- Romain Gantois, Bootlin Embedded Linux and Kernel engineering https://bootlin.com