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 55573C433F5 for ; Tue, 10 May 2022 15:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346526AbiEJPvC (ORCPT ); Tue, 10 May 2022 11:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346425AbiEJPu1 (ORCPT ); Tue, 10 May 2022 11:50:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BCCE285EEC; Tue, 10 May 2022 08:44:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D4DB614A6; Tue, 10 May 2022 15:44:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 200B6C385C9; Tue, 10 May 2022 15:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652197490; bh=vZdRIDVqM66QB63azHQopN9rJHE8RLDYHyQI+u2FgXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E1C1xN80cnu+ny3l4cIcd9DD7VkCJmFtG/1D2dQwYFLSE7sVFEAwXftvQMwJNhMiI rVcgnObECAky99QtW5BYMbZRvTHTgb3tFJ2JMS8Pmr7JBO1uy3dcyFBK3624hd+v7o bWyO4J4NeJSU0XT6RdjKDiacUy0bN0QXF44vgOBoXRAs29itFMdLGxHk4bYgyCxXQg bzihH7dOb3H1SDEs2u8ct4o4Do1SANUt7eZiKNLYmfc3uoT6d6p7Zs0dSJAzZ8daYm uLtskxdsaPB3/7Z14dq5tCHvg/GAMTbgMymw4cE0qL22KMv0mwZAheCYVosQ3FNWr6 xT3ES86DgoN8g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shravya Kumbham , Radhey Shyam Pandey , Andrew Lunn , Paolo Abeni , Sasha Levin , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, michal.simek@xilinx.com, linmq006@gmail.com, yuehaibing@huawei.com, trix@redhat.com, prabhakar.mahadev-lad.rj@bp.renesas.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 10/19] net: emaclite: Don't advertise 1000BASE-T and do auto negotiation Date: Tue, 10 May 2022 11:44:20 -0400 Message-Id: <20220510154429.153677-10-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220510154429.153677-1-sashal@kernel.org> References: <20220510154429.153677-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shravya Kumbham [ Upstream commit b800528b97d0adc3a5ba42d78a8b0d3f07a31f44 ] In xemaclite_open() function we are setting the max speed of emaclite to 100Mb using phy_set_max_speed() function so, there is no need to write the advertising registers to stop giga-bit speed and the phy_start() function starts the auto-negotiation so, there is no need to handle it separately using advertising registers. Remove the phy_read and phy_write of advertising registers in xemaclite_open() function. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 5524ac4fae80..cc15d4c53a12 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -925,8 +925,6 @@ static int xemaclite_open(struct net_device *dev) xemaclite_disable_interrupts(lp); if (lp->phy_node) { - u32 bmcr; - lp->phy_dev = of_phy_connect(lp->ndev, lp->phy_node, xemaclite_adjust_link, 0, PHY_INTERFACE_MODE_MII); @@ -937,19 +935,6 @@ static int xemaclite_open(struct net_device *dev) /* EmacLite doesn't support giga-bit speeds */ phy_set_max_speed(lp->phy_dev, SPEED_100); - - /* Don't advertise 1000BASE-T Full/Half duplex speeds */ - phy_write(lp->phy_dev, MII_CTRL1000, 0); - - /* Advertise only 10 and 100mbps full/half duplex speeds */ - phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL | - ADVERTISE_CSMA); - - /* Restart auto negotiation */ - bmcr = phy_read(lp->phy_dev, MII_BMCR); - bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART); - phy_write(lp->phy_dev, MII_BMCR, bmcr); - phy_start(lp->phy_dev); } -- 2.35.1 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 7B273C433EF for ; Tue, 10 May 2022 15:46:07 +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:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sPNHCV+/SP5WmZTg3yQVLxqCzX3FORMhXQAB7KYaoNI=; b=4jGHBtRIRlXgl7 U+iYJJbiKehSC2UL5thPWyop+sW4mNNLYeHmC8kT4BMQ5JJh/eQDh2GJxLc9aY4C873Gph7o8DnrY 9/cHhFdLz5EuQJDBK8lLoB+E+Ka2WVAtP1nQud4KD2w/ZIekKEkiFbSRPkvIJ5FfNBkvlfhpQKK6s NGemBSBOPI20W22fXDKpV2lU+dquQNtq6BUaaLG2kVKTzWmWVA92IeIjGw3eTHtXkn9c+1h0Ek+4c YV7yZV8JBhsTx2x7+QBe7RYWbe7O/61yb5R6YMCiWuKrO09e69I3/Rj8sfZRit7jy25KWBEpqV042 M/rWAOFIozuiVrdoWDVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1noS2j-002oCd-NI; Tue, 10 May 2022 15:44:57 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1noS2g-002o96-8d for linux-arm-kernel@lists.infradead.org; Tue, 10 May 2022 15:44:56 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ECBBFB81DB5; Tue, 10 May 2022 15:44:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 200B6C385C9; Tue, 10 May 2022 15:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652197490; bh=vZdRIDVqM66QB63azHQopN9rJHE8RLDYHyQI+u2FgXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E1C1xN80cnu+ny3l4cIcd9DD7VkCJmFtG/1D2dQwYFLSE7sVFEAwXftvQMwJNhMiI rVcgnObECAky99QtW5BYMbZRvTHTgb3tFJ2JMS8Pmr7JBO1uy3dcyFBK3624hd+v7o bWyO4J4NeJSU0XT6RdjKDiacUy0bN0QXF44vgOBoXRAs29itFMdLGxHk4bYgyCxXQg bzihH7dOb3H1SDEs2u8ct4o4Do1SANUt7eZiKNLYmfc3uoT6d6p7Zs0dSJAzZ8daYm uLtskxdsaPB3/7Z14dq5tCHvg/GAMTbgMymw4cE0qL22KMv0mwZAheCYVosQ3FNWr6 xT3ES86DgoN8g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shravya Kumbham , Radhey Shyam Pandey , Andrew Lunn , Paolo Abeni , Sasha Levin , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, michal.simek@xilinx.com, linmq006@gmail.com, yuehaibing@huawei.com, trix@redhat.com, prabhakar.mahadev-lad.rj@bp.renesas.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 10/19] net: emaclite: Don't advertise 1000BASE-T and do auto negotiation Date: Tue, 10 May 2022 11:44:20 -0400 Message-Id: <20220510154429.153677-10-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220510154429.153677-1-sashal@kernel.org> References: <20220510154429.153677-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220510_084454_611257_8AEF5F4E X-CRM114-Status: GOOD ( 11.00 ) 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 From: Shravya Kumbham [ Upstream commit b800528b97d0adc3a5ba42d78a8b0d3f07a31f44 ] In xemaclite_open() function we are setting the max speed of emaclite to 100Mb using phy_set_max_speed() function so, there is no need to write the advertising registers to stop giga-bit speed and the phy_start() function starts the auto-negotiation so, there is no need to handle it separately using advertising registers. Remove the phy_read and phy_write of advertising registers in xemaclite_open() function. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 5524ac4fae80..cc15d4c53a12 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -925,8 +925,6 @@ static int xemaclite_open(struct net_device *dev) xemaclite_disable_interrupts(lp); if (lp->phy_node) { - u32 bmcr; - lp->phy_dev = of_phy_connect(lp->ndev, lp->phy_node, xemaclite_adjust_link, 0, PHY_INTERFACE_MODE_MII); @@ -937,19 +935,6 @@ static int xemaclite_open(struct net_device *dev) /* EmacLite doesn't support giga-bit speeds */ phy_set_max_speed(lp->phy_dev, SPEED_100); - - /* Don't advertise 1000BASE-T Full/Half duplex speeds */ - phy_write(lp->phy_dev, MII_CTRL1000, 0); - - /* Advertise only 10 and 100mbps full/half duplex speeds */ - phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL | - ADVERTISE_CSMA); - - /* Restart auto negotiation */ - bmcr = phy_read(lp->phy_dev, MII_BMCR); - bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART); - phy_write(lp->phy_dev, MII_BMCR, bmcr); - phy_start(lp->phy_dev); } -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel