Message ID | 20090824091416.GB15330@linux-sh.org (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Paul Mundt |
Headers | show |
Dear Paul Thank you for your patch > 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? hmmm.. I tried this patch, but it still doesn't work. log is ---------- (snip) usbcore: registered new interface driver usbhid usbhid: v2.6:USB HID core driver heartbeat: version 0.1.1 loaded TCP cubic registered NET: Registered protocol family 17 RPC: Registered udp transport module. RPC: Registered tcp transport module. /opt/usr/src/WORK/morimoto/gitlinux/sh-2.6/drivers/rtc/hctosys.c: unable to ope) IP-Config: Failed to open eth0 eth1: link down Sending DHCP requests ...... ---------- Best regards -- Kuninori Morimoto -- 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
On Mon, Aug 24, 2009 at 06:45:45PM +0900, Kuninori Morimoto wrote: > > Dear Paul > > Thank you for your patch > > > 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? > > hmmm.. > I tried this patch, but it still doesn't work. > log is > Ok, we'll have to let Magnus take a look at it then, as it's certainly runtime PM related. -- 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
Dear Paul > > I tried this patch, but it still doesn't work. > > log is > > > Ok, we'll have to let Magnus take a look at it then, as it's certainly > runtime PM related. OK thanks Best regards -- Kuninori Morimoto -- 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
On Mon, Aug 24, 2009 at 6:55 PM, Paul Mundt<lethal@linux-sh.org> wrote: > On Mon, Aug 24, 2009 at 06:45:45PM +0900, Kuninori Morimoto wrote: >> >> Dear Paul >> >> Thank you for your patch >> >> > 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? >> >> hmmm.. >> I tried this patch, but it still doesn't work. >> log is >> > Ok, we'll have to let Magnus take a look at it then, as it's certainly > runtime PM related. It looks like the driver is accessing hardware from probe, so you need to force a resume after enable. The LCDC driver does just that: pm_runtime_enable(priv->dev); pm_runtime_resume(priv->dev); Hopefully that should do the trick. Can you try this fix on top of Paul's patch Morimoto-san? Cheers, / magnus -- 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
Hi Magnus Thank you for your hard work > It looks like the driver is accessing hardware from probe, so you need > to force a resume after enable. The LCDC driver does just that: > > pm_runtime_enable(priv->dev); > pm_runtime_resume(priv->dev); > > Hopefully that should do the trick. Can you try this fix on top of > Paul's patch Morimoto-san? hmm... I tried Paul's patch + pm_runtime_resume But it still doesn't work for me... Best regards -- Kuninori Morimoto -- 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 <linux/phy.h> #include <linux/cache.h> #include <linux/io.h> - +#include <linux/pm_runtime.h> #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, }, };