Received: by 10.223.185.116 with SMTP id b49csp6377979wrg; Wed, 28 Feb 2018 08:25:43 -0800 (PST) X-Google-Smtp-Source: AH8x225FGL9vb2HfsXTEYuMxe4ZPCBmH8+czhjszpGfbkNC25/mqF5Jz+BnndlR/aHpKFa94x+8L X-Received: by 10.98.182.26 with SMTP id j26mr16874476pff.223.1519835142909; Wed, 28 Feb 2018 08:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519835142; cv=none; d=google.com; s=arc-20160816; b=SGFbx5YJRS5lwvxb5rmHxM/RWjp6XWMkzuHmzNXdojllVGcjXxUPMAecohkvV8dzAk aA3eTixKQzbf7hMTigORJ2l0Oy3emFu1ECKkBuUI2FrA9Ri0rUqvIgFzuJIFINenQLvg 3pCTwQWeLZmfbHECEAQRzYSkxWn4/phH2VjV3da6MhcvJ9XJLmb6hKsvBGRE4fi13B6n 35RY2SWf8YxFVpbEVKhqlik8xm39KP3pId+WXttEu7KTWQ9fIB73ubdzacfLXga394Cc f+5pIhUvIb02pwS4mQSlDiAqqGnbW2ssoncS6t1aq+tALXbe5Pi0q2BjPFn3xhbd6xK0 vpPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=7tQzegcagdvY5jy0fgx1Gy+iiaVtos/iuBfRPqGs/zY=; b=0RoZCSB3TfHAoJUj7yqGnsasl3Nigq4hdeeerqhhQ1xxmswMQuc1qNRyPbJG4+xBQ5 YjJ5bhJT/7JEdxvDexzHqM3zP+YV2ZGD2YAVsHUdaymCjK/ENTipWB7aGBc8amhnbcI/ 7eOUnUKPYcyTqG7EwC5vTmtXrxstbcjDFWgwIQKgqQZH39QGEkeIiNrA8Zt5DIeeNqbi WuqMFSXalskRatiCllASeQq5dc4uruC2wTtNqQ+YChpS8qdoT5UnPqg2KmDTEfcuBRoY nIAY/YbNmuIXkdZXMWIT4MOjvfnrc5d+cTyyqROUU40A72LayQinSv/sI8UntFM6Hb/g cZNQ== ARC-Authentication-Results: i=1; mx.google.com; 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 c200si1379635pfb.373.2018.02.28.08.25.28; Wed, 28 Feb 2018 08:25:42 -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; 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 S935031AbeB1QY1 (ORCPT + 99 others); Wed, 28 Feb 2018 11:24:27 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35369 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935171AbeB1QUh (ORCPT ); Wed, 28 Feb 2018 11:20:37 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yk-0006XR-8k; Wed, 28 Feb 2018 15:22:23 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yi-0000Cv-Qx; Wed, 28 Feb 2018 15:22:20 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Sergei Shtylyov" , "David S. Miller" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 178/254] sh_eth: fix SH7757 GEther initialization In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Sergei Shtylyov commit 5133550296d43236439494aa955bfb765a89f615 upstream. Renesas SH7757 has 2 Fast and 2 Gigabit Ether controllers, while the 'sh_eth' driver can only reset and initialize TSU of the first controller pair. Shimoda-san tried to solve that adding the 'needs_init' member to the 'struct sh_eth_plat_data', however the platform code still never sets this flag. I think that we can infer this information from the 'devno' variable (set to 'platform_device::id') and reset/init the Ether controller pair only for an even 'devno'; therefore 'sh_eth_plat_data::needs_init' can be removed... Fixes: 150647fb2c31 ("net: sh_eth: change the condition of initialization") Signed-off-by: Sergei Shtylyov Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- drivers/net/ethernet/renesas/sh_eth.c | 4 ++-- include/linux/sh_eth.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2902,8 +2902,8 @@ static int sh_eth_drv_probe(struct platf ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER; } - /* initialize first or needed device */ - if (!devno || pd->needs_init) { + /* Need to init only the first port of the two sharing a TSU */ + if (devno % 2 == 0) { if (mdp->cd->chip_reset) mdp->cd->chip_reset(ndev); --- a/include/linux/sh_eth.h +++ b/include/linux/sh_eth.h @@ -16,7 +16,6 @@ struct sh_eth_plat_data { unsigned char mac_addr[ETH_ALEN]; unsigned no_ether_link:1; unsigned ether_link_active_low:1; - unsigned needs_init:1; }; #endif