Bug 357401

Summary: lenovo X60: cdrom in docking station not initializing
Product: [openSUSE] openSUSE 10.3 Reporter: Juergen Weigert <jw>
Component: Mobile DevicesAssignee: Holger Macht <hmacht>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: aj, behlert
Version: Final   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 10.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 357354    
Attachments: Fixing the hook causes resume to hang.
yat comes up with a long conflicts list for this kernel

Description Juergen Weigert 2008-01-30 20:25:59 UTC
The cdrom drive (actually a dvdrw) of the docking station is dead.
It only comes alive, if I reboot the laptop while in the docking station.
Comment 1 Holger Macht 2008-01-31 12:25:39 UTC
Can you try 'docker dock' as root after docking and post the output please? ata_piix is loaded, right? If booted with docking station, the cdrom is /dev/sr0 (sata) not something like /dev/hdc?
Comment 2 Holger Macht 2008-01-31 14:00:20 UTC
Do you have an X60s? If so please add it to /usr/lib/dockutils/hooks/thinkpad/60x60 where it says:

[ "$MODEL" = "THINKPAD X60" ] || [ "$MODEL" = "THINKPAD X40" ] || exit 0;

to something link

[ "$MODEL" = "THINKPAD X60" ] || [ "$MODEL" = "THINKPAD X40" ] || [ "$MODEL = "THINKPAD X60s" ] || exit 0;

Thanks.
Comment 3 Juergen Weigert 2008-02-01 15:42:10 UTC
Yes, ata_piix is loaded.  Yes, it is /dev/sr0

no change after adding  [ "$MODEL" = "THINKPAD X60x" ]

directly after reboot in docking station, cdrom works:
# docker dock
Fri Feb  1 00:41:53 CET 2008: running thinkpad hooks for event dock.
docking should have been done automatically by the dock driver...

while still in docking station:
suspend to ram, resume.
eject cdrom now fails:
open("/dev/sr0", O_RDONLY|O_NONBLOCK)   = 3
ioctl(3, CDROMEJECT, 0x804c456)         = -1 EIO (Input/output error)

# . /usr/lib/dockutils/common_functions
# unregister_cdroms
# scan_scsi_hosts

brings it back to life. 

scan_scsi_hosts also helps with the original scenario "standalone reboot, dock" - it reliably awakens the drive.
Any additional hints how to debug why the docking hooks do not trigger?

(An open filedescriptor on /dev/ttyS0 -- the serial port on the docking
station -- is still open, and fully functional. cool)
Comment 4 Holger Macht 2008-02-01 16:41:13 UTC
(In reply to comment #3 from Juergen Weigert)
> no change after adding  [ "$MODEL" = "THINKPAD X60x" ]
                                                    ^
This is a typing error? Anyway, it has to match what 

$ hal-get-property --udi /org/freedesktop/Hal/devices/computer --key smbios.system.version

reports, in upper case. For testing, it would be good enough to remove the whole line, the script just must not exit.

> while still in docking station:
> suspend to ram, resume.
> eject cdrom now fails:
> open("/dev/sr0", O_RDONLY|O_NONBLOCK)   = 3
> ioctl(3, CDROMEJECT, 0x804c456)         = -1 EIO (Input/output error)

After fixing the above, can you 'docker undock' before suspend and 'docker dock' after resume? That's what is supposed to be done automatically.

> (An open filedescriptor on /dev/ttyS0 -- the serial port on the docking
> station -- is still open, and fully functional. cool)

Without the dock station? Feature, not a bug ;-) 

Comment 5 Juergen Weigert 2008-02-04 11:30:04 UTC
Typo in my report.
I'll comment out the line, and test docker tonight.
Comment 6 Juergen Weigert 2008-02-04 21:46:59 UTC
Created attachment 193118 [details]
Fixing the hook causes resume to hang.
Comment 7 Holger Macht 2008-02-04 22:17:26 UTC
Ok, I experienced this some days ago and already did some debugging. This seems like a race where HAL tries to read from /dev/sr0 in the same moment when the device disappears. At least this was the outcome from the strace. I'll still have to track this down but didn't find the time yet. Will do this week...
Comment 8 Holger Macht 2008-03-13 15:28:29 UTC
Can you please test the kernel from my home project:

https://build.opensuse.org/package/show?package=kernel-default&project=home%3Ahmacht

Also, please remove package dockutils before testing, the new kernel obsoletes this package. Thanks.
Comment 9 Juergen Weigert 2008-03-13 19:23:31 UTC
Created attachment 201478 [details]
yat comes up with a long conflicts list for this kernel

Is this kernel supposed to work with 10.3?
I need a stable laptop. Installing stable was not helpful, last time I tried...
Comment 10 Holger Macht 2008-03-13 20:33:53 UTC
No idea, I didn't test on 10.3. Let's wait if AJ reports any results.
Comment 11 Holger Macht 2008-06-02 15:39:05 UTC

*** This bug has been marked as a duplicate of bug 390822 ***