From patchwork Mon Aug 24 09:14:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mundt X-Patchwork-Id: 43592 X-Patchwork-Delegate: lethal@linux-sh.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7O9EJdX007627 for ; Mon, 24 Aug 2009 09:14:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751619AbZHXJOQ (ORCPT ); Mon, 24 Aug 2009 05:14:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751896AbZHXJOQ (ORCPT ); Mon, 24 Aug 2009 05:14:16 -0400 Received: from 124x34x33x190.ap124.ftth.ucom.ne.jp ([124.34.33.190]:39490 "EHLO master.linux-sh.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751619AbZHXJOP (ORCPT ); Mon, 24 Aug 2009 05:14:15 -0400 Received: from localhost (unknown [127.0.0.1]) by master.linux-sh.org (Postfix) with ESMTP id 8609A63758; Mon, 24 Aug 2009 09:14:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at linux-sh.org Received: from master.linux-sh.org ([127.0.0.1]) by localhost (master.linux-sh.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MoTvfshWeGxY; Mon, 24 Aug 2009 18:14:16 +0900 (JST) Received: by master.linux-sh.org (Postfix, from userid 500) id A89D56375A; Mon, 24 Aug 2009 18:14:16 +0900 (JST) Date: Mon, 24 Aug 2009 18:14:16 +0900 From: Paul Mundt To: Kuninori Morimoto Cc: Magnus , SH-Linux Subject: Re: Current ms7724se LAN doesn't work Message-ID: <20090824091416.GB15330@linux-sh.org> Mail-Followup-To: Paul Mundt , Kuninori Morimoto , Magnus , SH-Linux References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On Mon, Aug 24, 2009 at 05:19:47PM +0900, Kuninori Morimoto wrote: > > Dear all > > I got latest kernel from Paul's git, > and current ms7724se LAN doesn't work. > > When If I remove > archdata = { > .hwblk_id = HWBLK_ETHER, > } > from ${LINUX}/arch/sh/boards/mach-se/7724/setup.c > then, it start works for me. > > Are there any CONFIG to use SH-ETH or HWBLK ? > This would be a runtime PM issue, which SH-Mobile unconditionally selects. The problem is that the module is most likely disabled via its MSTP bit under the new scheme, so sh-eth will need to tie in to the runtime PM framework to get that resolved. Can you give this a try? --- drivers/net/sh_eth.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 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 diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index a2d82dd..c195baa 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -30,7 +30,7 @@ #include #include #include - +#include #include "sh_eth.h" /* There is CPU dependent code */ @@ -1006,6 +1006,8 @@ static int sh_eth_open(struct net_device *ndev) int ret = 0; struct sh_eth_private *mdp = netdev_priv(ndev); + pm_runtime_get_sync(&ndev->dev); + ret = request_irq(ndev->irq, &sh_eth_interrupt, #if defined(CONFIG_CPU_SUBTYPE_SH7763) || defined(CONFIG_CPU_SUBTYPE_SH7764) IRQF_SHARED, @@ -1173,6 +1175,8 @@ static int sh_eth_close(struct net_device *ndev) ringsize = sizeof(struct sh_eth_txdesc) * TX_RING_SIZE; dma_free_coherent(NULL, ringsize, mdp->tx_ring, mdp->tx_desc_dma); + pm_runtime_put_sync(&ndev->dev); + return 0; } @@ -1404,6 +1408,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) mdp = netdev_priv(ndev); spin_lock_init(&mdp->lock); + pm_runtime_enable(&pdev->dev); pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data); /* get PHY ID */ @@ -1477,18 +1482,37 @@ static int sh_eth_drv_remove(struct platform_device *pdev) sh_mdio_release(ndev); unregister_netdev(ndev); flush_scheduled_work(); - + pm_runtime_disable(&pdev->dev); free_netdev(ndev); platform_set_drvdata(pdev, NULL); return 0; } +static int sh_eth_runtime_nop(struct device *dev) +{ + /* + * Runtime PM callback shared between ->runtime_suspend() + * and ->runtime_resume(). Simply returns success. + * + * This driver re-initializes all registers after + * pm_runtime_get_sync() anyway so there is no need + * to save and restore registers here. + */ + return 0; +} + +static struct dev_pm_ops sh_eth_dev_pm_ops = { + .runtime_suspend = sh_eth_runtime_nop, + .runtime_resume = sh_eth_runtime_nop, +}; + static struct platform_driver sh_eth_driver = { .probe = sh_eth_drv_probe, .remove = sh_eth_drv_remove, .driver = { .name = CARDNAME, + .pm = &sh_eth_dev_pm_ops, }, };