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 0B17DC433EF for ; Mon, 14 Feb 2022 09:35:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243872AbiBNJfh (ORCPT ); Mon, 14 Feb 2022 04:35:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244057AbiBNJfL (ORCPT ); Mon, 14 Feb 2022 04:35:11 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE1C869CC2; Mon, 14 Feb 2022 01:33:01 -0800 (PST) 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 BD7C860FFC; Mon, 14 Feb 2022 09:33:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1E76C340E9; Mon, 14 Feb 2022 09:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831181; bh=gc3KeIapCurk3kq/KRk6/Q2EGl0JGhbdYslSbDyqMpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eTz96RmQbtZGtMg0yWEaGHC9ykqaMwA28qrnQDzmSgkGvfRbjJNDgwnfGKS5CxqW/ oGCyNL2ZK8bflS8D10/3PFvjj11n34i5HxY3drLYpwusv4XWJRxC3aU3sW1yxKZXMs B4Sd6fVksGD8/YvXFMPX5tnDy39wwr9DX2TeTRFc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Parkhomenko , Serge Semin , Andrew Lunn , "David S. Miller" Subject: [PATCH 4.19 05/49] net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs Date: Mon, 14 Feb 2022 10:25:31 +0100 Message-Id: <20220214092448.476456387@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092448.285381753@linuxfoundation.org> References: <20220214092448.285381753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Parkhomenko commit aec12836e7196e4d360b2cbf20cf7aa5139ad2ec upstream. When setting up autonegotiation for 88E1118R and compatible PHYs, a software reset of PHY is issued before setting up polarity. This is incorrect as changes of MDI Crossover Mode bits are disruptive to the normal operation and must be followed by a software reset to take effect. Let's patch m88e1118_config_aneg() to fix the issue mentioned before by invoking software reset of the PHY just after setting up MDI-x polarity. Fixes: 605f196efbf8 ("phy: Add support for Marvell 88E1118 PHY") Signed-off-by: Pavel Parkhomenko Reviewed-by: Serge Semin Suggested-by: Andrew Lunn Cc: stable@vger.kernel.org Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/marvell.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -899,16 +899,15 @@ static int m88e1118_config_aneg(struct p { int err; - err = genphy_soft_reset(phydev); + err = marvell_set_polarity(phydev, phydev->mdix_ctrl); if (err < 0) return err; - err = marvell_set_polarity(phydev, phydev->mdix_ctrl); + err = genphy_config_aneg(phydev); if (err < 0) return err; - err = genphy_config_aneg(phydev); - return 0; + return genphy_soft_reset(phydev); } static int m88e1118_config_init(struct phy_device *phydev)