Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp767706ybc; Sat, 16 Nov 2019 08:20:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxpoAGwUkN7mmNBAiSyCQvR3HBo+iMe/ytVd8sGwyhj7/dH9UbwSzCefn5L0HgmSSJCe+8a X-Received: by 2002:a17:906:7750:: with SMTP id o16mr11080460ejn.224.1573921227201; Sat, 16 Nov 2019 08:20:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573921227; cv=none; d=google.com; s=arc-20160816; b=bTmyrdTjtP0IiAyx1GE4fjNtlGUh2VIyjbH9teOQ9hvP/eiM8Qfy5WCl2kx13KqaCZ 5FAdjCBHXtks8o7PAHuWhtX/lZpkAR1VPnadsEo66cTx32hFuYtBVkRjZzRBJ/BmCbf6 p1qoBOJatw1Be7Ktw+EaFbIbaZ9CR+Kx13XIiz8x+Gs8aoizU9QrlMf3R+GJb4KnS26E yb/r3OHJWKPwoyQJGDOwfm0Crsg/CvDce1JRXW9s0FEBlLtefaTfBzmPBdLRqgbtNIsb azKYm0jKcGMOnSpuM+u3ZACbKmX1mFEExYbvHDNf1pwNmr6qow5dkzRKVA9RPhCgP8cI /9HA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YzULsg2GN5d9/6r+uAV6ufbxbezQr0U0eH2nzuGPlJ8=; b=QPsz2R43Vmv3PR2LnEIpVSKTOhEKZZTRcAAVXaMnm4ih9IO6VhDg6qoIu9d3lGYUHk KDdu2veqWyGk7FM8ovdJOfMsK2LlYRO+yTkLyr+Lv1wcQXIiyZ434z/lIXCIY9/fKFJE uW8mFfGXKwnU6q2aDiCIS5meTjdVsGat11q4D5XEDcazi7a2ycyzFAxENFD0DnAeCZbl driltwHSF/5exsutgOusOzYbETsXSAZpDwcgP4FPPDlEVnqgyB8tNX2klpOIp5gUr3Ef njM2yqeq7v5NcI+IFCB5nI5Iijm4DNj/Xv2znJ5ijh44bbiZAg7BdVYkHW1fruvXoiSl TDJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sYkZsYT1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rp9si8201330ejb.40.2019.11.16.08.20.01; Sat, 16 Nov 2019 08:20:27 -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=sYkZsYT1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731913AbfKPQRm (ORCPT + 99 others); Sat, 16 Nov 2019 11:17:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:53230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729461AbfKPPqo (ORCPT ); Sat, 16 Nov 2019 10:46:44 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7FC932089D; Sat, 16 Nov 2019 15:46:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573919203; bh=9uyfzauE58ZzV9qho2Uq/YQRYCXqOI53XmSwiLS9fDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYkZsYT1FG72hrdW9PICtjdz27y0ivASTwI5YdACbG7yH4erdo4pMWz9yujNO3LYO cX6lx9lUSVCbgcpcbPAwYYRASLd6fCRhVEehJsR22PKsAKxFbHQ8YdfaQ4mqYA+6i2 5XWNiaNPs5WtK5VKki4WVt1kVZgwlao07YsbaITA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Florian Fainelli , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 206/237] net: dsa: bcm_sf2: Turn on PHY to allow successful registration Date: Sat, 16 Nov 2019 10:40:41 -0500 Message-Id: <20191116154113.7417-206-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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