Bug 99589 - hald-addon-storage hangs in ide_do_drive_cmd after wakeup
Summary: hald-addon-storage hangs in ide_do_drive_cmd after wakeup
Status: RESOLVED FIXED
: 120344 (view as bug list)
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Kernel (show other bugs)
Version: Beta 4
Hardware: PowerPC All
: P5 - None : Critical
Target Milestone: ---
Assignee: Jens Axboe
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-29 22:22 UTC by Andreas Schwab
Modified: 2006-09-28 13:26 UTC (History)
3 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
sysrq-t output (20.87 KB, text/plain)
2005-08-01 16:40 UTC, Andreas Schwab
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2005-07-29 22:22:23 UTC
When the iBook wakes up from suspend to RAM the hald-addon-storage hangs in 
ide_do_drive_cmd, and subsequently other processes will hang there or in other 
parts of the kernel (mostly filesystem).
Comment 1 Olaf Hering 2005-08-01 13:33:27 UTC
add 'echo t > /proc/sysrq-trigger ; dmesg ' output
Comment 2 Andreas Schwab 2005-08-01 16:40:20 UTC
Created attachment 44217 [details]
sysrq-t output
Comment 3 Olaf Hering 2005-08-01 16:45:20 UTC
I see '*cdrom*' in the backtrace so I pass it on to Jens. I assume that is
current 2.6.13-rc4+?
Comment 4 Andreas Schwab 2005-08-01 18:04:41 UTC
It's (almost) vanilla 2.6.13-rc4. 
Comment 5 Jens Axboe 2005-08-01 19:43:44 UTC
Andreas, how long did you wait? Just curious what happened when the commands
timed out. What kernel exactly are you running? Is this a regression or did you
never test suspend/resume on this laptop before? IOW, please fill out some more
details about this :)
Comment 6 Andreas Schwab 2005-08-01 19:59:04 UTC
I didn't see any timeout happening, not even after several minutes.  See 
comment #4 for the exact kernel.  It only happens when hald is running, 
nothing else is ever running in this kind of lockup.  Other than that suspend 
to ram is working almost perfectly.  How can I know what details do you 
need??? 
Comment 7 Jens Axboe 2005-08-01 20:09:25 UTC
Is this a regression? Could you strace hald and see exactly what it is up to at
this point? Probably that wont get us the actual command, but at least it should
help...

Also, "(almost) vanilla 2.6.13-rc4" isn't exactly an exact kernel version.

It seems to me that both the cdrom and hard drive are hanging waiting for
response, not just the cdrom.
Comment 8 Andreas Schwab 2005-08-01 20:28:28 UTC
It happens exactly since hal exists.  Nothing else has this problem. 
 
For the purpose of this bug this is exactly vanilla 2.6.13-rc4. 
 
Comment 9 Andreas Schwab 2005-08-01 20:30:45 UTC
hald-addon-storage does nothing else but open /dev/hdb. 
Comment 10 Jens Axboe 2005-08-01 20:35:24 UTC
So if you disable cdrom checking, it works fine for hda?

What do you mean it happens since hal exists? What did you run on this ibook before?

Please just explain if this is a regression or not wrt the kernel, this is now
my 3rd time asking. Even if you can't be bothered to say what patches are
applied (I can't count the number of times people have told me exactly this. You
are probably right, but I always like to double check).
Comment 11 Andreas Schwab 2005-08-01 20:53:42 UTC
How do you disable cdrom checking? 
 
hal didn't exist in SLES9. 
 
How can I know whether this is a regression?  SLES9 surely didn't have this 
problem. 
Comment 12 Jens Axboe 2005-08-02 07:38:57 UTC
Olaf should know all about hal and this sort of thing, Olaf, see comment #11,
how can Andreas easiest test that?
Comment 13 Olaf Hering 2005-08-02 13:14:13 UTC
I dont know how to disable hal stuff, Danny may know.
Comment 14 Danny Al-Gaaf 2005-08-02 13:41:19 UTC
I never tried this, but I think you must comment out the related code and comile 
a new HAL package. 

Comment 15 Jens Axboe 2005-08-02 13:45:36 UTC
Huh, is this a joke? Surely there must be some way to tell hald to stay away
from a device?
Comment 16 Danny Al-Gaaf 2005-08-02 15:40:16 UTC
you can also try this:

add to: 
/usr/share/fdi/policy/10osvendor/10-storage-policy.fdi

behind this block:

!-- Handle drives with non-partitioned media  -->
    <match key="storage.no_partitions_hint" bool="true">
      <!-- optical drives -->
      <match key="storage.drive_type" string="cdrom">
        <merge key="storage.policy.mount_filesystem" type="string">auto</merge>

the line:
mergematch key="storage.media_check_enabled" type="bool">false</merge>

and restart hal
Comment 17 Andreas Schwab 2005-08-05 17:28:08 UTC
Disabling cdrom polling makes wakeup work again, but of course this is just a  
workaround since the file will be overwritten on each update.  
Comment 18 Olaf Hering 2005-08-05 19:57:28 UTC
can you try plain 2.6.12?
Comment 19 Andreas Schwab 2005-08-05 21:08:01 UTC
Same bug. 
Comment 20 Olaf Hering 2005-08-20 12:57:53 UTC
I did a fresh isntall and suspend to ram (closing the lid) works ok for me.
Comment 21 Andreas Schwab 2005-08-20 13:09:30 UTC
On what system? 
Comment 22 Olaf Hering 2005-08-20 13:11:06 UTC
300MHz ibook1.
Comment 23 Andreas Schwab 2005-08-20 13:15:29 UTC
Try a more recent one. 
Comment 24 Olaf Hering 2005-08-20 15:23:59 UTC
try with kernel-default and load ide-cd. or attach the used .config of your
custom kernel.
Comment 25 Andreas Schwab 2005-08-20 17:00:32 UTC
I'm not stupid, your prachtkernel has exactly the same bug, as expected. 
Comment 26 Carl-Daniel Hailfinger 2005-09-02 09:21:56 UTC
Does it still happen with beta4?

Does it also happen if no cd is in the cd-rom drive?

I see a similar problem on i386 with beta4:
suspend-to-disk hangs while suspending IFF I have a data cd in my cd-rom drive.
Since suspend-to-disk does suspend all devices and then resume the disk to write
out the image during suspend, the pattern looks similar.
Comment 27 Andreas Schwab 2005-09-02 12:30:56 UTC
2.6.13 is still broken. 
Comment 28 Carl-Daniel Hailfinger 2005-09-02 22:09:45 UTC
Maybe related to bug 115095.
Comment 29 Carl-Daniel Hailfinger 2005-09-05 07:54:53 UTC
It seems hald accesses the cdrom drive every two seconds. If the drive gets
opened/closed/activated/deactivated, hald will hang in state D until the cdrom
drive responds. So if the cdrom does not respond after resume, hald will hang
and with it everything else accessing the disks.
It may be hard to reproduce for some people because we are talking about a race
condition with hald here.
Comment 30 Olaf Hering 2005-10-06 11:25:46 UTC
*** Bug 120344 has been marked as a duplicate of this bug. ***
Comment 32 Jens Axboe 2005-10-06 13:44:37 UTC
Yeah, it looks like the case that benh diagnosed. We just need to find an
appropriate solution.
Comment 33 Andreas Schwab 2005-10-06 22:10:23 UTC
Ben's workaround is working for me. 
Comment 34 Olaf Hering 2005-10-11 06:32:19 UTC
This patch is now in 2.6.14-rc4.
Comment 35 Jens Axboe 2005-10-11 08:37:46 UTC
Lets just stick with it for the SL10 base at least, I've added the patch.