From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Date: Sat, 06 Mar 2010 21:25:09 +0000 Subject: Re: Problems with remote-wakeup settings Message-Id: <201003062225.09514.rjw@sisk.pl> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alan Stern Cc: Linux-pm mailing list , linux-input@vger.kernel.org, linux-hotplug@vger.kernel.org, USB list , Kernel development list , NetDev On Saturday 06 March 2010, Alan Stern wrote: > On Sat, 6 Mar 2010, Rafael J. Wysocki wrote: > > > > It's not difficult in theory to tie together the WoL setting and the > > > wakeup flag: > > > > > > If ethtool changes the WoL setting, the driver's ioctl handler > > > should make the corresponding change to the wakeup flag. > > > > > > If ethtool queries the WoL setting, the ioctl handler should > > > check the wakeup flag. If the flag is off, it should report > > > that WoL is disabled; if the flag is on, it should report that > > > WoL is enabled. (The same check should be made in the suspend > > > routine.) > > > > That's done this way already in all drivers I know, but we need a hook > > from wake_store() back to the driver. > > What for? wake_store() can't be called during a sleep transition > (because tasks are frozen) or while the system is asleep. And if it is > called at any other time, the driver doesn't need to know until either > its ioctl handler or its suspend method runs. Right. That means, though, that the network adapter drivers' "get WoL" routines should check should_wakeup too. They don't do that right now, but IMO it's reasonable to request that they be modified. Adding netdev to the Cc list. Rafael From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: Problems with remote-wakeup settings Date: Sat, 6 Mar 2010 22:25:09 +0100 Message-ID: <201003062225.09514.rjw@sisk.pl> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Alan Stern Cc: NetDev , USB list , linux-hotplug@vger.kernel.org, Kernel development list , linux-input@vger.kernel.org, Linux-pm mailing list List-Id: linux-input@vger.kernel.org On Saturday 06 March 2010, Alan Stern wrote: > On Sat, 6 Mar 2010, Rafael J. Wysocki wrote: > > > > It's not difficult in theory to tie together the WoL setting and the > > > wakeup flag: > > > > > > If ethtool changes the WoL setting, the driver's ioctl handler > > > should make the corresponding change to the wakeup flag. > > > > > > If ethtool queries the WoL setting, the ioctl handler should > > > check the wakeup flag. If the flag is off, it should report > > > that WoL is disabled; if the flag is on, it should report that > > > WoL is enabled. (The same check should be made in the suspend > > > routine.) > > > > That's done this way already in all drivers I know, but we need a hook > > from wake_store() back to the driver. > > What for? wake_store() can't be called during a sleep transition > (because tasks are frozen) or while the system is asleep. And if it is > called at any other time, the driver doesn't need to know until either > its ioctl handler or its suspend method runs. Right. That means, though, that the network adapter drivers' "get WoL" routines should check should_wakeup too. They don't do that right now, but IMO it's reasonable to request that they be modified. Adding netdev to the Cc list. Rafael From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753649Ab0CFVWj (ORCPT ); Sat, 6 Mar 2010 16:22:39 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:56072 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820Ab0CFVWh (ORCPT ); Sat, 6 Mar 2010 16:22:37 -0500 From: "Rafael J. Wysocki" To: Alan Stern Subject: Re: Problems with remote-wakeup settings Date: Sat, 6 Mar 2010 22:25:09 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.33-git-rjw; KDE/4.3.5; x86_64; ; ) Cc: "Linux-pm mailing list" , linux-input@vger.kernel.org, linux-hotplug@vger.kernel.org, USB list , Kernel development list , NetDev References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003062225.09514.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 06 March 2010, Alan Stern wrote: > On Sat, 6 Mar 2010, Rafael J. Wysocki wrote: > > > > It's not difficult in theory to tie together the WoL setting and the > > > wakeup flag: > > > > > > If ethtool changes the WoL setting, the driver's ioctl handler > > > should make the corresponding change to the wakeup flag. > > > > > > If ethtool queries the WoL setting, the ioctl handler should > > > check the wakeup flag. If the flag is off, it should report > > > that WoL is disabled; if the flag is on, it should report that > > > WoL is enabled. (The same check should be made in the suspend > > > routine.) > > > > That's done this way already in all drivers I know, but we need a hook > > from wake_store() back to the driver. > > What for? wake_store() can't be called during a sleep transition > (because tasks are frozen) or while the system is asleep. And if it is > called at any other time, the driver doesn't need to know until either > its ioctl handler or its suspend method runs. Right. That means, though, that the network adapter drivers' "get WoL" routines should check should_wakeup too. They don't do that right now, but IMO it's reasonable to request that they be modified. Adding netdev to the Cc list. Rafael