CD/DVD drive no longer detected after resume from suspend

Hi, recently I received a HP Pavilion DV6 laptop. Installed openSUSE
Tumbleweed 20240801 on the machine. I can play an audio CD with VLC.

If machine is suspended and then unsuspended, then attempt to play the
audio cd again with VLC, audio playback FAILS and produces error
messages, > “VLC is unable to open the MRL ‘cdda:///dev/sr0’”. Check the
log for details.

vlc-log
dvdread error: Could not open /dev/cdrom
dvdread error: DVDRead cannot open source: /dev/cdrom
dvdhav error: Can’tstat /dev/sr0
dvdhav error: vm: failed to open/read the DVD
repeats…

Before suspending > inxi -Dd
Drives:
Local Storage: total: 111.79 GiB used: 18.23 GiB (16.3%)
ID-1: /dev/sda vendor: Crucial model: CT120M500SSD1 size: 111.79 GiB
Optical-1: /dev/sr0 vendor: hp model: DVDRAM GT80N dev-links: cdrom
Features: speed: 24 multisession: yes audio: yes dvd: yes
rw: cd-r,cd-rw,dvd-r,dvd-ram

:~> lsscsi -v
[0:0:0:0] disk ATA Crucial_CT120M50 MU05 /dev/sda
dir: /sys/bus/scsi/devices/0:0:0:0
[/sys/devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0]
[1:0:0:0] cd/dvd hp DVDRAM GT80N R102 /dev/sr0
dir: /sys/bus/scsi/devices/1:0:0:0
[/sys/devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0]
list_ndevices: scandir: /sys/class/nvme/: No such file or directory
NVMe module may not be loaded

After suspending > inxi -Dd
Drives:
Local Storage: total: 111.79 GiB used: 18.25 GiB (16.3%)
ID-1: /dev/sda vendor: Crucial model: CT120M500SSD1 size: 111.79 GiB
Message: No optical or floppy data found.

:~> lsscsi -v
[0:0:0:0] disk ATA Crucial_CT120M50 MU05 /dev/sda
dir: /sys/bus/scsi/devices/0:0:0:0
[/sys/devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0]
list_ndevices: scandir: /sys/class/nvme/: No such file or directory
NVMe module may not be loaded

dmesg output after suspending:

:~>sudo dmesg | tail -30

[ 231.853253] [ T2862] [drm] ib test on ring 7 succeeded
[ 233.259080] [ T2810] OOM killer enabled.
[ 233.259084] [ T2810] Restarting tasks … done.
[ 233.266403] [ T2810] random: crng reseeded on system resumption
[ 233.275807] [ T2810] PM: suspend exit
[ 233.341347] [ T1381] RTL8208 Fast Ethernet r8169-0-500:00: attached
PHY driver (mii_bus:phy_addr=r8169-0-500:00, irq=MAC)
[ 233.626929] [ T2912] r8169 0000:05:00.0 eno1: Link is Down
[ 234.854287] [ T1453] wlo1: authenticate with fe:f5:28:9e:a6:a4
(local address=2c:d0:5a:15:17:86)
[ 234.854297] [ T1453] wlo1: send auth to fe:f5:28:9e:a6:a4 (try 1/3)
[ 234.856125] [ T734] wlo1: authenticated
[ 234.859870] [ T2866] wlo1: associate with fe:f5:28:9e:a6:a4 (try 1/3)
[ 234.863248] [ T734] wlo1: RX AssocResp from fe:f5:28:9e:a6:a4
(capab=0x411 status=0 aid=5)
[ 234.863360] [ T734] wlo1: associated
[ 234.863474] [ T600] ath: EEPROM regdomain: 0x8348
[ 234.863477] [ T600] ath: EEPROM indicates we should expect a
country code
[ 234.863479] [ T600] ath: doing EEPROM country->regdmn map search
[ 234.863481] [ T600] ath: country maps to regdmn code: 0x3a
[ 234.863482] [ T600] ath: Country alpha2 being used: US
[ 234.863484] [ T600] ath: Regpair used: 0x3a
[ 234.863486] [ T600] ath: regdomain 0x8348 dynamically updated by
country element
[ 235.423237] [ T544] ata1: SATA link up 6.0 Gbps (SStatus 133
SControl 300)
[ 235.423594] [ T544] ata1.00: supports DRM functions and may not be
fully accessible
[ 235.459202] [ T544] ata1.00: supports DRM functions and may not be
fully accessible
[ 235.495515] [ T544] ata1.00: configured for UDMA/133
[ 235.514353] [ T9] ata1.00: Enabling discard_zeroes_data
[ 235.580834] [ T547] ata2: SATA link down (SStatus 0 SControl 300)
[ 235.580851] [ T547] ata2: limiting SATA link speed to
[ 240.911043] [ T547] ata2: SATA link down (SStatus 0 SControl 3F0)
[ 240.911062] [ T547] ata2.00: disable device
[ 240.911111] [ T9] ata2.00: detaching (SCSI 1:0:0:0)

SCSI 1:0:0:0 is the CD/DVD drive here. Why is ata2 being detached and
disabled when unsuspending? Can you tell me what to look more deeply at
as to why this may be happening on the machine?

-Best Wishes

Examine the driver supporting the device…

/usr/sbin/hwinfo --cdrom

It is likely the ‘sr_mod’ SCSI driver. Does unloading and reloading that driver help to re-initialise it after a resume? If so, this can be automated using a simple systemd-sleep script.

1 Like

Another thought - does re-scanning effectively reinitialise the CDROM device?

As root do
echo 1 > /sys/devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0/rescan
Can you access the device in question after that?

1 Like

Very good to hear from you.

:~ # /usr/sbin/hwinfo --cdrom
27: SCSI 100.0: 10602 CD-ROM (DVD)                               
 [Created at block.259]
 Unique ID: KD9E.zF69MlePIEE
 Parent ID: 7EWs.7rDQ0oAoDd2
 SysFS ID: /class/block/sr0
 SysFS BusID: 1:0:0:0
 SysFS Device Link: /devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0
 Hardware Class: cdrom
 Model: "hp DVDRAM GT80N"
 Vendor: "hp"
 Device: "DVDRAM GT80N"
 Revision: "R102"
 Driver: "ahci", "sr"
 Driver Modules: "ahci", "sr_mod"
 Device File: /dev/sr0 (/dev/sg1)
 Device Files: /dev/sr0, /dev/disk/by-path/pci-0000:00:11.0-ata-2, /dev/disk/by-id/wwn-0x5001480000000000, /dev/disk/by-diskseq/3, /dev/disk/by-id/ata-hp_DVDRAM_GT80N_M5BCCF11351, /dev/disk/
by-path/pci-0000:00:11.0-ata-2.0, /dev/cdrom
 Device Number: block 11:0 (char 21:1)
 Features: CD-R, CD-RW, DVD, DVD-R, DVD-RW, DVD-R DL, DVD+R, DVD+RW, DVD+R DL, DVD-RAM, MRW, MRW-W
 Config Status: cfg=no, avail=yes, need=no, active=unknown
 Attached to: #23 (SATA controller)
 Drive Speed: 24
:~ #
:~ # lsmod | grep sr_mod
sr_mod                 28672  0
cdrom                  77824  2 pktcdvd,sr_mod
scsi_mod              344064  9 st,scsi_dh_emc,sd_mod,scsi_dh_alua,pktcdvd,libata,sg,scsi_dh_rdac,sr_mod
scsi_common            16384  7 st,scsi_mod,sd_mod,pktcdvd,libata,sg,sr_mod
:~ #

Suspending and unsuspending machine.

:~ # rmmod sr_mod
:~ # modprobe sr_mod

:~ # inxi -Dd
Drives:
 Local Storage: total: 111.79 GiB used: 18.33 GiB (16.4%)
 ID-1: /dev/sda vendor: Crucial model: CT120M500SSD1 size: 111.79 GiB
 Message: No optical or floppy data found.
:~ # modprobe sr_mod --first-time
modprobe: ERROR: could not insert 'sr_mod': Module already in kernel
:~ # modprobe --first-time ahci
modprobe: ERROR: could not insert 'sr_mod': Module already in kernel

It does not appear to help reinitialize in this instance.
So the sr_modand ahci, module/s compiled into the openSUSE kernel it appears.

:~ # echo 1 > /sys/devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0/rescan
-bash: /sys/devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0/rescan: No such file or directory

This does not seem to work either. Is what you suggest above similar to unbinding and rebinding the device? Is there an error somewhere in the echo line above maybe? I am not knowledgeable enough to say personally right now.

Thanks

I wanted to add this:

Before suspend:

:~ # tree /sys/block

/sys/block
├── dm-0 -> ../devices/virtual/block/dm-0
├── dm-1 -> ../devices/virtual/block/dm-1
├── dm-2 -> ../devices/virtual/block/dm-2
├── dm-3 -> ../devices/virtual/block/dm-3
├── loop0 -> ../devices/virtual/block/loop0
├── loop1 -> ../devices/virtual/block/loop1
├── loop2 -> ../devices/virtual/block/loop2
├── loop3 -> ../devices/virtual/block/loop3
├── loop4 -> ../devices/virtual/block/loop4
├── loop5 -> ../devices/virtual/block/loop5
├── loop6 -> ../devices/virtual/block/loop6
├── loop7 -> ../devices/virtual/block/loop7
├── sda -> ../devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0/block/sda
└── sr0 -> ../devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0/block/sr0

After unsuspend:

:~> tree /sys/block
/sys/block
├── dm-0 -> ../devices/virtual/block/dm-0
├── dm-1 -> ../devices/virtual/block/dm-1
├── dm-2 -> ../devices/virtual/block/dm-2
├── dm-3 -> ../devices/virtual/block/dm-3
├── loop0 -> ../devices/virtual/block/loop0
├── loop1 -> ../devices/virtual/block/loop1
├── loop2 -> ../devices/virtual/block/loop2
├── loop3 -> ../devices/virtual/block/loop3
├── loop4 -> ../devices/virtual/block/loop4
├── loop5 -> ../devices/virtual/block/loop5
├── loop6 -> ../devices/virtual/block/loop6
├── loop7 -> ../devices/virtual/block/loop7
└── sda -> ../devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0/block/sda

All that you show is just a follow up effect of the lost device. Show full dmesg output immediately after resume, upload to https://paste.opensuse.org/.

1 Like

Ok thanks for pointing that out. I uploaded the dmesg log file to openSUSE Paste

Stab in the dark - try booting with libata.noacpi=1 kernel parameter.

1 Like

Added libata.noacpi=1 to kernel parameters and updated grub. Your suggestion has worked it seems! Can you add anymore insight into what is going on with the situation here? I believe there were numerous acpi related journal errors before.

Thank you for your solution! :grinning:

ACPI tables can define methods to be invoked for devices during suspend. This parameter avoids calling these methods. Apparently, in your case some code is buggy. To say more, one would need to decompile ACPI tables and study the code.

Errors visible in dmesg output are from ACPI calling into OS. It is impossible to say whether they are related.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.