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 E2CC5ECAAA1 for ; Thu, 27 Oct 2022 17:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236853AbiJ0RCh (ORCPT ); Thu, 27 Oct 2022 13:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236868AbiJ0RCf (ORCPT ); Thu, 27 Oct 2022 13:02:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D542818DD7E for ; Thu, 27 Oct 2022 10:02:34 -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 72517623F0 for ; Thu, 27 Oct 2022 17:02:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82B6DC433B5; Thu, 27 Oct 2022 17:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666890153; bh=723QCM8qTb6L6VHrN16jCsxgnQI3lgPy5nFs9FHm+IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dvu5z1EqXIePpjtRw3dz3m1rPj8eguxtqnDlCVha38MTXwc36sudDE9nIY4N4Q+tc DdIQmm9F3/bIy2dx76irbPeDXm1xKBFbdT+mSMAIlzIxMUNaxSSs08YEOLFH34V+T9 Teog7E19svSLobTVGvV3ppFqb2KmEC2qnysXARZg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Harini Katakam , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 42/79] net: phy: dp83867: Extend RX strap quirk for SGMII mode Date: Thu, 27 Oct 2022 18:55:40 +0200 Message-Id: <20221027165056.309185483@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221027165054.917467648@linuxfoundation.org> References: <20221027165054.917467648@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Harini Katakam [ Upstream commit 0c9efbd5c50c64ead434960a404c9c9a097b0403 ] When RX strap in HW is not set to MODE 3 or 4, bit 7 and 8 in CF4 register should be set. The former is already handled in dp83867_config_init; add the latter in SGMII specific initialization. Fixes: 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy") Signed-off-by: Harini Katakam Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/dp83867.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index d097097c93c3..783e30451e30 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -791,6 +791,14 @@ static int dp83867_config_init(struct phy_device *phydev) else val &= ~DP83867_SGMII_TYPE; phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL, val); + + /* This is a SW workaround for link instability if RX_CTRL is + * not strapped to mode 3 or 4 in HW. This is required for SGMII + * in addition to clearing bit 7, handled above. + */ + if (dp83867->rxctrl_strap_quirk) + phy_set_bits_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4, + BIT(8)); } val = phy_read(phydev, DP83867_CFG3); -- 2.35.1