From patchwork Thu Aug 20 09:16:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 31709 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id EC1DFB7088 for ; Thu, 20 Aug 2009 19:17:17 +1000 (EST) Received: by ozlabs.org (Postfix) id DB804DDD0C; Thu, 20 Aug 2009 19:17:17 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 78ADFDDD0B for ; Thu, 20 Aug 2009 19:17:16 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910AbZHTJRG (ORCPT ); Thu, 20 Aug 2009 05:17:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752799AbZHTJRG (ORCPT ); Thu, 20 Aug 2009 05:17:06 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:8779 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbZHTJRC (ORCPT ); Thu, 20 Aug 2009 05:17:02 -0400 Received: by fg-out-1718.google.com with SMTP id e12so933177fga.17 for ; Thu, 20 Aug 2009 02:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer; bh=FR/78fZeFl0xkv923A6iAWh5Jzkg98AiQ6ggj7Kdi2g=; b=hQdAfCyLgbmt+fkFlts/RkdGBDuOOw8rEW0Cnl3aKx+2EkKzUTy+FQH/VqiSWn6vls 6or6MmrZ/HrzuA/WNqNH1Q6vRoAer2lMn+ugFqn65RDwwhdY4VTytyxkyoJbWDsgs1RM GaoZ1u0s7syBka1zBLOu+fwHWJ29xSeN0JwNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer; b=h9JDfbrjuGQOpiivJ1XRFzHcQQphrOQ/DFnr6Z0mZCFcCtw8ukpUZpUZDqfpDSgmL5 rSpidDFoc5idBP01L6y5yShTfdFWImOiqV620Kp0LTjSmteKhhP6VNZ+hipa4pLZU0Wx wGK+zWMGJsEsdMCz2WFea3SUGgnIhWqLgB0Wc= Received: by 10.86.154.32 with SMTP id b32mr4910888fge.10.1250759822292; Thu, 20 Aug 2009 02:17:02 -0700 (PDT) Received: from ?10.1.0.1? ([77.126.220.181]) by mx.google.com with ESMTPS id 4sm1874958fgg.14.2009.08.20.02.16.57 (version=SSLv3 cipher=RC4-MD5); Thu, 20 Aug 2009 02:17:00 -0700 (PDT) Subject: Re: Very strange issues with ethernet wake on lan From: Maxim Levitsky To: "Rafael J. Wysocki" Cc: "netdev@vger.kernel.org" , "linux-pm@lists.linux-foundation.org" In-Reply-To: <200908172030.54505.rjw@sisk.pl> References: <1250394174.32268.13.camel@localhost.localdomain> <1250500588.4301.5.camel@localhost.localdomain> <200908172030.54505.rjw@sisk.pl> Date: Thu, 20 Aug 2009 12:16:55 +0300 Message-Id: <1250759815.6326.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 2009-08-17 at 20:30 +0200, Rafael J. Wysocki wrote: > On Monday 17 August 2009, Maxim Levitsky wrote: > > On Sun, 2009-08-16 at 06:42 +0300, Maxim Levitsky wrote: > > > Hi, > > > > > > I have recently put back the davicom dm9009 ethernet card into my > > > computer. > > > > > > Some long time ago, I have written its suspend/resume routines. > > > Now I see that few things have changed, like I need to enable wake in > > > sysfs or better patch the code to do so, some nice helpers like > > > pci_prepare_to_sleep have arrived, etc. > > > > > > > > > I narrowed the strange issue down to following situation: > > > > > > I reload dmfe.ko (and networkmanager is disabled) > > > I don't ifup the device, thus pretty much no hardware initialization > > > takes place (but this appears not to matter anyway) > > > > > > I then suspend the system, and WOL doesn't work (I have patched the > > > driver to enable WOL automaticly) > > > > > > I then, suspend again. WOL works, and continues to work as long as I > > > don't reload the driver. If I do, same situation repeats. > > > > > > Also, after a boot, WOL works, so a reload cycle triggers that issue. > > > > > > And most importantly, if I don't do a > > > > > > pci_set_power_state(pci_dev, pci_choose_state (pci_dev, state)); > > > > > > in .suspend, then WOL always works. > > > > > > and I have even tried to set state manually to PCI_D3hot or PCI_D3cold, > > > > > > I also tried to use pci_save_state > > > > > > > > > I also have 2 copies of this card, and both have this issue. > > > I also tried 2 pci slots. > > > > > > Kernel is vanilla 2.6.31-rc5 > > I need a dmesg output containing at least one suspend-resume cycle > (preferably two cycles, the first one where WoL worked and another one > where it didn't). I am really sorry for late reply. I attach the dmesg. dmesg1 - after a boot, and dmfe reload dmesg2 - after first s2ram cycle (wol didn't work) dmesg3 - after second s2ram cycle (wol did work) dmesg4 - after third s2ram cycle (wol did work), this is just in case. Also I attach changes I did to the driver to make it enable wol by default. Best regards, Maxim Levitsky DMFE: enable WOL by default From: Maxim Levitsky --- drivers/net/tulip/dmfe.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index e26a412..8a54a5b 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c @@ -444,7 +444,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, db->chip_id = ent->driver_data; db->ioaddr = pci_resource_start(pdev, 0); db->chip_revision = pdev->revision; - db->wol_mode = 0; + db->wol_mode = WAKE_MAGIC; + device_set_wakeup_enable(&pdev->dev, 1); db->pdev = pdev;