# HAL eating CPU

## November

I'm not quiet sure, if it's good place for this problem  :Wink: 

I've got problem with HAL since I can remember, but I've never had time or any idea how to debug. Without any cause (during movie or browsing web or when chatting on Pidgin or what it's idle) it's starts to freeze my CPU, load is 10 and more, mouse is barely moving, the only way to free CPU is "killall hald". To debug I run:

hald  --daemon=no --verbose=yes 2> hal_err_log 1> hal_log 

and waited for freeze, here is output: 

```
$ cat hal_log 

in hal-storage-cleanup-all-mountpoints

hal_mtab = ''
```

```
$ tail hal_err_log -n 20

00:53:18.369 [I] hotplug.c:138: /sys/class/leds/iwl-phy0::TX is a device (subsystem)

00:53:18.369 [I] osspec.c:966: hal_util_find_known_parent: '/sys/class/leds/iwl-phy0::TX'->'/sys/devices/pci0000:00/0000:00:1c.5/0000:0c:00.0'

00:53:18.369 [I] device.c:4415: add_dev: subsys=leds sysfs_path=/sys/class/leds/iwl-phy0::TX dev= parent_dev=0x00695500

[5531]: 00:54:08.551 [D] addon-storage.c:542: Media insertion detected on /dev/hda

00:54:08.551 [D] hald_dbus.c:1652: udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D, key=storage.removable.media_available

00:54:08.551 [I] hald_dbus.c:3052: entering, local_interface=1

00:54:08.551 [D] hald_dbus.c:3061: udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D

00:54:08.551 [I] blockdev.c:1666: blockdev_rescan_device: udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D

woohoo

[11367]: 00:54:08.697 [D] probe-storage.c:155: Doing probe-storage for /dev/hda (bus ide) (drive_type cdrom) (udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D) (--only-check-for-fs==1)

[11367]: 00:54:08.697 [D] probe-storage.c:163: Doing open ("/dev/hda", O_RDONLY | O_NONBLOCK)

00:54:13.578 [I] osspec.c:241: SEQNUM=2293, ACTION=remove, SUBSYSTEM=leds, DEVPATH=/sys/class/leds/iwl-phy0::assoc, DEVNAME=, IFINDEX=0

00:54:13.578 [I] device.c:4485: remove_dev: subsys=leds sysfs_path=/sys/class/leds/iwl-phy0::assoc

00:54:13.578 [W] device.c:4489: Error removing device

00:54:13.584 [I] osspec.c:241: SEQNUM=2294, ACTION=remove, SUBSYSTEM=leds, DEVPATH=/sys/class/leds/iwl-phy0::RX, DEVNAME=, IFINDEX=0

00:54:18.592 [I] device.c:4485: remove_dev: subsys=leds sysfs_path=/sys/class/leds/iwl-phy0::RX

00:54:18.592 [W] device.c:4489: Error removing device

00:54:18.592 [I] osspec.c:241: SEQNUM=2296, ACTION=remove, SUBSYSTEM=leds, DEVPATH=/sys/class/leds/iwl-phy0::radio, DEVNAME=, IFINDEX=0

00:54:18.592 [I] device.c:4485: remove_dev: subsys=leds sysfs_path=/sys/class/leds/iwl-phy0::radio

00:54:18.592 [W] device.c:4489: Error removing device

```

last 20 lines of 8000 before `killall hald`

I'm not quite sure what does it mean. I've wireless network card, but it also happens, when it's off... At first (few month ago) I thought that there is problem with frequency scaling, but it also freeze when I disabled it in kernel.

Any ideas? Thanks in advance.

----------

## jomen

 *Quote:*   

> /sys/class/leds/iwl-phy0::TX is a device (subsystem) 

 

Since messages relating to something having to do with LEDs (for your wireless network card) appear very often I'd disable these in the kernel and make new one - if not really needed.

-> Device Drivers -> LED Support

and/or

-> Device Drivers -> Network device support -> Wireless LAN -> Wireless LAN (IEEE 802.11)  -> Intel Wireless Wifi

This is just guessing!

----------

## November

Maybe it wasn't the only reason... On new kernel CPU freeze again:

```
[5129]: 16:00:30.006 [I] addon-storage.c:363: ... device /dev/hda is not locked on HAL

[5129]: 16:54:56.233 [D] addon-storage.c:542: Media insertion detected on /dev/hda

16:54:56.233 [D] hald_dbus.c:1652: udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D, key=storage.removable.media_available

16:54:56.234 [I] hald_dbus.c:3052: entering, local_interface=1

16:54:56.234 [D] hald_dbus.c:3061: udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D

16:54:56.234 [I] blockdev.c:1666: blockdev_rescan_device: udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D

woohoo

[7194]: 16:54:56.236 [D] probe-storage.c:155: Doing probe-storage for /dev/hda (bus ide) (drive_type cdrom) (udi=/org/freedesktop/Hal/devices/storage_model_TSSTcorpCD/DVDW_TS_L632D) (--only-check-for-fs==1)

[7194]: 16:54:56.236 [D] probe-storage.c:163: Doing open ("/dev/hda", O_RDONLY | O_NONBLOCK)

16:55:11.302 [I] blockdev.c:1622: hald-probe-storage --only-check-for-media returned 0 (exit_type=1)

[5129]: 16:55:41.616 [I] addon-storage.c:355: Checking whether device /dev/hda is locked on HAL

[5129]: 16:55:41.616 [I] addon-storage.c:363: ... device /dev/hda is not locked on HAL

```

If you look at the time first msg when freeze is 

[5129]: 16:54:56.233 [D] addon-storage.c:542: Media insertion detected on /dev/hda

hda is my cdrom, which I barely use. Moreover I was away from computer before freeze, the only working app was gnome, transmission and terminal. There is the same error in my first post...

In dmsg I found

```
hda: status timeout: status=0xd0 { Busy }

hda: possibly failed opcode: 0xa0

hda: Strange, packet command initiated yet DRQ isn't asserted

iwlagn 0000:0c:00.0: Microcode SW error detected.  Restarting 0x2000000.

hda: status timeout: status=0xd0 { Busy }

hda: possibly failed opcode: 0xa0

hda: drive not ready for command

hda: status timeout: status=0xd0 { Busy }

hda: possibly failed opcode: 0xa0

hda: drive not ready for command

end more more more
```

but I'm not sure if it is connected, no time.

Any ideas?

----------

