From patchwork Sat Jan 6 18:53:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 856442 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=cogentembedded-com.20150623.gappssmtp.com header.i=@cogentembedded-com.20150623.gappssmtp.com header.b="ILfQqrgP"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zDW2423phz9sCZ for ; Sun, 7 Jan 2018 05:55:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753271AbeAFSzW (ORCPT ); Sat, 6 Jan 2018 13:55:22 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38967 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753202AbeAFSzU (ORCPT ); Sat, 6 Jan 2018 13:55:20 -0500 Received: by mail-lf0-f66.google.com with SMTP id m8so2215474lfc.6 for ; Sat, 06 Jan 2018 10:55:19 -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=/W8J507VysWPrOrWSPZWYsEDq7xocRaQertqh3XAiTA=; b=ILfQqrgPjLs2l+btyf9PLmPwznaA+D+jd2HMqpakBll0LRHhzApN7q6fDU4CnsiD6/ FWx6pIvGsKfv00olNgdRPf2wTs3njUL3WI224mjfaC1wuLTs6PxvT9hFwH0x4tL7tdQE jIdu/i0/f9gfHc/57brXdP36Hw97GnIMMdMbsILq/lNuMqmmPxhmYwBdna192SelnSZR Ikb4hCGg4cgPCDOaBz+ru/jI4Wl62pJOoSdzIyYS6Q/z3J/FYceIvmf0kAwOxL+Hl+d6 nnS7g6iaEGmSTAIaCVaf6mXjqtrjxt8pczPJGoKGzeCfHHoAY2sCDI34GjWavH6HeP3w W2yg== 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=/W8J507VysWPrOrWSPZWYsEDq7xocRaQertqh3XAiTA=; b=D3UYIFTV5nZGX/0z1ho0ZreUqyC6wHG3M2TTqNKreguHUwF66LCF4rjTGyFDXKqOUD VvQtYuVc6OrHYxfkuaBVEHbST4D+Y61Uo0V0l1yx5AlMXOC09xMEe4Y0gBpuqCyGS6jx +s+jqUBh8dME5XuE9sbnW1GVGC9KsaC/Arri/l7dUmr8LNewhLjRkl5mZYdeEytmAAfD wspeRkmOIQbmCXgCLiNOuHeMDUb38EXsiO7Fo5/SGDmq3HQoIxgDpTNQaW612uZJvGmq zvk2Woy6YHBPkZVHguv/Et0SltFbdwdCdJdzOVuQIodHGAVh1vYOjbEC9wI0ucTcfCV+ PQjg== X-Gm-Message-State: AKGB3mKhUjhRGh2wz9gCHr0gNeiPsgseeGlPEj+TOU06nXLnGdhRkf9A lPQiM3kidL0h2ZIbSCWCtYGIPg== X-Google-Smtp-Source: ACJfBoteyqPpwoCjuNFU1iDNDnFfWs2gOFoolexFbu47qUs0wtMSrNRg2nRHFNQ6alixKTLYnWkFOA== X-Received: by 10.46.17.11 with SMTP id f11mr4028947lje.8.1515264918936; Sat, 06 Jan 2018 10:55:18 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.85.97]) by smtp.gmail.com with ESMTPSA id l77sm304072lfl.72.2018.01.06.10.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2018 10:55:18 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Sat, 06 Jan 2018 21:55:15 +0300 Message-Id: <20180106185515.780906193@cogentembedded.com> User-Agent: quilt/0.64 Date: Sat, 06 Jan 2018 21:53:26 +0300 To: Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Cc: netdev@vger.kernel.org, Sergei Shtylyov Subject: [PATCH 1/2] SolutionEngine771x: fix Ether platform data MIME-Version: 1.0 Content-Disposition: inline; filename=SolutionEngine771x-fix-Ether-platform-data-v2.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The 'sh_eth' driver's probe() method would fail on the SolutionEngine7710 board and crash on SolutionEngine7712 board as the platform code is hopelessly behind the driver's platform data -- it passes the PHY address instead of 'struct sh_eth_plat_data *'; pass the latter to the driver in order to fix the bug... Fixes: 71557a37adb5 ("[netdrvr] sh_eth: Add SH7619 support") Signed-off-by: Sergei Shtylyov --- Changes in version 2: - added the necessary #include. arch/sh/boards/mach-se/770x/setup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) Index: linux/arch/sh/boards/mach-se/770x/setup.c =================================================================== --- linux.orig/arch/sh/boards/mach-se/770x/setup.c +++ linux/arch/sh/boards/mach-se/770x/setup.c @@ -9,6 +9,7 @@ */ #include #include +#include #include #include #include @@ -115,6 +116,11 @@ static struct platform_device heartbeat_ #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\ defined(CONFIG_CPU_SUBTYPE_SH7712) /* SH771X Ethernet driver */ +static struct sh_eth_plat_data sh_eth_plat = { + .phy = PHY_ID, + .phy_interface = PHY_INTERFACE_MODE_MII, +}; + static struct resource sh_eth0_resources[] = { [0] = { .start = SH_ETH0_BASE, @@ -132,7 +138,7 @@ static struct platform_device sh_eth0_de .name = "sh771x-ether", .id = 0, .dev = { - .platform_data = PHY_ID, + .platform_data = &sh_eth_plat, }, .num_resources = ARRAY_SIZE(sh_eth0_resources), .resource = sh_eth0_resources, @@ -155,7 +161,7 @@ static struct platform_device sh_eth1_de .name = "sh771x-ether", .id = 1, .dev = { - .platform_data = PHY_ID, + .platform_data = &sh_eth_plat, }, .num_resources = ARRAY_SIZE(sh_eth1_resources), .resource = sh_eth1_resources,