Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 363555 - kernel 2.6.36-gentoo-r5 libata driver broken support of CD-R/RW media
Summary: kernel 2.6.36-gentoo-r5 libata driver broken support of CD-R/RW media
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: http://gentoo.ru/node/22590
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-14 07:45 UTC by Sergey S. Starikoff
Modified: 2012-07-06 13:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
2.6.38-gentoo-r6 kernel config file (2.6.38-gentoo-r6.config,67.13 KB, application/octet-stream)
2011-06-16 05:57 UTC, Sergey S. Starikoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey S. Starikoff 2011-04-14 07:45:37 UTC
I'm using CD drive (and especially it's write function) rather rarely.
The bug was seen on tho Gentoo installations and three CD-drives (all of them --- IDE, managed via libata): one CD-only Sony writer, second one --- Combo (read/write CD, read DVD) and the last one also combo (read and write both CD and DVD).

The issue is in recognizing media on CD-R/RW (I'm using app-cdr/cdrtools-3.00 (/usr/bin/cdrecord)).
Appears both with newly and previously recorded disks.

Reproducible: Always

Steps to Reproduce:
1. Insert in a drive for example not blank CD-RW disk;
2. Blank it:
$ cdrecord dev=3,0,0 -blank=fast
(also tested with 'all');
3. Write an image (in my test case the one was systemrescuecd-x86-2.1.0.iso);
4. Try to mount it:
$ mount /mnt/cdrom
(success)
5. Reload disk:
$ eject && sleep 1 && eject -t
6. Try to mount it again.
Actual Results:  
mount: no medium found on /dev/sr0

Expected Results:  
mount: блочное устройство /dev/sr0 защищен от записи, монтируется только для чтения

(successfull mount)

The same issue is seen with previously writed good disks (both CD-R and CD-RW).
My drive, tested now is:
$ cdrecord -scanbus | grep CD
Linux sg driver version: 3.5.34
	3,0,0	300) 'TSSTcorp' 'CDW/DVD SH-M522C' 'TS04' Removable CD-ROM

Much more interesting is the continue of this story (results reproduced for previously recorded CD-R/RW and newly recorded CD-RW, the only tested CD-R was broken):
Insert disk, then
$ mount /mnt/cdrom/
mount: no medium found on /dev/sr0
$ readcd dev=3,0,0 f=/dev/null 
Read  speed:  7056 kB/s (CD  40x, DVD  5x, BD  1x).
Write speed:  1764 kB/s (CD  10x, DVD  1x, BD  0x).
Capacity: 151088 Blocks = 302176 kBytes = 295 MBytes = 309 prMB
Sectorsize: 2048 Bytes
Copy from SCSI (3,0,0) disk to file '/dev/null'
end:    151088
addr:   151088 cnt: 48
Time total: 101.549sec
Read 302176.00 kB at 2975.7 kB/sec.
$ mount /mnt/cdrom/
mount: блочное устройство /dev/sr0 защищен от записи, монтируется только для чтения
(the disk is mounted successfully)


$ emerge --info
Portage 2.1.9.42 (default/linux/x86/10.0, gcc-4.4.5, glibc-2.11.3-r0, 2.6.36-gentoo-r5 i686)
=================================================================
System uname: Linux-2.6.36-gentoo-r5-i686-Intel-R-_Pentium-R-_4_CPU_3.00GHz-with-gentoo-1.12.14
Timestamp of tree: Mon, 11 Apr 2011 04:45:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r2, 3.1.3-r1
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/env.d/50glib2 /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5.2/ext-active/ /etc/php/cgi-php5.2/ext-active/ /etc/php/cli-php5.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildsyspkg collision-protect distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ 		ftp://mirror.yandex.ru/gentoo-distfiles/                 http://ftp.chg.ru/pub/Linux/distributions/gentoo/                 ftp://ftp.chg.ru/pub/Linux/distributions/gentoo/ 		http://ftp.corbina.net/pub/Linux/gentoo/ 		ftp://ftp.corbina.net/pub/Linux/gentoo/"
LANG="ru_RU.KOI8-R"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage-ftn"
SYNC="   rsync://mirror.yandex.ru/gentoo-portage/"
USE="X a52 ac3 acl alsa avi berkdb bold bzip2 cdr cli cracklib crypt cups cxx dbus djvu dri dvd flac fortran gdbm gif gtk iconv jpeg jpeg2k modules mp3 mudflap ncurses nls nptl nptlonly ogg openmp pam pcre pdf perl png pppd python qt3support readline session ssl sysfs tcpd tiff unicode utf8 vorbis x86 xcb xorg xulrunner zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="sis" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sergey S. Starikoff 2011-04-16 15:26:11 UTC
It's more common issue.

The same problem I've seen just noe on my new PC:

Linux tux 2.6.37-gentoo-r4 #2 SMP Sat Apr 16 22:30:42 MSD 2011 x86_64 Intel(R) Core(TM) i5 CPU 661 @ 3.33GHz GenuineIntel GNU/Linux

with 'Optiarc ' 'DVD RW AD-7263S ' '1.03' Removable CD-ROM SATA DVD recorder.

The media was the same: high speed Verbatim CD-RW disk.
Comment 2 Sergey S. Starikoff 2011-04-27 07:37:45 UTC
Similiar issue with written won windows media (on another pc with win reads also normally).

The atip of issued CD-R media is:
ATIP info from disk:
  Indicated writing power: 5
Disk Is not unrestricted
Disk Is not erasable
  Disk sub type: Medium Type B, low Beta category (B-) (4)
  ATIP start of lead in:  -12369 (97:17/06)
  ATIP start of lead out: 359849 (79:59/74)
Disk type:    Short strategy type (Phthalocyanine or similar)
Manuf. index: 69
Manufacturer: Moser Baer India Limited
Manufacturer is guessed because of the orange forum embargo.
The orange forum likes to get money for recent information.
The information for this media may not be correct.
Comment 3 Stratos Psomadakis (RETIRED) gentoo-dev 2011-05-01 11:19:25 UTC
Can you try gentoo-sources-2.6.38-r3?
Comment 4 Sergey S. Starikoff 2011-05-08 14:51:17 UTC
(In reply to comment #3)
> Can you try gentoo-sources-2.6.38-r3?

Currently I've checked with gentoo-sources-2.6.38-r4 on amd64 keyword system.

The issue seems to have an easy workaround:

$ eject 
(here put a disk in a drive)
$ date && mount /mnt/cdrom/
Сбт Май  7 12:17:11 MSD 2011
mount: no medium found on /dev/sr0
$ date && mount /mnt/cdrom/
Сбт Май  7 12:17:16 MSD 2011
mount: no medium found on /dev/sr0
$ date && mount /mnt/cdrom/
Сбт Май  7 12:17:18 MSD 2011
mount: no medium found on /dev/sr0
$ date && mount /mnt/cdrom/
Сбт Май  7 12:17:19 MSD 2011
mount: no medium found on /dev/sr0
$ date && mount /mnt/cdrom/
Сбт Май  7 12:17:21 MSD 2011
mount: no medium found on /dev/sr0
$ date && mount /mnt/cdrom/
Сбт Май  7 12:17:22 MSD 2011

So, it's enough just to wait about 10-12 seconds after insertind and CD is mounted normally.

But earlier (in a time AFAIR of gentoo-sources-2.6.32) it was successfully mount when inserting disk in a drive was invoked by mount command.
Comment 5 Sergey S. Starikoff 2011-05-09 11:32:53 UTC
(In reply to comment #4)
> Currently I've checked with gentoo-sources-2.6.38-r4 on amd64 keyword system.
> 
> The issue seems to have an easy workaround:
>
> ...
>
> So, it's enough just to wait about 10-12 seconds after insertind and CD is
> mounted normally.
> 
> But earlier (in a time AFAIR of gentoo-sources-2.6.32) it was successfully
> mount when inserting disk in a drive was invoked by mount command.

Similiar behaviour with 2.6.37-gentoo-r4 (SATA DVD/RW drive).

Tomorrow I'll check it on installation with IDE drive (in libata mode).
Comment 6 Stratos Psomadakis (RETIRED) gentoo-dev 2011-05-09 11:43:20 UTC
Can you post the dmesg output? Does it log anything interesting there?
Comment 7 Sergey S. Starikoff 2011-05-09 16:02:55 UTC
(In reply to comment #6)
> Can you post the dmesg output? Does it log anything interesting there?

I could.
But there is really nothing.
Start point (dmesg | tail -n 2):
[11490.817570] ISO 9660 Extensions: Microsoft Joliet Level 3
[11490.855302] ISO 9660 Extensions: RRIP_1991A
$ mount /mnt/cdrom/
mount: no medium found on /dev/sr0

Wait for a time, repeat mount attemp (this time successful):
[11490.817570] ISO 9660 Extensions: Microsoft Joliet Level 3
[11490.855302] ISO 9660 Extensions: RRIP_1991A
[15616.173769] ISO 9660 Extensions: Microsoft Joliet Level 3
[15616.188183] ISOFS: changing to secondary root
Comment 8 Sergey S. Starikoff 2011-05-11 12:48:07 UTC
(In reply to comment #5)
> Tomorrow I'll check it on installation with IDE drive (in libata mode).
'TSSTcorp' 'CDW/DVD SH-M522C' 'TS04' Removable CD-ROM drive
2.6.36-gentoo-r5 kernel

Similiar behaviour (insert disk into drive, wait about 1 minute, after that disk mountes successfully).
Comment 9 Stratos Psomadakis (RETIRED) gentoo-dev 2011-06-14 19:04:47 UTC
I'm not sure if this should be reported upstream. 
Can you try booting more recent kernels (2.6.39 for example)?

It might help too if we had the .configs, emerge --info, and the full dmesg output. 

Thanks.
Comment 10 Sergey S. Starikoff 2011-06-16 05:57:13 UTC
Created attachment 277197 [details]
2.6.38-gentoo-r6 kernel config file

(In reply to comment #9)
> I'm not sure if this should be reported upstream. 
> Can you try booting more recent kernels (2.6.39 for example)?
Currently I've reproduced the bug with current stable (x86) kernel (2.6.38-gentoo-r6).
If it's necessary, I'll check any (2.6 branch) kernel you want to test.

> It might help too if we had the .configs, emerge --info, and the full dmesg
> output. 
Current cernel config is attached.
emerge --info was listed previously (or you need the most recent one?).

Full dmesg output contains mostly useless for this ussue data.
About mounting CD-ROM it tells the following:
$ dmesg
...
cdrom: sr0: mrw address space DMA selected
cdrom: open: mrw_status 'not mrw'
ISO 9660 Extensions: Microsoft Joliet Level 3
ISOFS: changing to secondary root
Comment 11 Mike Pagano gentoo-dev 2011-06-22 13:53:06 UTC
What happens on the latest 2.6.39-r1 kernel?
Comment 12 Sergey S. Starikoff 2011-06-24 07:52:03 UTC
(In reply to comment #11)
> What happens on the latest 2.6.39-r1 kernel?

The same.

And one more: the timeouts of handling eject utility calls seemed to be large (encreased in about two or three times).
Comment 13 Sergey S. Starikoff 2011-07-08 10:25:34 UTC
With kernel 2.6.39-gentoo-r2 bthaviour seems to be changed:

$ mount /mnt/cdrom/
mount: no medium found on /dev/sr0

wait a few seconds (error changes):

$ mount /mnt/cdrom/
mount: block device /dev/sr0 is write-protected, mounting read-only
mount: /dev/sr0 already mounted or /mnt/cdrom busy

wait some more seconds (success mount):

$ mount /mnt/cdrom/
mount: block device /dev/sr0 is write-protected, mounting read-only
Comment 14 Stratos Psomadakis (RETIRED) gentoo-dev 2011-08-20 16:22:10 UTC
Well, you could try with a 3.0.x kernel, just in case. 

Maybe stracing the mount command could provide some useful information.

And, do you remember which was the last working kernel? Your initial bug report was for 2.6.36-gentoo-r5. Does previous 2.6.36 kernels work, or maybe 2.6.35?

Thanks.
Comment 15 Sergey S. Starikoff 2011-08-23 10:45:06 UTC
(In reply to comment #14)
> Well, you could try with a 3.0.x kernel, just in case. 
Currently with 2.6.39-gentoo-r3 the same issue.
Trying to upgrade to 3.0.3 (with the same kernel conf) doesn't solve it.

> Maybe stracing the mount command could provide some useful information.
Trying to get strace of mount I've discovered that it completely breaks mount operability: using strace makes fail not only oryginally failed attemps but also oryginally (otherwise) successfull.

Maybe it wiil be helpful: I still use manual mount via /etc/fstab:
 $ grep cdrom /etc/fstab
/dev/cdrom		/mnt/cdrom	iso9660		noauto,user,iocharset=koi8-r,mode=0444	0 0

(my another workstation with the same issue is localized in utf8)


> And, do you remember which was the last working kernel? Your initial bug report
> was for 2.6.36-gentoo-r5. Does previous 2.6.36 kernels work, or maybe 2.6.35?
That time I'vu used CD rather rare and it will be difficult to remember where it worked.
May be about 2.6.32?..
Am I to try to downgrade kernel (at least on one of my workstations it should be enough easy)?
Comment 16 Stratos Psomadakis (RETIRED) gentoo-dev 2011-08-28 19:18:43 UTC
If it's possible, yes, just to confirm that you can't reproduce the issue with eg 2.6.32 kernels.

Thanks.
Comment 17 Sergey S. Starikoff 2011-08-31 09:25:07 UTC
(In reply to comment #16)
> If it's possible, yes, just to confirm that you can't reproduce the issue with
> eg 2.6.32 kernels.
> 
> Thanks.

With 2.6.32-gentoo-r29 the same issue.
Comment 18 Sergey S. Starikoff 2011-09-27 10:55:35 UTC
I've seen how thunar displays blank CD/DVD media.
After that I've setup for test purposes automounting.
And see that it works.

It seems, that the pause is needed for udev to detect media status.
So (remembering currant udev requirements to kernel versions) I think, that the issue should appear abount first required by current udev kernel (AFAIR 2.6.27).

Where/how it should be fixed (or we need to update documentation) --- I don't see good solution.
Comment 19 Mike Pagano gentoo-dev 2012-03-04 20:56:59 UTC
Is everything at this point?
Comment 20 Sergey S. Starikoff 2012-03-05 11:11:40 UTC
(In reply to comment #19)
> Is everything at this point?

It seems to be not a bug, but a feature.

3.2.1-gentoo-r2 generally the same behaviour (time-out from inserting media to mounting it).

On my another PC I've set up automounter and see the similiar time-out.

So, may be, it will be right to solve it not on kernel-side, but on mount utility side.
Comment 21 Mike Pagano gentoo-dev 2012-07-06 13:29:14 UTC
Please reopen and reassign as appropriate if anything further is needed here.