Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3729574imm; Mon, 8 Oct 2018 08:37:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV61sbGIJ5tpq+AmpgITw9uJ8Zin5kqlGbbrJocEdTs9FOXOtGBcfvOMPiOwJYhKk7YknccOE X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr24072146plb.71.1539013027028; Mon, 08 Oct 2018 08:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013026; cv=none; d=google.com; s=arc-20160816; b=Mmrjb4pjbUTueyNhDlemNKlOhSXSpSz3p3PfEIUZ08WBC72wEFE3G3/EZ2hkl4aPnB hbF0Hj6jSFLtec7PiWUox5+Vc56iBqxrtQFJ/fSEakKXsg/BJQ3gv8QI7PyN14k1UUvj YNDN2sR1gHAuJF1k6Sso0I7f4xRIsawyMIUv1v9G8ByUo36EZ9s6qxMGp2almIQoCBGk qBlWPmOQrnN0KLvcHGGqxSR8RNuyTPjGmbLeqxRV0BCfOjLuaQWhKxr6vq5gAgGDKz6L 6ZFECwb/4iCvD6q+Ef+Srl1sixw+AHZaXzqY9ClN5tNE/8Hb0ds+Ag2QWdMHmFn/SR6H 0IUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=9OanLmkrgVcMSzo3aPu3iTztI5CYDustrhW+PAdd3eA=; b=wK0BchT2fTTCMPn1nK3uNTq5kXvKazc4qikDzntgB8TPSVLBm6B9L7iw3VYLK3VsBV /kD4RUyaPkSDWSanRRTLi+al/0KkUas/HEq0bgFBKLxDZbCFJDT028KCh9t3ZL7C9QEp LaM/MlfNutx9SZsmwLvySzPyz4fLaSMfu0aU2lMWEERz18oKo10he4/HHD1FriGV/4QX vU8ZXSXH/E1P5QLdrppu6j0UCmHMtOHLTWRVP1KTMjUibcqlMPsqcZPDfs3V9p9LPXRc kM0nSaaB5a/Ctn21nQKhUdxWdLYcTsBjn1vcdRVmCGSiZ6WpgwI0Sf8FBliz+UrZQ4g2 fxuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SnVq20FI; 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 y89-v6si7728290pfa.47.2018.10.08.08.36.51; Mon, 08 Oct 2018 08:37:06 -0700 (PDT) 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=SnVq20FI; 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 S1727469AbeJHWiJ (ORCPT + 99 others); Mon, 8 Oct 2018 18:38:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:56434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbeJHWiJ (ORCPT ); Mon, 8 Oct 2018 18:38:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 9A954214FA; Mon, 8 Oct 2018 15:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012354; bh=TgiMNUxSNZidk2Dus9H/CjBKwzkNjeRYcm0I5u9WH94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SnVq20FIr7TSPBsGMbwK2ldDG9+jNv125MZrYaeHNkKSXcQc9/ZdRfkdgUlXgN5vx W3HTSY+gm4jHsT+8LJ7XBaB3k/YkAwADMazQYdNtW766NJL237tr1L/OZTQYgp3VfK 8pytA+8nmnIixQRTy39SlfPg7N9Pvdm8uaEGdR9M= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Lamparter , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 28/58] net: emac: fix fixed-link setup for the RTL8363SB switch Date: Mon, 8 Oct 2018 11:24:53 -0400 Message-Id: <20181008152523.70705-28-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008152523.70705-1-sashal@kernel.org> References: <20181008152523.70705-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Lamparter [ Upstream commit 08e39982ef64f800fd1f9b9b92968d14d5fafa82 ] On the Netgear WNDAP620, the emac ethernet isn't receiving nor xmitting any frames from/to the RTL8363SB (identifies itself as a RTL8367RB). This is caused by the emac hardware not knowing the forced link parameters for speed, duplex, pause, etc. This begs the question, how this was working on the original driver code, when it was necessary to set the phy_address and phy_map to 0xffffffff. But I guess without access to the old PPC405/440/460 hardware, it's not possible to know. Signed-off-by: Christian Lamparter Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/emac/core.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c index 354c0982847b..3b398ebdb5e6 100644 --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c @@ -2677,12 +2677,17 @@ static int emac_init_phy(struct emac_instance *dev) if (of_phy_is_fixed_link(np)) { int res = emac_dt_mdio_probe(dev); - if (!res) { - res = of_phy_register_fixed_link(np); - if (res) - mdiobus_unregister(dev->mii_bus); + if (res) + return res; + + res = of_phy_register_fixed_link(np); + dev->phy_dev = of_phy_find_device(np); + if (res || !dev->phy_dev) { + mdiobus_unregister(dev->mii_bus); + return res ? res : -EINVAL; } - return res; + emac_adjust_link(dev->ndev); + put_device(&dev->phy_dev->mdio.dev); } return 0; } -- 2.17.1