From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark A. Greer" Subject: Re: [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac Date: Tue, 13 Jan 2015 16:42:36 -0700 Message-ID: <20150113234236.GA3921@animalcreek.com> References: <1421177368-19756-1-git-send-email-tony@atomide.com> <1421177368-19756-3-git-send-email-tony@atomide.com> <20150113195141.GT16533@saruman> <20150113205439.GK2419@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Felipe Balbi , David Miller , netdev@vger.kernel.org, linux-omap@vger.kernel.org, Brian Hutchinson To: Tony Lindgren Return-path: Content-Disposition: inline In-Reply-To: <20150113205439.GK2419@atomide.com> Sender: linux-omap-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, Jan 13, 2015 at 12:54:40PM -0800, Tony Lindgren wrote: > * Felipe Balbi [150113 11:55]: > > On Tue, Jan 13, 2015 at 11:29:24AM -0800, Tony Lindgren wrote: > > > --- a/drivers/net/ethernet/ti/davinci_emac.c > > > +++ b/drivers/net/ethernet/ti/davinci_emac.c > > > @@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev) > > > int i = 0; > > > struct emac_priv *priv = netdev_priv(ndev); > > > > > > - pm_runtime_get(&priv->pdev->dev); > > > + pm_runtime_get_sync(&priv->pdev->dev); > > > > gotta check return value on all pm_runtime_get_sync() calls. IIRC, > > there's a coccinelle script for checking and patching this. > > Sure, here's an updated patch with error checking added. > > Regards, > > Tony > > 8< --------------------- > From: Tony Lindgren > Date: Mon, 22 Dec 2014 08:19:06 -0800 > Subject: [PATCH] net: davinci_emac: Fix runtime pm calls for davinci_emac > > Commit 3ba97381343b ("net: ethernet: davinci_emac: add pm_runtime support") > added support for runtime PM, but it causes issues on omap3 related devices > that actually gate the clocks: > > Unhandled fault: external abort on non-linefetch (0x1008) > ... > [] (emac_dev_getnetstats) from [] (dev_get_stats+0x78/0xc8) > [] (dev_get_stats) from [] (rtnl_fill_ifinfo+0x3b8/0x938) > [] (rtnl_fill_ifinfo) from [] (rtmsg_ifinfo+0x68/0xd8) > [] (rtmsg_ifinfo) from [] (register_netdevice+0x3a0/0x4ec) > [] (register_netdevice) from [] (register_netdev+0x14/0x24) > [] (register_netdev) from [] (davinci_emac_probe+0x408/0x5c8) > [] (davinci_emac_probe) from [] (platform_drv_probe+0x48/0xa4) > > Let's fix it by moving the pm_runtime_get() call earlier, and also add it to > the emac_dev_getnetstats(). Also note that we want to use pm_runtime_get_sync() > as we don't want to have deferred_resume happen. And let's also check the > return value for pm_runtime_get_sync() as noted by Felipe Balbi . > > Cc: Brian Hutchinson > Cc: Felipe Balbi > Cc: Mark A. Greer > Signed-off-by: Tony Lindgren Tony, Sorry for the sloppy pm_runtime patch and thanks for fixing it. Acked-by: Mark A. Greer