Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6005486pxb; Mon, 14 Feb 2022 12:57:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHkk0mMxR8zt7p4lS5cjiF3AvZLnpQP1TuB++CO0pnp47tuXqkyxkzdoUaumopTsq2cl6Q X-Received: by 2002:a17:903:2406:: with SMTP id e6mr706079plo.21.1644872265085; Mon, 14 Feb 2022 12:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644872265; cv=none; d=google.com; s=arc-20160816; b=pvil3hnlW/+7YQ8gQyivPGJXWOU1/pGeyjOf68PzNpcA9V8Z+Lh7gr7BF/CISZEdDF l9Wyc3d90HxeWOin6IBpgM300zqHNJ2RBIdAGeYPd+RVK1ucksJp7OzZzKETcyux2uCK 4MRgvWE9HDKWEmQazgvgaetRbk4C4fWlMiif92FslPI2NbejGeHPg4Lfv7rVLgIqZENl OnNW1mrzTsjfYIVrpq974PM7TCJU4PHc2g8Mtj6ng5QM5L58aDwDQe8OJfhwif+CGg/R wSr5KtGMAih6rCMiQxr5kTxHt9sNSOkN8qfmqBUkvP/I6s2kYt4m6B9byvGiFt///y36 FIKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bpLK77Ujso91IsyNGT7MkI5jkcasrKT4OyzcVKEQUlE=; b=HvH2426bwfvJNeKSgixj8O/0Lmb0PJydq7cTCEEog2VSd7VKhSEu+sDZTy8LKxOWqP 7OY8EwZTOlWyPxor3kDOzCiVoi0S25zGueY4eP3T+1stCUjquJSeEnSb9RYE137zU8qV x+4q7e9y1hmVh2SbkQaRtGpI6WqqbAkLeVkoLnMD5I+jGxH+IgD3aIEY+sW0PMLhAuxm VK/5o7SgQ8hDKZMmKN0FTjpF3Y2an8IVJklIqwHO7btl88/RIhpa1Zfi5Io5LiPMDPfG UkxgxykgsyUnDLMM5pFhkLjlBis3BEHtmldYHM3HsKElgUGnJab99zR3T9cmOsEpuTpi LjEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CuM3juVU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e3si14505350plo.515.2022.02.14.12.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 12:57:45 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CuM3juVU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E652C178BC6; Mon, 14 Feb 2022 12:20:45 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343729AbiBNJvQ (ORCPT + 99 others); Mon, 14 Feb 2022 04:51:16 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344243AbiBNJqq (ORCPT ); Mon, 14 Feb 2022 04:46:46 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D94A74842; Mon, 14 Feb 2022 01:40:23 -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 ams.source.kernel.org (Postfix) with ESMTPS id CECEBB80DCC; Mon, 14 Feb 2022 09:40:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7032C340E9; Mon, 14 Feb 2022 09:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831612; bh=tBAxUNn4Q4FhGTcSQRgMTXs/kisbN/cZYWabXto48uc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CuM3juVUidzCb/PHr5/cgVDrkz2AJ/XZ+MWIODH4lGwQ7fVY2nl0mWumaXwAHRFVt O41bhWhPsWCZh+RDWKZkRJ7cVRkvir6deg7253EBhylRxKHub680LUs6McWb4gdODD 8uQgkkORfi8tDmRMEUTOo5NCdd4SOQ9BnO36kvD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Parkhomenko , "Russell King (Oracle)" , Serge Semin , Jakub Kicinski Subject: [PATCH 5.10 007/116] net: phy: marvell: Fix RGMII Tx/Rx delays setting in 88e1121-compatible PHYs Date: Mon, 14 Feb 2022 10:25:06 +0100 Message-Id: <20220214092458.927886784@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Parkhomenko commit fe4f57bf7b585dca58f1496c4e2481ecbae18126 upstream. It is mandatory for a software to issue a reset upon modifying RGMII Receive Timing Control and RGMII Transmit Timing Control bit fields of MAC Specific Control register 2 (page 2, register 21) otherwise the changes won't be perceived by the PHY (the same is applicable for a lot of other registers). Not setting the RGMII delays on the platforms that imply it' being done on the PHY side will consequently cause the traffic loss. We discovered that the denoted soft-reset is missing in the m88e1121_config_aneg() method for the case if the RGMII delays are modified but the MDIx polarity isn't changed or the auto-negotiation is left enabled, thus causing the traffic loss on our platform with Marvell Alaska 88E1510 installed. Let's fix that by issuing the soft-reset if the delays have been actually set in the m88e1121_config_aneg_rgmii_delays() method. Cc: stable@vger.kernel.org Fixes: d6ab93364734 ("net: phy: marvell: Avoid unnecessary soft reset") Signed-off-by: Pavel Parkhomenko Reviewed-by: Russell King (Oracle) Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20220205203932.26899-1-Pavel.Parkhomenko@baikalelectronics.ru Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/marvell.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -515,9 +515,9 @@ static int m88e1121_config_aneg_rgmii_de else mscr = 0; - return phy_modify_paged(phydev, MII_MARVELL_MSCR_PAGE, - MII_88E1121_PHY_MSCR_REG, - MII_88E1121_PHY_MSCR_DELAY_MASK, mscr); + return phy_modify_paged_changed(phydev, MII_MARVELL_MSCR_PAGE, + MII_88E1121_PHY_MSCR_REG, + MII_88E1121_PHY_MSCR_DELAY_MASK, mscr); } static int m88e1121_config_aneg(struct phy_device *phydev) @@ -531,11 +531,13 @@ static int m88e1121_config_aneg(struct p return err; } + changed = err; + err = marvell_set_polarity(phydev, phydev->mdix_ctrl); if (err < 0) return err; - changed = err; + changed |= err; err = genphy_config_aneg(phydev); if (err < 0)