Hibernation works great, but loses /dev/cdrom on resume

Posts: 959
After a little bit of tweaking, I have for the first time since using linux on a laptop been able to use the suspend to disk option and have my system resume as i would expect, except for one little detail.
This laptop has a hard disk that is reported as a sata drive to the system but it really is an ide drive, so it obviously uses some form of adapter in between.
The Optical drive might be of the same variety, but wether it is or not, it is one of those hot swappable drives so the use of dma is out of the question (I stand to be corrected on this issue), which means I have to use a work-around (hdc=noprobe) as a kernel option in my menu.list.
Having used the suspend to disk option for somewhere near a month now, and beta testing mepis6.04 which is looking very promising indeed, I only found out about the issue when I slipped in a cd to read its contents, only to find that my cdrom device did not exist. Restarting the system works perfectly, but hibernating and resuming loses the drive every time without fail.
Anybody got any clues?
Mike P

Worth a try, but it still loses the drive
Posts: 959
I will test the effect it has on the drive too. If it makes a difference with dma or improved performance after I restart to get it back, I will keep the change.
I have sent an email to dev@mepis because this may be an issue related to the beta3 release.
Sorry, I should have said that I was testing Beta3 at the first and apart from this issue (and one from kmail that is no different to the sm6 official), I can not fault it on my machine
----EDIT----
My first test, making an iso image of the SM6.01 DVD went really well. System had full responsiveness, little or no impact on opening or closing programs, better than hdc=noprobe. Will try burning the iso back to disk soon to see if it makes a difference to the buffer, which used to run at 20-30% when burning a dvd and drop to near zero if I tried to do anything other than watch it.
Also, drive is now recognised as /dev/scd0 now instead of /dev/hdc, but still no dma.
Mike P
--------------------
Life may not be the party we thought, but while we're here, we may as well dance.
Break M$'s shackles from your feet and free yourself with Mepis
dma
Posts: 2299
There being no dma is correct, since dma is an IDE related thing. Performance should now however be indeed much better.
EDIT
BTW: maybe you can tweak /etc/powersave/sleep and add libata to the modules to be unloaded before hibernating. Just a wild guess, but it might work.....
Newbie or not Newbie, there's always a question

I'll give it a whirl
Posts: 959
I am burning a SM6.01 dvd right now and the fifo buffer is changing rapidly from 14% to 100% and everywhere in between, mostly above 25% and under 84%, but it's a huge improvement over the 30% max I had before. Still drops to the low 10's as I open programs, but they open at normal speed instead of 3-4 times slower and I would estimate it has an average of 45% while writing at 2x speed.
As for the libata, I take it I add it to the
UNLOAD_MODULES_BEFORE_SUSPEND2DISK=""
line and leave the rest of the file intact. The only question is do I need to add it to the
SUSPEND2DISK_RESTART_SERVICES=""
line to have it restart on resume given it's a module?
Thanks for your help thus far Carlops, you've been a great help and I see you're helping another on a similar subject.
Mike P
--------------------
Life may not be the party we thought, but while we're here, we may as well dance.
Break M$'s shackles from your feet and free yourself with Mepis
unload modules
Posts: 2299
The only thing you need to change is this: UNLOAD_MODULES_BEFORE_SUSPEND2DISK=""
Make sure to paste in all the default modules that are in the comment a few line up and add libata.
No guarantees it will work, but it's worth a try.
Newbie or not Newbie, there's always a question
I already seen on Toshiba -
Posts: 147
I already seen on Toshiba - there was no CD/DVD after resume (SM6). But next hibarnate/resume generally brings it back. Did you try it?
Rgds,
-dim

As you said, it does return
Posts: 959
I already seen on Toshiba - there was no CD/DVD after resume (SM6). But next hibarnate/resume generally brings it back. Did you try it?
I just tried a hibernate, wake, hibernate again and wake again and you are correct dim, the drive does come back. It's a whole lot faster than restarting so I might employ that tactic until the real issue is fixed or I can find a workaround.
In the meantime, I will have a go at Carlops suggestion. Nothing to lose, but now that I am aware of this issue, I will have to test every action by hibernating and waking the machine twice.
Thanks for your input Dim
Mike P
--------------------
Life may not be the party we thought, but while we're here, we may as well dance.
Break M$'s shackles from your feet and free yourself with Mepis

libata does not do it.
Posts: 959
Thanks for the suggestion Carlops. I tried editing /etc/powersave/sleep and restarting twice, each time observing the contents of /var/log/messages to see the differences, but still no better.
I have since discovered that my card reader fails after the first suspend to disk and it never comes back, until the system is restarted. The cdrom re-appears every 2nd hibernate but the card reader is awol
I just finished telling the devs I could not fault this beta at the beginning of the week, only to find this issue. To be fair though, I believe this issue has been carried over since the release of SM6, so in a sense, I guess I was right in a round about way.
Mike P
--------------------
Life may not be the party we thought, but while we're here, we may as well dance.
Break M$'s shackles from your feet and free yourself with Mepis
card reader
Posts: 2299
The card reader should be fixable. It probably has its own module, which you should unload. I was afraid about libata indeed, since it is so close to the system core. But unloading the cardreader module for suspend should definitely fix it.
Can you find the module it loads?
Newbie or not Newbie, there's always a question

The module for the card reader is sdhci
Posts: 959
I found the line in /var/log/messages and I did a trial suspend and restore with sdhci added to the UNLOAD_MODULES_BEFORE_SUSPEND2DISK= line (along with all the others) and upon resume, the card reader worked as it should and I didn't think I'd need to try it more than once. Thank you for that bit of advice.
The module for the optical drive escapes me, but if it helps, this section of my /var/log/messages may help, even though it's a long shot...
ata1: PATA max UDMA/133 cmd 0x1F0 ctl 0x3F6 bmdma 0xAF50 irq 14
ata1: dev 0 ATA-7, max UDMA/100, 234441648 sectors: LBA48
ata1(0): applying bridge limits
ata1: dev 0 configured for UDMA/100
scsi0 : ata_piix
Vendor: ATA Model: SAMSUNG HM120JC Rev: YL10
Type: Direct-Access ANSI SCSI revision: 05
ata2: PATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xAF58 irq 15
ata2: dev 0 ATAPI, max UDMA/33
ata2(0): applying bridge limits
ata2: dev 0 configured for UDMA/33
scsi1 : ata_piix
Vendor: MATSHITA Model: DVD-RAM UJ-831S Rev: 1.01
Type: CD-ROM ANSI SCSI revision: 05
Driver 'sd' needs updating - please use bus_type methods
SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 234441648 512-byte hdwr sectors (120034 MB)
SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3 sda4
sd 0:0:0:0: Attached scsi disk sda
sr0: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sd 0:0:0:0: Attached scsi generic sg0 type 0
sr 1:0:0:0: Attached scsi generic sg1 type 5
Mike P
--------------------
Life may not be the party we thought, but while we're here, we may as well dance.
Break M$'s shackles from your feet and free yourself with Mepis
I am not really sure there
Posts: 2299
I am not really sure there is a specific module for the optical drive. Someone please correct me if I am wrong, but IMO the optical drive is driven by a generic ATA driver. That's why I hoped the libata thing might fix it. But maybe I am wrong, and someone more knowledgeable than I can shed more light on this.
Newbie or not Newbie, there's always a question
maybe
Posts: 2299
I have a Toshi with a sata drive and a CD that is somehow hooked up to the sata controller (emulator?) as well. Instead of hdc=noprobe I do the following:
To GRUB command line, add: combined_mode=libata
In /etc/modprobe.d/modprobe.conf, add line: options libata atapi_enabled=1
Maybe it works for you as well.
Newbie or not Newbie, there's always a question