From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B743C48BF9 for ; Wed, 15 Nov 2023 14:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344201AbjKOOYd (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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