All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: maxk@qualcomm.com, linux-kernel@vger.kernel.org,
	bluez-devel@lists.sf.net
Subject: [Bluez-devel] Re: [PATCH] hci_usb: implement suspend/resume
Date: Wed, 18 Jan 2006 14:13:18 +0100	[thread overview]
Message-ID: <1137589998.27515.8.camel@localhost> (raw)
In-Reply-To: <1137540084.4543.15.camel@localhost>

Hi Johannes,

> The attached patch implements suspend/resume for the hci_usb bluetooth
> driver by simply killing all outstanding urbs on suspend, and re-issuing
> them on resume.
> 
> This allows me to actually use the internal bluetooth "dongle" in my
> powerbook after suspend-to-ram without taking down all userland programs
> (sdpd, ...) and the hci device and reloading the module.

thanks for the patch. Due to the removed owner field it won't apply
cleanly to 2.6.16-rc1, but I can fix this easily by myself.

> +static int hci_usb_resume(struct usb_interface *intf)
> +{
> +	struct hci_usb *husb = usb_get_intfdata(intf);
> +	int i, err;
> +	unsigned long flags;
> +	if (!husb || intf == husb->isoc_iface)
> +		return 0;
> +	
> +	for (i = 0; i < 4; i++) {
> +		struct _urb_queue *q = &husb->pending_q[i];
> +		struct _urb *_urb;
> +		spin_lock_irqsave(&q->lock, flags);
> +		list_for_each_entry(_urb, &q->head, list) {
> +			err = usb_submit_urb(&_urb->urb, GFP_ATOMIC);
> +			if (err) break;
> +		}
> +		spin_unlock_irqrestore(&q->lock, flags);
> +		if (err)
> +			return -EIO;
> +	}
> +	return 0;
> +}

What happens if hci_usb_resume() really returns -EIO? Do we have to kill
the URBs again or does the USB subsystems disconnect the device in this
case?

Regards

Marcel




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

WARNING: multiple messages have this Message-ID (diff)
From: Marcel Holtmann <marcel@holtmann.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: maxk@qualcomm.com, linux-kernel@vger.kernel.org,
	bluez-devel@lists.sourceforge.net
Subject: Re: [PATCH] hci_usb: implement suspend/resume
Date: Wed, 18 Jan 2006 14:13:18 +0100	[thread overview]
Message-ID: <1137589998.27515.8.camel@localhost> (raw)
In-Reply-To: <1137540084.4543.15.camel@localhost>

Hi Johannes,

> The attached patch implements suspend/resume for the hci_usb bluetooth
> driver by simply killing all outstanding urbs on suspend, and re-issuing
> them on resume.
> 
> This allows me to actually use the internal bluetooth "dongle" in my
> powerbook after suspend-to-ram without taking down all userland programs
> (sdpd, ...) and the hci device and reloading the module.

thanks for the patch. Due to the removed owner field it won't apply
cleanly to 2.6.16-rc1, but I can fix this easily by myself.

> +static int hci_usb_resume(struct usb_interface *intf)
> +{
> +	struct hci_usb *husb = usb_get_intfdata(intf);
> +	int i, err;
> +	unsigned long flags;
> +	if (!husb || intf == husb->isoc_iface)
> +		return 0;
> +	
> +	for (i = 0; i < 4; i++) {
> +		struct _urb_queue *q = &husb->pending_q[i];
> +		struct _urb *_urb;
> +		spin_lock_irqsave(&q->lock, flags);
> +		list_for_each_entry(_urb, &q->head, list) {
> +			err = usb_submit_urb(&_urb->urb, GFP_ATOMIC);
> +			if (err) break;
> +		}
> +		spin_unlock_irqrestore(&q->lock, flags);
> +		if (err)
> +			return -EIO;
> +	}
> +	return 0;
> +}

What happens if hci_usb_resume() really returns -EIO? Do we have to kill
the URBs again or does the USB subsystems disconnect the device in this
case?

Regards

Marcel



  reply	other threads:[~2006-01-18 13:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-17 23:21 [PATCH] hci_usb: implement suspend/resume Johannes Berg
2006-01-18 13:13 ` Marcel Holtmann [this message]
2006-01-18 13:13   ` Marcel Holtmann
2006-01-18 16:38   ` Johannes Berg
2006-02-09  1:08     ` [Bluez-devel] " John McCabe-Dansted
2006-03-21  9:42     ` Johannes Berg
2006-03-21  9:52       ` [Bluez-devel] " Marcel Holtmann
2006-03-21  9:52         ` Marcel Holtmann
2006-04-16 14:42         ` Johannes Berg
2006-01-18 13:25 ` Oliver Neukum
2006-01-18 14:13   ` Johannes Berg
2006-01-18 15:34     ` Oliver Neukum
2006-01-18 20:46       ` [linux-usb-devel] " Greg KH

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=1137589998.27515.8.camel@localhost \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sf.net \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxk@qualcomm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.