Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-22 Thread Oliver Neukum
On Tue, 2016-03-22 at 11:13 -0400, Alan Stern wrote: > > Indeed. In that case the point is moot. But it is correct to ask > > the core whether the device is autosuspended at that point rather > > than keep a private flag if you can. > > That's why we have pm_runtime_status_suspended(). I guess

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-22 Thread Alan Stern
On Tue, 22 Mar 2016, Oliver Neukum wrote: > On Tue, 2016-03-22 at 10:21 -0400, Alan Stern wrote: > > I don't see any point in resuming the device just in order to collect > > operating statistics. If it was already suspended then it wasn't > > operating, so there will be no statistics to

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-22 Thread Oliver Neukum
On Tue, 2016-03-22 at 10:21 -0400, Alan Stern wrote: > I don't see any point in resuming the device just in order to collect > operating statistics. If it was already suspended then it wasn't > operating, so there will be no statistics to collect. Indeed. In that case the point is moot. But it

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-22 Thread Alan Stern
On Tue, 22 Mar 2016, Oliver Neukum wrote: > On Mon, 2016-03-21 at 15:30 -0400, Alan Stern wrote: > > On Mon, 21 Mar 2016, Oliver Neukum wrote: > > > > > > We have an autosuspend timeout because we think that IO, if it will > > > come at all, is likeliest to come soon. If, however, the IO is > >

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-22 Thread Oliver Neukum
On Mon, 2016-03-21 at 15:30 -0400, Alan Stern wrote: > On Mon, 21 Mar 2016, Oliver Neukum wrote: > > > We have an autosuspend timeout because we think that IO, if it will > > come at all, is likeliest to come soon. If, however, the IO is > > periodic that heuristics is false. > > To save most

RE: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Alan Stern
On Mon, 21 Mar 2016 woojung@microchip.com wrote: > > > > But this leaves open the issue that querying the device too often will > > > > prevent it from going into autosuspend. It seems to me that the best > > > > way to deal with this is to make sure that the autosuspend timeout is > > > >

RE: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Woojung.Huh
> > > But this leaves open the issue that querying the device too often will > > > prevent it from going into autosuspend. It seems to me that the best > > > way to deal with this is to make sure that the autosuspend timeout is > > > shorter than the interal between queries, not to make the

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Alan Stern
On Mon, 21 Mar 2016, Oliver Neukum wrote: > On Mon, 2016-03-21 at 14:24 -0400, Alan Stern wrote: > > On Mon, 21 Mar 2016, Oliver Neukum wrote: > > > > > On Mon, 2016-03-21 at 10:57 -0400, Alan Stern wrote: > > > > > > > One possible solution is to export a sysfs parameter to prevent > > > >

RE: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Alan Stern
On Mon, 21 Mar 2016 woojung@microchip.com wrote: > > But this leaves open the issue that querying the device too often will > > prevent it from going into autosuspend. It seems to me that the best > > way to deal with this is to make sure that the autosuspend timeout is > > shorter than the

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Oliver Neukum
On Mon, 2016-03-21 at 14:24 -0400, Alan Stern wrote: > On Mon, 21 Mar 2016, Oliver Neukum wrote: > > > On Mon, 2016-03-21 at 10:57 -0400, Alan Stern wrote: > > > > > One possible solution is to export a sysfs parameter to prevent > > > statistics collection (or more generally, to change the

RE: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Woojung.Huh
> But this leaves open the issue that querying the device too often will > prevent it from going into autosuspend. It seems to me that the best > way to deal with this is to make sure that the autosuspend timeout is > shorter than the interal between queries, not to make the querying >

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Alan Stern
On Mon, 21 Mar 2016, Oliver Neukum wrote: > On Mon, 2016-03-21 at 10:57 -0400, Alan Stern wrote: > > > One possible solution is to export a sysfs parameter to prevent > > statistics collection (or more generally, to change the interval at > > which it occurs). > > Surely, not performing a

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Oliver Neukum
On Mon, 2016-03-21 at 10:57 -0400, Alan Stern wrote: > One possible solution is to export a sysfs parameter to prevent > statistics collection (or more generally, to change the interval at > which it occurs). Surely, not performing a task can hardly be beaten in terms of power consumption.

RE: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Woojung.Huh
ernel.org; > linux...@vger.kernel.org; linux-ker...@vger.kernel.org > Subject: Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef > CONFIG_PM > > Not that it matters anymore since David reverted the original patch, > but my reason for not sending a similar patch was that I wasn't sure &

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Alan Stern
On Mon, 21 Mar 2016, Oliver Neukum wrote: > On Sun, 2016-03-20 at 11:43 +0100, Geert Uytterhoeven wrote: > > If CONFIG_PM=n: > > > > drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’: > > drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no > > member named

RE: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Woojung.Huh
ernel.org; > linux...@vger.kernel.org; linux-ker...@vger.kernel.org > Subject: Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef > CONFIG_PM Thanks for all comments. Will look into it and submit new patch. - Woojung

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-21 Thread Oliver Neukum
On Sun, 2016-03-20 at 11:43 +0100, Geert Uytterhoeven wrote: > If CONFIG_PM=n: > > drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’: > drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no > member named ‘runtime_auto’ > > If PM is disabled, the runtime_auto flag

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-20 Thread Guenter Roeck
On 03/20/2016 03:43 AM, Geert Uytterhoeven wrote: If CONFIG_PM=n: drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’: drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no member named ‘runtime_auto’ If PM is disabled, the runtime_auto flag is not available,

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-20 Thread David Miller
From: Eric Dumazet Date: Sun, 20 Mar 2016 09:35:52 -0700 > On Sun, 2016-03-20 at 11:43 +0100, Geert Uytterhoeven wrote: >> If CONFIG_PM=n: >> >> drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’: >> drivers/net/usb/lan78xx.c:3274: error: ‘struct

Re: [PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-20 Thread Eric Dumazet
On Sun, 2016-03-20 at 11:43 +0100, Geert Uytterhoeven wrote: > If CONFIG_PM=n: > > drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’: > drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no member > named ‘runtime_auto’ > > If PM is disabled, the runtime_auto

[PATCH] lan78xx: Protect runtime_auto check by #ifdef CONFIG_PM

2016-03-20 Thread Geert Uytterhoeven
If CONFIG_PM=n: drivers/net/usb/lan78xx.c: In function ‘lan78xx_get_stats64’: drivers/net/usb/lan78xx.c:3274: error: ‘struct dev_pm_info’ has no member named ‘runtime_auto’ If PM is disabled, the runtime_auto flag is not available, but auto suspend is not enabled anyway. Hence protect