netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum-IBi9RG/b67k@public.gmane.org>
To: Hayes Wang <hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	nic_swsd-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH net 2/3] r8152: fix remote wakeup
Date: Thu, 23 Jul 2015 10:30:58 +0200	[thread overview]
Message-ID: <1437640258.4377.6.camel@suse.com> (raw)
In-Reply-To: <1394712342-15778-150-Taiwan-albertk-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>

On Thu, 2015-07-23 at 15:09 +0800, Hayes Wang wrote:
> Set needs_remote_wakeup only when the device supports it.
> 
> Signed-off-by: Hayes Wang <hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/net/usb/r8152.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index e3a0110..eff1f25 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -4059,7 +4059,8 @@ static int rtl8152_probe(struct usb_interface *intf,
>  		break;
>  	}
>  
> -	intf->needs_remote_wakeup = 1;
> +	if (udev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP)
> +		intf->needs_remote_wakeup = 1;

Hi,

this is most likely wrong. Usbcore does check for a device's ability to
do remote wakeup and will block a runtime suspend if it detects that
a remote wakeup would be required but the device cannot deliver.
(static int autosuspend_check())

So by removing the flag in the probe() method means that devices will
suspend during operations without remote wakeup requested. Thus an
incoming packet cannot wake them up.

If you remove setting the flag on probe() you need to set it at open()
[and reset on close()], as devices which cannot do remote wakeup must
only be suspended when they are down.

	Regards
		Oliver



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-07-23  8:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23  7:09 [PATCH net 0/3] r8152: issues fix Hayes Wang
2015-07-23  7:09 ` [PATCH net 1/3] r8152: fix the issue about U1/U2 Hayes Wang
2015-07-23  7:09 ` [PATCH net 2/3] r8152: fix remote wakeup Hayes Wang
     [not found]   ` <1394712342-15778-150-Taiwan-albertk-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2015-07-23  8:30     ` Oliver Neukum [this message]
     [not found]       ` <1437640258.4377.6.camel-IBi9RG/b67k@public.gmane.org>
2015-07-23  9:55         ` Hayes Wang
2015-07-23 10:27           ` Oliver Neukum
     [not found]             ` <1437647246.4377.33.camel-IBi9RG/b67k@public.gmane.org>
2015-07-23 11:30               ` Hayes Wang
2015-07-23  7:09 ` [PATCH net 3/3] r8152: don't enable napi before rx ready Hayes Wang
2015-07-24  5:54 ` [PATCH net v2 0/3] r8152: issues fix Hayes Wang
2015-07-24  5:54   ` [PATCH net v2 1/3] r8152: fix the issue about U1/U2 Hayes Wang
2015-07-24  5:54   ` [PATCH net v2 2/3] r8152: fix wakeup settings Hayes Wang
2015-07-24  5:54   ` [PATCH net v2 3/3] r8152: don't enable napi before rx ready Hayes Wang
2015-07-27  7:56   ` [PATCH net v2 0/3] r8152: issues fix David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437640258.4377.6.camel@suse.com \
    --to=oneukum-ibi9rg/b67k@public.gmane.org \
    --cc=hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nic_swsd-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).