Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2917176ybx; Fri, 8 Nov 2019 11:14:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwGgIa/A6ovoHoEPZhcBPut+zCQEuGyG7d7cOhaqwitLzXRSXVOaf++KCVEr7E+ry6hBox7 X-Received: by 2002:a17:906:e82:: with SMTP id p2mr10235922ejf.237.1573240476933; Fri, 08 Nov 2019 11:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573240476; cv=none; d=google.com; s=arc-20160816; b=kFXQNZklVa1oVoAjjnepcMmA04bR9T8HIPMuQ4ij0+5NsD7+37qUUFmYpjyBuBWz1p 2D35B1dVZBxK7FqTwo+QNEujk+L4Euq8ZxvxGERnF156hOOk5M+smWZtuAu1MU6pX/cm KCGyKQPQDOosKy8M7ieK6mwdwtLaqRCihFNxsrDPif04D7ymVIjCM/zevG7TDXSqA2v+ tBswYrMkeSywp+rVt04KtIoE8DBPzqLazifd/wXSHuaSG0qkRIohVG2JpzM1HvlXk2Mf qfijTr5RBoXcShlh5uJSKZ1K2ftqInNLH1zDpFJ5NsRRF3SvmHLRFttdI7aJEgu/5r26 DUjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ETWNxW/DGBRSkLKVZkwzEGumy+eFgDCu/ZpTeksao6k=; b=ZON8N91GEh6hK2aX9nUDfrSGlZ4y2iMapALc/nk2ttpnvxLah8c2pVPybCt8jiDiEc 6ltj1fmNghZrcxtkL/AtYRzKJqg7puyx2jP5/3UAPKepohiq1dU3OKu3g8CHrHdSKltC zR17Zfdk+xw2ur/0dsV9ga1H4wIjG+Jp9S7R1h/0uN13+5Y5q9YJxNGSV195gBflZG+k w9ImFDKpKnsTwQGVmgwOaqpIAUh8pIJXXGCqqQIgigvqie9/2K0BxtelTDO6mUhZsemO xU0vZpFtQ/6Cj8K5zLGYFqtAUh6UvWLZhwvl6Ah+PMdKPqfYtfqries2zYL03VwW0qBT 28QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EMmGoyqq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si5703809edk.210.2019.11.08.11.14.13; Fri, 08 Nov 2019 11:14:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EMmGoyqq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391886AbfKHTK1 (ORCPT + 99 others); Fri, 8 Nov 2019 14:10:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:42656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390609AbfKHTKY (ORCPT ); Fri, 8 Nov 2019 14:10:24 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27F3721D7E; Fri, 8 Nov 2019 19:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573240223; bh=nLOcwWJWwhXvTCEzjBYbp64HImRzY0owBgLtbidwXq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EMmGoyqqT7V4KH8tvi6yolBG0rxdcB2o8nAWvFm2t5XKJLsblem6kfpVBIKVNmetT AUvlZdECnfXsmdDO8+x9toyQ9QsoQa0uc9ehupTLfZ0ZXOo9mWf55R6wGskPgMgN0r UHbvnFB6w7sSYYvdUxP1ANWSM++JdFfv9FULUoqA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Doug Berger , Florian Fainelli , "David S. Miller" Subject: [PATCH 5.3 132/140] net: bcmgenet: reset 40nm EPHY on energy detect Date: Fri, 8 Nov 2019 19:51:00 +0100 Message-Id: <20191108174912.945797377@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174900.189064908@linuxfoundation.org> References: <20191108174900.189064908@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Doug Berger [ Upstream commit 25382b991d252aed961cd434176240f9de6bb15f ] The EPHY integrated into the 40nm Set-Top Box devices can falsely detect energy when connected to a disabled peer interface. When the peer interface is enabled the EPHY will detect and report the link as active, but on occasion may get into a state where it is not able to exchange data with the connected GENET MAC. This issue has not been observed when the link parameters are auto-negotiated; however, it has been observed with a manually configured link. It has been empirically determined that issuing a soft reset to the EPHY when energy is detected prevents it from getting into this bad state. Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2018,6 +2018,8 @@ static void bcmgenet_link_intr_enable(st */ if (priv->internal_phy) { int0_enable |= UMAC_IRQ_LINK_EVENT; + if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv)) + int0_enable |= UMAC_IRQ_PHY_DET_R; } else if (priv->ext_phy) { int0_enable |= UMAC_IRQ_LINK_EVENT; } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { @@ -2616,9 +2618,14 @@ static void bcmgenet_irq_task(struct wor priv->irq0_stat = 0; spin_unlock_irq(&priv->lock); + if (status & UMAC_IRQ_PHY_DET_R && + priv->dev->phydev->autoneg != AUTONEG_ENABLE) + phy_init_hw(priv->dev->phydev); + /* Link UP/DOWN event */ if (status & UMAC_IRQ_LINK_EVENT) phy_mac_interrupt(priv->dev->phydev); + } /* bcmgenet_isr1: handle Rx and Tx priority queues */ @@ -2713,7 +2720,7 @@ static irqreturn_t bcmgenet_isr0(int irq } /* all other interested interrupts handled in bottom half */ - status &= UMAC_IRQ_LINK_EVENT; + status &= (UMAC_IRQ_LINK_EVENT | UMAC_IRQ_PHY_DET_R); if (status) { /* Save irq status for bottom-half processing. */ spin_lock_irqsave(&priv->lock, flags);