Skip to contentSkip to conversation

Suspend/resume issues with bluez

Bluez-devel Mitsu Hadeishi 5 participants 7 messages Mar 3, 2004 – Mar 10, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi, just thought I'd run this issue past you folks. I'm running the bluez stack and utilities from Debian unstable on kernel 2.4.22-x1 (Xandros Desktop
2) on a Thinkpad T40p. It seems to run fine when I first boot; I am able to discover other devices, they can discover me. I am a newbie trying to use this protocol stack; so I haven't yet gotten any applications to work yet. However, it seems to function, basically.

The problem is bluez never seems to work again after a suspend/resume. I have tried shutting down the Bluetooth card (you can do with with Fn-F5 on a Thinkpad) before suspending, as well as doing hciconfig hci0 down, and even rmmod rfcomm, rmmod hci_usb (rmmod l2cap never seems to work) before suspending, and then modprobe them back afterwards. Though my machine does not hang or crash when coming back from suspend, the Bluetooth card never works again. hciconfig -a prints nothing.

Interestingly, before I installed the bluez stack, whenever I hit Fn-F5 it would freeze my machine. Now, it doesn't freeze it, but correctly toggles the little LED saying Bluetooth is active/inactive. When bluez is working, Fn-F5 makes hciconfig -a report the device there, then Fn-F5 again will make hciconfig -a report nothing. But after a suspend/resume, Fn-F5 will *still* toggle the Bluetooth LED, but hciconfig -a never shows a card.

Rebooting the system causes bluez to work again.

Mitsu

Signature · 13 lines
http://www.syntheticzero.com/



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
#1 lore raw

=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Mitsu Hadeishi

Hi, just thought I'd run this issue past you folks. I'm running the bluez stack and utilities from Debian unstable on kernel 2.4.22-x1 (Xandros Desktop 2)=20

=2E..

Quoted 5 lines

The problem is bluez never seems to work again after a suspend/resume. I have tried shutting down the Bluetooth card (you can do with with Fn-F5 on a Thinkpad) before suspending, as well as doing hciconfig hci0 down, and even rmmod rfcomm, rmmod hci_usb (rmmod l2cap never seems to work) before suspending, and then modprobe them back afterwards. =20

We get that on the Sharp Zaurus Linux PDA with any Bluetooth CF card. After=
a=20
suspend/resume of the PDA, all operations on the Bluetooth card just timeou= t.

Quoted 1 line

Rebooting the system causes bluez to work again.

Since the Zaurus does not have builtin Bluetooth, every Zaurus must use=20 Bluetooth CF cards so we're able to eject the card and reinsert it. Nothing= =20
else brings it back (apart from a reboot of course), not even things like=20 'cardctl reset'. But at least the ejecting and reinserting can be automated= =20
which I put into a script that is run on every resume. I guess you don't ha= ve=20
this option though if the Bluetooth device is built into your laptop.

BTW the Affix Bluetooth drivers have no problem with suspending and resumin= g.=20
Is your Bluetooth device supported by Affix?

=2D --=20
Colin Pinkney
http://www.cpinkney.org.uk
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFARlsIioDqRlN9/eURAqT7AKDPD9uUEcDw4TezKbAf3h+EgSMwlgCfTOXK ttu8XI/LaXZKvCFlANA0Wmc=3D
=3DnKSA
=2D----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#6 lore raw
In reply to Mitsu Hadeishi

Hi Mitsu,

On T40* the bluetooth adapter is an USB one, so you can try to remove all USB modules before suspend, and load them again after resume.

Quoted 22 lines · Mitsu Hadeishi

Hi, just thought I'd run this issue past you folks. I'm running the bluez stack and utilities from Debian unstable on kernel 2.4.22-x1 (Xandros Desktop
2) on a Thinkpad T40p. It seems to run fine when I first boot; I am able to discover other devices, they can discover me. I am a newbie trying to use this protocol stack; so I haven't yet gotten any applications to work yet. However, it seems to function, basically.

The problem is bluez never seems to work again after a suspend/resume. I have tried shutting down the Bluetooth card (you can do with with Fn-F5 on a Thinkpad) before suspending, as well as doing hciconfig hci0 down, and even rmmod rfcomm, rmmod hci_usb (rmmod l2cap never seems to work) before suspending, and then modprobe them back afterwards. Though my machine does not hang or crash when coming back from suspend, the Bluetooth card never works again. hciconfig -a prints nothing.

Interestingly, before I installed the bluez stack, whenever I hit Fn-F5 it would freeze my machine. Now, it doesn't freeze it, but correctly toggles the little LED saying Bluetooth is active/inactive. When bluez is working, Fn-F5 makes hciconfig -a report the device there, then Fn-F5 again will make hciconfig -a report nothing. But after a suspend/resume, Fn-F5 will *still* toggle the Bluetooth LED, but hciconfig -a never shows a card.

Quoted 3 lines

Rebooting the system causes bluez to work again.

Mitsu

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw
In reply to Colin Pinkney

Hi,

Just a note to the list regarding suspend/resume. I have a Thinkpad T40p which was having problems with bluez and suspend/resume. I just tried installing the Affix drivers on my Thinkpad T40p; but I had the same problem (well, it was slightly different, but the upshot was, Bluetooth didn't work when I came back from suspend).

So I tried a suggestion written by someone else on this list, which was not only to unload all of the Bluetooth modules, but also unload and reload the USB modules. This DID work, at least with the Affix drivers. Perhaps the same trick would work with the bluez drivers.

Basically I have a script which rmmod's all the affix modules, then rmmod's all the usb modules I could find (usb-uhci, hid, ehci-hcd) --- though I don't know if I really need to unload them all.

Doing a modprobe of those modules again caused the Affix drivers to come back (though sometimes I have to do it twice, i.e., run the rmmod's then the modprobes, then rmmod's again, then modprobes again).

Mitsu

Quoted 31 lines · Colin Pinkney

Since the Zaurus does not have builtin Bluetooth, every Zaurus must use Bluetooth CF cards so we're able to eject the card and reinsert it. Nothing else brings it back (apart from a reboot of course), not even things like 'cardctl reset'. But at least the ejecting and reinserting can be automated which I put into a script that is run on every resume. I guess you don't have this option though if the Bluetooth device is built into your laptop.

BTW the Affix Bluetooth drivers have no problem with suspending and resuming. Is your Bluetooth device supported by Affix?

- --
Colin Pinkney
http://www.cpinkney.org.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFARlsIioDqRlN9/eURAqT7AKDPD9uUEcDw4TezKbAf3h+EgSMwlgCfTOXK ttu8XI/LaXZKvCFlANA0Wmc=
=nKSA
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=Click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

Signature · 13 lines
http://www.syntheticzero.com/



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
maintainer
#3 lore raw

Hi Mitsu,

Quoted 5 lines

Just a note to the list regarding suspend/resume. I have a Thinkpad T40p which was having problems with bluez and suspend/resume. I just tried installing the Affix drivers on my Thinkpad T40p; but I had the same problem (well, it was slightly different, but the upshot was, Bluetooth didn't work when I came back from suspend).

I think the problem is in the USB subsystem at the moment. There are some outstanding issues with some USB cards, but Alan Stern is going to fix them. This will only happen for 2.6.x and I don't think that these issues can be solved in 2.4, too.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#5 lore raw
In reply to Mitsu Hadeishi

Am Di, den 09.03.2004 schrieb Mitsu Hadeishi um 23:54:

Quoted 1 line

Hi,

Hi!

Quoted 6 lines

Just a note to the list regarding suspend/resume. I have a Thinkpad T40p which was having problems with bluez and suspend/resume. I just tried installing the Affix drivers on my Thinkpad T40p; but I had the same problem (well, it was slightly different, but the upshot was, Bluetooth didn't work when I came back from suspend).

Quoted 6 lines

So I tried a suggestion written by someone else on this list, which was not only to unload all of the Bluetooth modules, but also unload and reload the USB modules. This DID work, at least with the Affix drivers. Perhaps the same trick would work with the bluez drivers.

Quoted 1 line

From my experience simply unloading the USB host controller driver

should be fully sufficient!
What happens is that the host controller is first removed. With removing the host all devices disappear and are freed automatically. When the system comes back simply insmod the host controller driver again. The host will come back up and all devices are discovered as new devices and will be initialised properly.

It may be though that you have to wait a moment after removing the host controller driver module, like "sleep 1" before going to sleep. The 2.4. kernel still has some problems to identify in some circumstances if all pre-suspend actions have been performed properly.

On Debian I do on suspend

/etc/hotplug/usb.rc stop
sleep 1

and of course the inverse on resume

/etc/hotplug/usb.rc start

without sleeping.

Works really good and also prevents some other nasty USB problems.

Quoted 1 line

Mitsu

CU
nils faerber

Signature · 16 lines
kernel concepts          Tel: +49-271-771091-12
Dreisbachstr. 24         Fax: +49-271-771091-19
D-57250 Netphen          D1 : +49-170-2729106
--



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
#4 lore raw
In reply to Marcel Holtmann

=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Marcel Holtmann

Hi Mitsu,

Quoted 1 line

Just a note to the list regarding suspend/resume. I have a Thinkpad T4=

0p

Quoted 9 lines
Quoted 4 lines

which was having problems with bluez and suspend/resume. I just tried installing the Affix drivers on my Thinkpad T40p; but I had the same problem (well, it was slightly different, but the upshot was, Bluetooth didn't work when I came back from suspend).

I think the problem is in the USB subsystem at the moment. There are some outstanding issues with some USB cards, but Alan Stern is going to fix them. This will only happen for 2.6.x and I don't think that these issues can be solved in 2.4, too.

This also happens with CF cards on the Sharp Zaurus. The only way I have fo= und=20
to get Bluetooth cards to come back after a suspend is to do:

cardctl eject
cardctl insert

I think the Bluetooth kernel modules are 'busy' after a suspend so you cann= ot=20
remove them and insmod them again.

The Affix drivers survive suspend/resume fine on the Zaurus, but I much pre= fer=20
the BlueZ drivers.

=2D --=20
Colin Pinkney
http://www.cpinkney.org.uk
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAT12YioDqRlN9/eURAk2EAJ9XrmIdyTEwxEYPpGM+KOyq1+r1qgCfUVlL kdfRBgh5ZVP//GjGXcADaCQ=3D
=3DxaYQ
=2D----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users