Received: by 10.223.176.5 with SMTP id f5csp809951wra; Sat, 3 Feb 2018 10:47:57 -0800 (PST) X-Google-Smtp-Source: AH8x225bhKTHcTRC2F9NhHWyVOv6F6hv39UpjQWmu5EnFCvL3nJwPCEVNJai0xR74lTgoG9TnSsI X-Received: by 2002:a17:902:bf0a:: with SMTP id bi10-v6mr32779306plb.181.1517683677730; Sat, 03 Feb 2018 10:47:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517683677; cv=none; d=google.com; s=arc-20160816; b=nyBzHRVCxHQOk3Fl1NO/N/sVX0SgfcMue5N2vnG3E7RduhHb1ER6jSzdVS2xtSDF5C 1KitfkJ7reHscqDonte4qlQuhY5HC9iftlhbKYmI/B37jp1Er+N0rpX+Op9sRl0M5bbD 9ntweTUC+komQ5o2XsCENJYRyoNvR+MiuS8Z5NWmybajvNHTyZryvdeHLOTxxbTnvEo4 P0CLTQ+HvcktQI+TiBTXQgFdUkwhHXXIeEBMW3ybhO70TAeltbwrlk22da4IJHA9I9Ig fZUCWSHhvJkSPjquMLFCyHIQy7UT7dEW/a7hs5h9BzWpP93/tsjwwIkTaUBWj7u6gBdL FrQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=OGhXWp0iSTUCvgw8RbdrTNIwYFbeEv+dTn8w1T9iE/M=; b=BdIlP21j9ivjZNQ69fK5s0jRDzUI6Ct2gaW27xnNMw+/IbmVpB+8ywqSefe1cx6nET 3JXFYHYxGoqvCGJRvfIyq9R1Usdfx+QwcIlrZcJDBpGCxlm4U2A/nvyY73w28k2gbBMH 1K625RazCOU7u6cFzdN3iDXZJzRTYa4MLvHILdzEXjYfy7lRLIwQIEn/q1Q+7RuFL3fW Q8uJ/j7Y0J23pKiOaxjY5zpSUBzXi1XwQ+Cf/1D1GhFeNOiAAXNJjm1JNc5wqfyNZhc3 yVtzVmjC7RUztrSedCC9I5a+cik2ug8jAm4UQfF6ZvqvsoGgQd0rKSqmSg15x7nUZnsk JBGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=g3Oh75LZ; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si4052162plr.656.2018.02.03.10.47.43; Sat, 03 Feb 2018 10:47:57 -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=@microsoft.com header.s=selector1 header.b=g3Oh75LZ; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752890AbeBCSq6 (ORCPT + 99 others); Sat, 3 Feb 2018 13:46:58 -0500 Received: from mail-cys01nam02on0100.outbound.protection.outlook.com ([104.47.37.100]:41422 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753093AbeBCSCY (ORCPT ); Sat, 3 Feb 2018 13:02:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OGhXWp0iSTUCvgw8RbdrTNIwYFbeEv+dTn8w1T9iE/M=; b=g3Oh75LZmXpLZq2Np4ztBb45bZ+q+dqM0zpBAEVoFHpx/E8N6lag604BznVgyOAh4O3gNEkU/hUeSa+7yYDb5WDyrKU3Kwx0t8TOVlNXvbjKNxJgSPaohCDqTCelb35JerV2aOq+qyuPnbwfmGec8ZQvMQ4ax7TctvvAsAzmpWQ= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1090.namprd21.prod.outlook.com (52.132.24.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.1; Sat, 3 Feb 2018 18:01:17 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:01:17 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Sean Wang , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 033/110] net: mediatek: setup proper state for disabled GMAC on the default Thread-Topic: [PATCH AUTOSEL for 4.14 033/110] net: mediatek: setup proper state for disabled GMAC on the default Thread-Index: AQHTnRjpnBkLAVw2306SiS0OUxCPuw== Date: Sat, 3 Feb 2018 18:00:44 +0000 Message-ID: <20180203180015.29073-33-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1090;7:1zfZetemha3S3wx/8yEyEJBki0X1x5lNKoACzZk8eqiZeGNezbeOppCzK77QTt4ujdP10JLQapEQxjRHuA8e5Pauwrp0s0w/isJrTqaymhevs+XY7mdUvpWZpVxujk6o9MNNT2B2ptCukI6r5XcLftvzn1RhlGue69PatDBMyeujol5mBfvfIbi63M+hIoG2Vpm3SWstSaXwqu3/t3xt/VSSozE6aEW1ELNPmgmfibs/bn04dZKhOY6/gV/cQj+R x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8476f540-4298-4081-0a93-08d56b301f75 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1090; x-ms-traffictypediagnostic: BL0PR2101MB1090: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(2400082)(944501161)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BL0PR2101MB1090;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1090; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(396003)(39380400002)(39860400002)(346002)(199004)(189003)(2900100001)(5660300001)(316002)(25786009)(4326008)(14454004)(2950100002)(478600001)(575784001)(107886003)(72206003)(6666003)(22452003)(10290500003)(186003)(3660700001)(86612001)(76176011)(86362001)(53936002)(3280700002)(106356001)(6436002)(6486002)(59450400001)(81166006)(81156014)(2501003)(6506007)(97736004)(26005)(7736002)(6512007)(6346003)(102836004)(105586002)(68736007)(8936002)(5250100002)(305945005)(36756003)(1076002)(6116002)(3846002)(8676002)(110136005)(66066001)(54906003)(2906002)(10090500001)(99286004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1090;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: EfvSszZPbXi2W93xzVHkYdX76FFFs3keNj1dbNdS0dzRLPKmBkhG5bD173Gx+TXKUMambqbkA0G6gHMvQhBhuw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8476f540-4298-4081-0a93-08d56b301f75 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:44.7221 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang [ Upstream commit 7352e252b5bf40d59342494a70354a2d436fd0cd ] The current solution would setup fixed and force link of 1Gbps to the both GMAC on the default. However, The GMAC should always be put to link down state when the GMAC is disabled on certain target boards. Otherwise, the driver possibly receives unexpected data from the floating hardware connection through the unused GMAC. Although the driver had been added certain protection in RX path to get rid of such kind of unexpected data sent to the upper stack. Signed-off-by: Sean Wang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethe= rnet/mediatek/mtk_eth_soc.c index 5e81a7263654..3fd71cf5cd60 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1959,11 +1959,12 @@ static int mtk_hw_init(struct mtk_eth *eth) /* set GE2 TUNE */ regmap_write(eth->pctl, GPIO_BIAS_CTRL, 0x0); =20 - /* GE1, Force 1000M/FD, FC ON */ - mtk_w32(eth, MAC_MCR_FIXED_LINK, MTK_MAC_MCR(0)); - - /* GE2, Force 1000M/FD, FC ON */ - mtk_w32(eth, MAC_MCR_FIXED_LINK, MTK_MAC_MCR(1)); + /* Set linkdown as the default for each GMAC. Its own MCR would be set + * up with the more appropriate value when mtk_phy_link_adjust call is + * being invoked. + */ + for (i =3D 0; i < MTK_MAC_COUNT; i++) + mtk_w32(eth, 0, MTK_MAC_MCR(i)); =20 /* Indicates CDM to parse the MTK special tag from CPU * which also is working out for untag packets. --=20 2.11.0