[{"id":1762046,"web_url":"http://patchwork.ozlabs.org/comment/1762046/","msgid":"<aa1a6ca2-1ee9-6896-aef6-729bfe72898c@gmail.com>","list_archive_url":null,"date":"2017-09-02T00:22:24","subject":"Re: [PATCH] net: phy: broadcom: force master mode for BCM54210E and\n\tB50212E","submitter":{"id":2800,"url":"http://patchwork.ozlabs.org/api/people/2800/","name":"Florian Fainelli","email":"f.fainelli@gmail.com"},"content":"On 09/01/2017 02:21 AM, Rafał Miłecki wrote:\n> From: Rafał Miłecki <rafal@milecki.pl>\n> \n> First of all let me explain that the code we use for BCM54210E is also\n> executed for the B50212E. They are very similar so it probably makes\n> sense but it may be worth noting. The IDs are:\n> 0x600d84a1: BCM54210E (rev B0)\n> 0x600d84a2: BCM54210E (rev B1)\n> 0x600d84a5: B50212E (rev B0)\n> 0x600d84a6: B50212E (rev B1)\n> \n> I got a report that a board with BCM47189 SoC and B50212E B1 PHY doesn't\n> work well with Intel's I217-LM and I218-LM:\n> http://ark.intel.com/products/60019/Intel-Ethernet-Connection-I217-LM\n> http://ark.intel.com/products/71307/Intel-Ethernet-Connection-I218-LM\n> I was told there are massive ping loss.\n> \n> A solution to this problem is setting master mode in the 1000BASE-T\n> register. I noticed a similar fix is present in the tg3 driver. One\n> thing I'm not sure if this is needed for BCM54210E. It shouldn't hurt\n> however since both are so similar.\n> \n> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>\n> ---\n> David: I'm not 100% sure if this is the best fix, so let's give others\n> (Florian?) a moment to look at it / review it, please.\n> ---\n>  drivers/net/phy/broadcom.c | 4 ++++\n>  1 file changed, 4 insertions(+)\n> \n> diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c\n> index 1e9ad30a35c8..2569db0923b0 100644\n> --- a/drivers/net/phy/broadcom.c\n> +++ b/drivers/net/phy/broadcom.c\n> @@ -43,6 +43,10 @@ static int bcm54210e_config_init(struct phy_device *phydev)\n>  \tval &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;\n>  \tbcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);\n>  \n> +\tval = phy_read(phydev, MII_CTRL1000);\n> +\tval |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;\n> +\tphy_write(phydev, MII_CTRL1000, val);\n\nSo for both BCM54210E and BCM50212E, the default values are to have\nCTL1000_AS_MASTER cleared, which means that the PHY is configured as a\nslave, and CTRL1000_ENABLE_MASTER also clear, which means Automatic\nSlave/Master configuration, which is a bit confusing.\n\nI would be more comfortable if you introduced a new flag after\nPHY_BRCM_DIS_TXCRXC_NOENRGY in order to configure these bits or not.\nYour driver (bgmac I suppose?) could then set this flag at phy_connect()\ntime through phydev->dev_flags.\n\nChances are that you are not breaking other set ups, because I suspect\nwe might be the offender here but it might be better to limit that to\njust the devices you have.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"g9vwrIny\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkcJJ1Bgzz9sPt\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  2 Sep 2017 10:22:39 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752355AbdIBAWb (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Sep 2017 20:22:31 -0400","from mail-qt0-f193.google.com ([209.85.216.193]:34708 \"EHLO\n\tmail-qt0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752195AbdIBAWa (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 1 Sep 2017 20:22:30 -0400","by mail-qt0-f193.google.com with SMTP id v20so1262902qtg.1\n\tfor <netdev@vger.kernel.org>; Fri, 01 Sep 2017 17:22:29 -0700 (PDT)","from [10.112.156.244] ([192.19.255.250])\n\tby smtp.googlemail.com with ESMTPSA id\n\ts2sm1056701qti.38.2017.09.01.17.22.26\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 01 Sep 2017 17:22:28 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=RUUG1OKrFVUtsnIUSPShHDr2hk2HlEj4Ca7WBHPtZzI=;\n\tb=g9vwrInylO8ClANWBXOtwWshTcmUK/OJ/eK+sNVUemmt2TDQmhRp1lnKVyngw2lyTa\n\trK5Tf5aJfYyRKyfgaVXuYo4kED9O7kSMudX8tu8qsahW8MRYlJFI0FJA3nEo+l/eyiyA\n\tCwlaQX1psxXTPMz240WIgIg9g7DmbEiNf7JM1NzTGvJ3NYazlHglXxviPzUUnhAMT0Wo\n\tX7/s+2SgQqZk6BdiIq4ncgnkm5lOtiA8NIejCGFQrGirel2uL3S1G1/w7jDEPFPYWRYr\n\tFRDAJfdCtj0D4yY6vbFKJH18EDqNH5wQFgBiwDEsUYUnf8vHUzNypQlJ7M+dw8YAq6x0\n\tfvPw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=RUUG1OKrFVUtsnIUSPShHDr2hk2HlEj4Ca7WBHPtZzI=;\n\tb=iWjacj2auNnBxfdifcSoasJ24tcoch3Cy6UKDz6+/ZyYQroG/RJcYXDMyRfwoR3EIY\n\ts4v0wZJd6jbJfBbgIglmapyhqJrFVpv0ejVwhgDn+EgpAm0fMMjT5ja0jlh/51GmDWWF\n\tb9ubI0Pljav+LRGUGX3AHqpySTlYxLyzEzrHmWlgjRCSYCFLQMmB5mEwxTgPetoUdAtU\n\t7S3gUSaD9u+ZqXcMv28mq1qTGh4YuapLYYcPaw/PF8YXTRW4gOm2Y2wVEgzOpl6pWOpT\n\t4QjbXxhoxcknGOCd4ovlDxK47tyVingAFMoEx/Rr81hOBrJHBydMbFC1aCqS+HMSf/cW\n\tMX1w==","X-Gm-Message-State":"AHPjjUheVOel90/4qykcD3+Bja0g/sVeuk+ci6HOB7xU6LDVwjpx25xV\n\totZSRvxA8TTUuvYuwic=","X-Google-Smtp-Source":"ADKCNb6JPZonIzEcOfmSb3xdOg9DVSREDrFFxx+/vmprz1lb6KLxLftL7ll489DMF9Sj7vIMf7C41Q==","X-Received":"by 10.200.57.1 with SMTP id s1mr1916703qtb.313.1504311749213;\n\tFri, 01 Sep 2017 17:22:29 -0700 (PDT)","Subject":"Re: [PATCH] net: phy: broadcom: force master mode for BCM54210E and\n\tB50212E","To":"=?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= <zajec5@gmail.com>,\n\t\"David S . Miller\" <davem@davemloft.net>, netdev@vger.kernel.org","Cc":"Andrew Lunn <andrew@lunn.ch>, Hauke Mehrtens <hauke@hauke-m.de>,\n\tbcm-kernel-feedback-list@broadcom.com, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?=\n\t<rafal@milecki.pl>,         andrew@lunn.ch","References":"<20170901092121.4596-1-zajec5@gmail.com>","From":"Florian Fainelli <f.fainelli@gmail.com>","Message-ID":"<aa1a6ca2-1ee9-6896-aef6-729bfe72898c@gmail.com>","Date":"Fri, 1 Sep 2017 17:22:24 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170901092121.4596-1-zajec5@gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]