Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3486944pxf; Mon, 29 Mar 2021 03:43:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPkV/EqgO40Fy9YshebDQRiuwxVhRUDRtLbvzhxgwJPdqR3u0MMz4JzYFMTdw3eW/l9Hap X-Received: by 2002:aa7:c403:: with SMTP id j3mr27916488edq.137.1617014584974; Mon, 29 Mar 2021 03:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617014584; cv=none; d=google.com; s=arc-20160816; b=rSo0GtVNLRARsJ4UKT899yUBd5Zz1yak2TS2uw3JCVS1tRTgao58EJjwG3hXWVNLco cRv/qnd25n6wlhnxOHejp1eO0yVsr6S53mwK2QduMoe4drhLemKkrWMy2ool4j8ShCL4 QpNnMUY2RqZlFDQDE33FI5Vp4rHcVYq8OPsY0riw7pdxibP8THItNsQareqJqrGQafSv Fr1D5kYstDmlk4m4qXjlMxb3BN4trYnWYG+w2sRSjZdUUWvD9U78kBjrOdg4DE5R4Vv7 QPAQjc69ptEy2P3nGFzsKBZK5rcZVSYpgvQiH2xT8k6e37FDbn+NU3H85kS6xDxwJZ/D +mhQ== 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=cwBeOTftR1SKJJoak1kFjU9+DzyFmXXt4L2Fq4sbVA4=; b=aaQtAhkB7AJjUE5eFZWX/LD+hNhpiwrK4/yXfuUvYzxAEwlYEVuwu0o4yLyWzYLncY +yR78NNsiUbNbw4JWS7h3h0b0doiQdmtpveTIm1WczkipmDfX6te5WD7/MYey+3Lb7ht 5vKCyOeuAkynMIX6WTFAqv9bvCwFIooGrIiQPL0pdm+v3GDHLyj8ybUaoU+8b3xqtIAJ 2fkwee2YUtbFxTmvRAqvDMkb6c1yoeW5wHXmxd2BYxq/Yu1kGxh8zDOzY06tbHo3wJRk Mw3AmzQ8v/4y0GBkXI9lKYAMtgNH1YZmVsdGAJCuDK3NUiFc4GPHbpWNb5Obf5izz1i/ sESA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nX6cjCa1; 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 dp18si12654721ejc.432.2021.03.29.03.42.43; Mon, 29 Mar 2021 03:43:04 -0700 (PDT) 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=nX6cjCa1; 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 S234428AbhC2IdJ (ORCPT + 99 others); Mon, 29 Mar 2021 04:33:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:37406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232230AbhC2IUb (ORCPT ); Mon, 29 Mar 2021 04:20:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 94F0261974; Mon, 29 Mar 2021 08:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006030; bh=EOcZtP1C9tkTuNpv/wXJe1TtdV70nAmD3KSU5vRAPBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nX6cjCa1BAvktToZODB6gturfrrIkLwG/igB+2d0j0l1pa5SZ5RGnvpiwnOWi0cJf WUi0F3cXJafwWAjJA1mh+Vyno2VF366+DafWXpvOR15SxtE8vypsydYCAEzzAt4WTA mTaNirenzsR/wC4m+Ey+/c08LGe4FNYtrNDcKQJI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mian Yousaf Kaukab , "David S. Miller" Subject: [PATCH 5.10 065/221] netsec: restore phy power state after controller reset Date: Mon, 29 Mar 2021 09:56:36 +0200 Message-Id: <20210329075631.356378032@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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: Mian Yousaf Kaukab commit 804741ac7b9f2fdebe3740cb0579cb8d94d49e60 upstream. Since commit 8e850f25b581 ("net: socionext: Stop PHY before resetting netsec") netsec_netdev_init() power downs phy before resetting the controller. However, the state is not restored once the reset is complete. As a result it is not possible to bring up network on a platform with Broadcom BCM5482 phy. Fix the issue by restoring phy power state after controller reset is complete. Fixes: 8e850f25b581 ("net: socionext: Stop PHY before resetting netsec") Cc: stable@vger.kernel.org Signed-off-by: Mian Yousaf Kaukab Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/socionext/netsec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -1708,14 +1708,17 @@ static int netsec_netdev_init(struct net goto err1; /* set phy power down */ - data = netsec_phy_read(priv->mii_bus, priv->phy_addr, MII_BMCR) | - BMCR_PDOWN; - netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, data); + data = netsec_phy_read(priv->mii_bus, priv->phy_addr, MII_BMCR); + netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, + data | BMCR_PDOWN); ret = netsec_reset_hardware(priv, true); if (ret) goto err2; + /* Restore phy power state */ + netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, data); + spin_lock_init(&priv->desc_ring[NETSEC_RING_TX].lock); spin_lock_init(&priv->desc_ring[NETSEC_RING_RX].lock);