Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5969567pxb; Mon, 14 Feb 2022 11:59:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMZL80x+C6bEdK66EWNtl9Rvcc87kgSYdTYVPM6mIvMsiXQyJvU2AGxCBroOHULp3R0tSl X-Received: by 2002:a63:88c6:: with SMTP id l189mr517257pgd.425.1644868770634; Mon, 14 Feb 2022 11:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644868770; cv=none; d=google.com; s=arc-20160816; b=yMz4iuF8+JKqQT5uH5IiJrKKMX3Wja5Xu1b5y5tE+AdxuQpec9dHvFjyCBIUzKtatn //fybigFs7/fwy3kqQkAt+0XoTMEeqKKiuBzE+KCsLRMsi//ZAtXltTXaB+5AVhVI8rP bUYvtaxOFSQKxr+6EMXSE5qC02iqudbLTB9W9LomGxKMed8LAJH63YpXBZ/jhOVwhM/x S1hZAqPQH4eYzHo/M4nOtZcsltrNNroT6OM+FhBdB68ALJY13hlOJ5zEDPpgodZdlZFT xOKr94ZfVyBnP5stBRI42zD+W+lTCozbr64Dqs1YqZTk06yPVHxj3WuJkk0A0VmZur5t NgZQ== 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=+cyYyFA1Etb5gnU/4IPiW4CqQ4BoxWMvrCH//nWfumM=; b=aMrjL/DEgwhFZ1yXHhWvqXY9KVSJ9Ux/DDzfYdXnmqsm0nJadkQk8rxJdJb9I/SJFv uhXCWXS8OAo2jfoGtUGEpu4RF9akeedaQYDp5wrRCANn+4+GUFfOZdPPHLGYe1HHmTeS hBpDaJ5rIPaKyC3wfNn6YXYMxc0G7XDc4QM+gRgX47uQi9hV96QjLX45HsIe2ifhcS3s 3hsk+QWju8kabnwFRe6NtlHnRpuicaS1CjFwFg+BwQeYxI9bVUQvXjyG8UPB7pYy3MIz v4DkPamv8As8Dqsu79mD2iSVKT3526fBMpg9Jes1HwPGEx/s49UJpD1oog2r1bPR8sDl ttUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1PvlB7DZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i8si14304069plr.458.2022.02.14.11.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:59:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1PvlB7DZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 485E9108550; Mon, 14 Feb 2022 11:40:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244632AbiBNJmN (ORCPT + 99 others); Mon, 14 Feb 2022 04:42:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244798AbiBNJkx (ORCPT ); Mon, 14 Feb 2022 04:40:53 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFE44654B6; Mon, 14 Feb 2022 01:36:10 -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 5F285B80DC9; Mon, 14 Feb 2022 09:36:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 801C6C340E9; Mon, 14 Feb 2022 09:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831368; bh=gGQFnzvZjnADsg7z9khUQHIYTx80Q+Yq9tUqr0l1S4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1PvlB7DZiOaPx1qfv6nnWR506qUn8wYYo8rHZ10QPqBkB68FcVm5WZaaJSDuBAEiv mzBODNAVCiS0+qjLLevw2r2GblhvkIEpQ252gabLAx9mBt9u3wCwkaJoksWQfEQPlj 5ARoqgHrjl8gPqaOKD8R2rZ6SXa+A6A/BLnPXSJw= 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.4 06/71] net: phy: marvell: Fix RGMII Tx/Rx delays setting in 88e1121-compatible PHYs Date: Mon, 14 Feb 2022 10:25:34 +0100 Message-Id: <20220214092452.247922016@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092452.020713240@linuxfoundation.org> References: <20220214092452.020713240@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 @@ -444,9 +444,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) @@ -460,11 +460,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)