lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 28 Nov 2012 13:57:33 +0100
From:	Bjørn Mork <bjorn@...k.no>
To:	Steve Glendinning <steve@...well.net>
Cc:	Alan Stern <stern@...land.harvard.edu>,
	netdev <netdev@...r.kernel.org>, linux-usb@...r.kernel.org,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH 1/2] smsc75xx: refactor entering suspend modes

Steve Glendinning <steve@...well.net> writes:

>> Looking at the different ethernet drivers, the normal way do do this
>> seems to be something like this in their .set_wol implementation:
>>
>>         device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>>
>>
>> where "adapter" is a netdev_priv private struct, "pdev" is a pci device
>> and "wol" is an u32.  I don't see any problem doing the same for USB
>> network devices implementing ethtool "set_wol".
>
> Ahh, good spot.  I've implemented this (patch below for reference) and
> it still doesn't work:
>
>
> $ cat /sys/bus/usb/devices/2-1.2/power/wakeup
> disabled
>
> $ sudo ethtool -s eth2 wol p
>
> [ 1607.237767] smsc75xx 2-1.2:1.0 eth2: set_wol before
> device_can_wakeup=1 device_may_wakeup=0
> [ 1607.237772] smsc75xx 2-1.2:1.0 eth2: set_wol after
> device_can_wakeup=1 device_may_wakeup=1
>
> $ cat /sys/bus/usb/devices/2-1.2/power/wakeup
> disabled
>
>
> Huh?!  My debugging printk statements tell me I've succesfully set it,
> but then the sysfs entry is disabled when I read it.  Is something
> else setting this back?
>
> My testing patch for reference (note this is against my tree with a
> few to-be submitted patches so won't apply cleanly!):

[..]

> @@ -674,8 +653,19 @@ static int smsc75xx_ethtool_set_wol(struct net_device *net,
>  {
>   struct usbnet *dev = netdev_priv(net);
>   struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
> + int ret;
> +
> + netdev_info(dev->net, "set_wol before device_can_wakeup=%d
> device_may_wakeup=%d\n",
> + device_can_wakeup(&net->dev), device_may_wakeup(&net->dev));
>
>   pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE;
> +
> + ret = device_set_wakeup_enable(&net->dev, pdata->wolopts);

You are touching the network device here.  That should have been the USB
device.  Try something like

 ret = device_set_wakeup_enable(&dev->udev->dev, pdata->wolopts);

instead.



Bjørn
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ