From patchwork Thu Jan 4 18:06:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10145315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E08B06034B for ; Thu, 4 Jan 2018 18:07:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E42FB28811 for ; Thu, 4 Jan 2018 18:07:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8F1A28815; Thu, 4 Jan 2018 18:07:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7307828811 for ; Thu, 4 Jan 2018 18:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752463AbeADSHC (ORCPT ); Thu, 4 Jan 2018 13:07:02 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:41807 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752356AbeADSHB (ORCPT ); Thu, 4 Jan 2018 13:07:01 -0500 Received: by mail-lf0-f65.google.com with SMTP id h137so2643955lfe.8 for ; Thu, 04 Jan 2018 10:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=ADxAMjoOljHn+8Ojelqy7VZmHahgBqyJKOMu3r5YaP4=; b=YqK8ETdieK5lfK5azY9dY6mDQPJ5NrtTI5KyhpgFX5jXeNZnu58znbLyfcFjndNAwn 1AWh5eJCyh5W8KqG2LGoj+zGZmOCwaM3vOAEf6d+igwYw4RTRITE6DCZNUWmpkZGgTl5 Jvm8bP+MTBNH81OQ2QXKOGglyIeFnDkz3ZeY7TYLyIOIC7ftFbGT9Qiu6rZD4d0lJN4Y SjKc7ZcYhbJIaiRZu/4RHJ7Tc6lFbNjhY6XlM3Wn6fn51YQv0y6BNo3K/nUJTmRYpNBm pIxPD0zwpJL1fTtSFvZgg64igKcBtlmJ3ktdyHuZ3TMs0xpvaUdrgmmPS06buLtTFWBV H0+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=ADxAMjoOljHn+8Ojelqy7VZmHahgBqyJKOMu3r5YaP4=; b=n+nkZM5JAyRWht5I1iOz2drpDcUDmKXUzlAwIphjDfLfl6+pjmlUt2HAGIUc7e7fy1 KASpfTWYjvjtgpJwetrP9ldC4RN+p3a7xX5Z92mfcylTNb2jV1lX68rHoaRQ7cA/pUDG oh+X4BmEvqnfTQGeWGVnapygVHY0O8qwZceNwTeY/g1AKSAOsw1Ly7ZDNXktaSjf4ovC bo+a8pqTdfoJbT66532cAZ9vSOk3YlTiXdCtZieWPSXOW2JRLIvgpsObelAqFPAneAvJ 46QEVcTkZYP4Y3x7XDApjfdMMP5JB8hzoyxELvalxELyEjCMKcGIOtnV0bEuM9MkCiCz Gg7g== X-Gm-Message-State: AKwxytdNe88Ol4MPI917PWn/Sydfb24tZLAWVw+bSt3tBedqqeDA7YZ3 MeOm7ssgGIdtizKLRpKMz85AhA== X-Google-Smtp-Source: ACJfBov/04au8aSpLhFTJtV7Oz6pxSG2FZEhgvdlYE8Lj7rC1x0hj1AHIZ11pt5DhssnIZBOywYClQ== X-Received: by 10.46.21.15 with SMTP id s15mr209850ljd.93.1515089219820; Thu, 04 Jan 2018 10:06:59 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.85.181]) by smtp.gmail.com with ESMTPSA id n67sm717770lja.44.2018.01.04.10.06.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 10:06:58 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Thu, 04 Jan 2018 21:06:55 +0300 Message-Id: <20180104180655.936982989@cogentembedded.com> User-Agent: quilt/0.64 Date: Thu, 04 Jan 2018 21:06:49 +0300 To: netdev@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org, Sergei Shtylyov Subject: [PATCH] sh_eth: fix SH7757 GEther initialization MIME-Version: 1.0 Content-Disposition: inline; filename=sh_eth-fix-SH7757-GEther-initialization.patch Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- The patch is against DaveM's 'net.git' repo. drivers/net/ethernet/renesas/sh_eth.c | 4 ++-- include/linux/sh_eth.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net/drivers/net/ethernet/renesas/sh_eth.c @@ -3254,8 +3254,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); Index: net/include/linux/sh_eth.h =================================================================== --- net.orig/include/linux/sh_eth.h +++ net/include/linux/sh_eth.h @@ -17,7 +17,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