Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6015062ybc; Wed, 27 Nov 2019 13:25:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwhbOedbW2+DUgAZSzPMUMeE2oFJdJxI9C5w/vpYvtqypvKYWVKEto1Ooj76x5k1mQrpIa3 X-Received: by 2002:a17:906:d8b7:: with SMTP id qc23mr4638857ejb.117.1574889958764; Wed, 27 Nov 2019 13:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574889958; cv=none; d=google.com; s=arc-20160816; b=G0KOjxHI5nXSCXgXKYJ9OnOuUgtO25pDiBxpS4b3MQhfH0DYTUziZ4Dnkh854J6riK PeGwLMvHhmAa/JxysLd2RMVhs3fpPiz1/pS/i88fL3Vi4KB4dwxzdR011s26Jj1SmpTQ uRzxzJlp+1KI2vX/hSiPV3Cum2W6r+T87DSLg9H7sXX9W3ZvXF7RRFp7j1BxpgD60cWm MAMr1PpIetFJz/gUWin5OFzfZTOGmlVe0zdCRwSqP4g8dWNOdXwZHKrxJm8TmLSWAr6S yuELR4zs5uCJ4eyLTzeRcJpQPPeT44/rl9cWxU+OmEDZLH1vFVBA5cFCnSZI3cuvoiZY LP3g== 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=YzULsg2GN5d9/6r+uAV6ufbxbezQr0U0eH2nzuGPlJ8=; b=gi7ewcuof+AXAI5a52snp8s8NwX6ohawEDRD56kcLOv0nbWx/MpRkd76YDppaukThH A5JM6KCUjbbYf1arPn/epTxOc3oZlCEtP0iEet9HOzUPFJ/u/JW/JwNP7yeUvu+8o/dO /+hh6DWl+lACcNdfkcGKlHBVS21c5qrvj5Kkt/02y05DAOYAk8i4iEWMxaVeYcrJCUMe QF+0LA7MjFoSAShVVMNHhxQRtnYz2YHJNmg6jQKtRFrxBT+OBamEKtpeCHzrsNFeBRUs +wweJMR+8Z15FpH+sUB78i1MZ3ebe0Ep8CHmGo8sbO2nYHHWTD0gA4AV3fnkjwejI5CZ dp/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GHAO70fI; 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 r12si9988889ejx.217.2019.11.27.13.25.35; Wed, 27 Nov 2019 13:25:58 -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=GHAO70fI; 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 S1731718AbfK0VEd (ORCPT + 99 others); Wed, 27 Nov 2019 16:04:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:58048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731865AbfK0VEb (ORCPT ); Wed, 27 Nov 2019 16:04:31 -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 DC4AB21770; Wed, 27 Nov 2019 21:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888670; bh=9uyfzauE58ZzV9qho2Uq/YQRYCXqOI53XmSwiLS9fDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GHAO70fIoz3Wk/pTX/tip4H6nMnjS2jYflqgNeqMkdqHJbec0G6lXgJNfbHh5KOgY 3+oSV/7JHFLKvC4UfR2GhOUQgSh43DOK9xyiag5nrbdeVtgH00bbDH66cRBwAzt1PU 5w92dnTCe9hpg5Y6VvPfNus1ZYwHmzRm3YvdeQ+k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 223/306] net: dsa: bcm_sf2: Turn on PHY to allow successful registration Date: Wed, 27 Nov 2019 21:31:13 +0100 Message-Id: <20191127203131.347612884@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@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: Florian Fainelli [ Upstream commit c04a17d2a9ccf1eaba1c5a56f83e997540a70556 ] We are binding to the PHY using the SF2 slave MDIO bus that we create, binding involves reading the PHY's MII_PHYSID1/2 which won't be possible if the PHY is turned off. Temporarily turn it on/off for the bus probing to succeeed. This fixes unbind/bind problems where the port connecting to that PHY would be in error since it could not connect to it. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/bcm_sf2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index ca3655d28e00f..17cec68e56b4f 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -1099,12 +1099,16 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) return ret; } + bcm_sf2_gphy_enable_set(priv->dev->ds, true); + ret = bcm_sf2_mdio_register(ds); if (ret) { pr_err("failed to register MDIO bus\n"); return ret; } + bcm_sf2_gphy_enable_set(priv->dev->ds, false); + ret = bcm_sf2_cfp_rst(priv); if (ret) { pr_err("failed to reset CFP\n"); -- 2.20.1