Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp858003pxb; Tue, 1 Feb 2022 11:53:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8OYnk28TR5ojS+1cwhC7CPEqCYD4PYrJeFyX9LpTWZxqfgsyzp2xDrRv6sQqwxBJ0e9Md X-Received: by 2002:a05:6a00:2cf:: with SMTP id b15mr12624466pft.0.1643745222940; Tue, 01 Feb 2022 11:53:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745222; cv=none; d=google.com; s=arc-20160816; b=Om8Dp4SVma4ftrV453nrh36W2hASrkSLeyl6fo6Jx+nLmGq/LeR2N78vpXjUSyqSth r/Ze18/ZF8yv89ubJwVMMitOpio6nRYMlGmG8GRBe6190eZvGQFkM5Oz1569KPEqQPVt zIxj2yGOQcuYB9jjEq4QEItDfKWNZKKYSQtixTWoqbJSOW/fIgb4er/6FnazsO6GzHw/ uqUnNkeL6Dof8EYJZKiqIwhZRAFJXmA2dBwCgrEAmPd7/9AoV95+PKTqyz0uvXLiUubK bws8GCZXMCfNClspoNTfBigG5a28tswHBVBAvoKfuVzL6Q2Gfsgms16tRLBk5QgEOdYt aa3g== 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=nTxBKTPyfbpvQPyBnoL8u855oKW0Lo2Lg2t1GMAVwdE=; b=Qd7Vuywz0Elx6qXcSQ6zkHTjM8iaVfqKve/pqJwhZ+VBTBZisBTiOktRf0XdXIy+C7 TilvLsTZvbMO4YMvDa+kItjL68KtnpWXlsSpBWxSfJdUO5bAcYGmYgbooWno5W44rOMi nSlY++Pb5YtY1d96a09r/0+/38/fUI5fsFt2AT2dttiAxWIW0RGXkh+coPsqV5z2a6xd 986oe32qzNzO3whYWLZMj/75k18Tdi1rJoVegCeePijCN5lVkwjnfBOEUxBwNH0jLyMa F/EhFT2/xUFGdtlsIq/nEOxFYYlhZBkmYScgoa/yBQON+I1sM6N9OgNQ1VD9PoewstUM zaZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ws+5ImAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si15462269pll.457.2022.02.01.11.53.31; Tue, 01 Feb 2022 11:53:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ws+5ImAW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358537AbiAaLDr (ORCPT + 99 others); Mon, 31 Jan 2022 06:03:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358931AbiAaLCN (ORCPT ); Mon, 31 Jan 2022 06:02:13 -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 2D6E7C061759; Mon, 31 Jan 2022 03:00:19 -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 BEEB360AF6; Mon, 31 Jan 2022 11:00:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C0DAC340E8; Mon, 31 Jan 2022 11:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643626818; bh=gRRUr3GZfH0oOWsALBJ1NzPStNd7gByEVdYf3P2O07k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ws+5ImAWjSh07C8WzATqna3/yJ5HZaKTRkOL3zlGsTm6RrSbdpy5m49l/XLDv2IYN BSUYTkRW/j0SozvKqneUJ84wU5jl6hNo5vaQhG6DBrTGwjc3Fb0X4Vy5uuZbtL7mWL hZ++AT7u5uTAW1jAzzmnDLAAT3Ai5a0eFsIcrrO4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Hancock , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 50/64] net: phy: broadcom: hook up soft_reset for BCM54616S Date: Mon, 31 Jan 2022 11:56:35 +0100 Message-Id: <20220131105217.373387209@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105215.644174521@linuxfoundation.org> References: <20220131105215.644174521@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: Robert Hancock [ Upstream commit d15c7e875d44367005370e6a82e8f3a382a04f9b ] A problem was encountered with the Bel-Fuse 1GBT-SFP05 SFP module (which is a 1 Gbps copper module operating in SGMII mode with an internal BCM54616S PHY device) using the Xilinx AXI Ethernet MAC core, where the module would work properly on the initial insertion or boot of the device, but after the device was rebooted, the link would either only come up at 100 Mbps speeds or go up and down erratically. I found no meaningful changes in the PHY configuration registers between the working and non-working boots, but the status registers seemed to have a lot of error indications set on the SERDES side of the device on the non-working boot. I suspect the problem is that whatever happens on the SGMII link when the device is rebooted and the FPGA logic gets reloaded ends up putting the module's onboard PHY into a bad state. Since commit 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") the genphy_soft_reset call is not made automatically by the PHY core unless the callback is explicitly specified in the driver structure. For most of these Broadcom devices, there is probably a hardware reset that gets asserted to reset the PHY during boot, however for SFP modules (where the BCM54616S is commonly found) no such reset line exists, so if the board keeps the SFP cage powered up across a reboot, it will end up with no reset occurring during reboots. Hook up the genphy_soft_reset callback for BCM54616S to ensure that a PHY reset is performed before the device is initialized. This appears to fix the issue with erratic operation after a reboot with this SFP module. Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") Signed-off-by: Robert Hancock Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/broadcom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 5e956089bf525..c23fec34b50e9 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -646,6 +646,7 @@ static struct phy_driver broadcom_drivers[] = { .phy_id_mask = 0xfffffff0, .name = "Broadcom BCM54616S", /* PHY_GBIT_FEATURES */ + .soft_reset = genphy_soft_reset, .config_init = bcm54xx_config_init, .config_aneg = bcm54616s_config_aneg, .ack_interrupt = bcm_phy_ack_intr, -- 2.34.1