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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43B70C48BD7 for ; Wed, 15 Nov 2023 14:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WwfI4aNsDkmGr5lY70WtEPTWeHhAykg5joXdSuC/VQs=; b=ORUfuwyHoXRnM1 qVCyHsZ4/n9PnCeU+W6/0cW36tDxEFSDseIfIKzX5LIUZp3jP7ggBO1R/77iYyfy/Zc+R4bHIqeD+ wJkktCgRo69blnC1GsVYDaopowDBJpts9GnT9hghad/3LZoRCgb3L1cNLSGa/pY3sbW1QV1WlvnhE towBg27UiGq88IiLwRi7DWTm9b8m+CKehc7oXsY/3O8KLgMv6uic+SO2xQbwy7oXqyYKsU2UCITxJ PoekaCQyw2+YInHorE0jTGaZFTx8NdWBkK0iu8Tzu9O32eZpHaU52DZn9DhhBpfBEzJECDfStkDfy f/XXp1u+KdDYF04Qh9wQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3Goj-00104P-10; Wed, 15 Nov 2023 14:24:33 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3Gof-00102t-2L for linux-arm-kernel@lists.infradead.org; Wed, 15 Nov 2023 14:24:31 +0000 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 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_062429_930859_D8E32AB4 X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel