From patchwork Sat Aug 17 22:15:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2846057 X-Patchwork-Delegate: lethal@linux-sh.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1BD21BF546 for ; Sat, 17 Aug 2013 22:15:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4111920200 for ; Sat, 17 Aug 2013 22:15:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28F492012E for ; Sat, 17 Aug 2013 22:15:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754713Ab3HQWPa (ORCPT ); Sat, 17 Aug 2013 18:15:30 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:58367 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754695Ab3HQWP3 (ORCPT ); Sat, 17 Aug 2013 18:15:29 -0400 Received: by mail-lb0-f170.google.com with SMTP id r10so1751435lbi.1 for ; Sat, 17 Aug 2013 15:15:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:organization:to:subject:date:user-agent:cc :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=RXW00OO9sBMp7eFOQKYiFL3aAgtsJx6DM501Jy8umjg=; b=mYnx9DcmIVMJB1HIwGr9HJikjXcKqVkldo22eV6gWLmLZObV/V+8fDLEvQtCft8tMQ fBXVDoEPvq44x/Z/KyRF+FpNBwKo2VYe0vj7m1F+Ufzh9/gruFNR3ERLHsJl7hrjWzmY Mxm5kNb81FpQkBqzKLjrbPRRz8sT5KUedrbxi2j1o4ivCRFrFo0PCn+mulaQCJp7qVNA BQIzD+3QGVsb0BpAtRKSw6hiwtkj7/vkJTvjptCrfkj08w7Gc0tufckB4h4WhJxkYX5C Ol7nwPD2coqeSk4CMsbWeR5GSlVz/vJ5rpKTwF4QL1ESKljTP7XmelqpzaE2JrF1/ROQ 2teA== X-Gm-Message-State: ALoCoQkdc9+6e3iuAtYP1PKMG/X2A9XzafqOQ57nQ8pQIg5P2FC1kkplapC/+4e86/p8+BB96aJ0 X-Received: by 10.112.136.38 with SMTP id px6mr38576lbb.29.1376777728598; Sat, 17 Aug 2013 15:15:28 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-155-153.pppoe.mtu-net.ru. [91.76.155.153]) by mx.google.com with ESMTPSA id i9sm1674477laa.3.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 17 Aug 2013 15:15:27 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: netdev@vger.kernel.org Subject: [PATCH 1/2] SH7619: fix Ether support Date: Sun, 18 Aug 2013 02:15:42 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: lethal@linux-sh.org, linux-sh@vger.kernel.org, davem@davemloft.net References: <201308180213.23296.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201308180213.23296.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201308180215.43063.sergei.shtylyov@cogentembedded.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The 'sh_eth' driver's probe will crash as the platform code is hopelessly behind the platform data -- it passes PHY ID instead of 'struct sh_eth_plat_data *'. Strangely, both commit d88a3ea6fa4c (SH7619 add ethernet controler support) that added the platform code and commit 71557a37adb5 ([netdrvr] sh_eth: Add SH7619 support) were done in about the same time, yet the latter one added 'struct sh_eth_plat_data' and the platform code didn't ever get updated... Add the proper platform data and fix off-by-one memory resource end error, while at it... Signed-off-by: Sergei Shtylyov Cc: stable@vger.kernel.org --- arch/sh/kernel/cpu/sh2/setup-sh7619.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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/arch/sh/kernel/cpu/sh2/setup-sh7619.c =================================================================== --- net.orig/arch/sh/kernel/cpu/sh2/setup-sh7619.c +++ net/arch/sh/kernel/cpu/sh2/setup-sh7619.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -110,10 +111,17 @@ static struct platform_device scif2_devi }, }; +static struct sh_eth_plat_data eth_platform_data = { + .phy = 1, + .edmac_endian = EDMAC_LITTLE_ENDIAN, + .register_type = SH_ETH_REG_FAST_SH3_SH2, + .phy_interace = PHY_INTERFACE_MODE_MII, +}; + static struct resource eth_resources[] = { [0] = { .start = 0xfb000000, - .end = 0xfb0001c8, + .end = 0xfb0001c7, .flags = IORESOURCE_MEM, }, [1] = { @@ -127,7 +135,7 @@ static struct platform_device eth_device .name = "sh7619-ether", .id = -1, .dev = { - .platform_data = (void *)1, + .platform_data = ð_platform_data, }, .num_resources = ARRAY_SIZE(eth_resources), .resource = eth_resources,