Bug 134822

Summary: scd* does not seem to respond to SC_INQUIRY - sg* works
Product: Red Hat Enterprise Linux 4 Reporter: Harald Hoyer <harald>
Component: kernelAssignee: Doug Ledford <dledford>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: barryn, davej, dff, hongjiu.lu, jh6x, josh, masahase, mpeters, redhat-bugzilla, tburke, tsui.tony, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-07 17:47:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 127685, 136155, 136451, 136982, 138739, 140506, 147461    

Description Harald Hoyer 2004-10-06 15:11:46 UTC
e.g. /dev/hdc is a normal IDE Burner...
$ ./dvd+rw-mediainfo /dev/hdc
INQUIRY:                [PIONEER ][DVD-RW  DVR-105 ][1.00]
GET [CURRENT] CONFIGURATION:
:-( no media mounted, exiting...

scd0 is a SCSI Burner... 
$ ./dvd+rw-mediainfo /dev/scd0
:-( not an MMC unit!

but... using cdrecord... and /dev/sg0
$ cdrecord -VVVVVVVVVVVVV -inq dev=/dev/sg0
....
Executing 'inquiry' command on Bus 0 Target 6, Lun 0 timeout 40s
CDB:  12 00 00 00 24 00
cmd finished after 0.002s timeout 40s
Got 36 (0x24), expecting 36 (0x24) bytes of data.
Received Data:  05 80 02 02 27 00 00 10 59 41 4D 41 48 41 20 20 43 52
57 34 3431 36 53 20 20 20 20 20 20 20 20 31 2E 30 65
Inquiry Data   : 05 80 02 02 27 00 00 10 59 41 4D 41 48 41 20 20 43 52
57 34 34 31 36 53 20 20 20 20 20 20 20 20 31 2E 30 65
...
Vendor_info    : 'YAMAHA  '
Identifikation : 'CRW4416S        '
Revision       : '1.0e'
Device seems to be: Generic mmc CD-RW.
...

Using /dev/scd0 with cdrecord..
$ cdrecord -VVVVVVVVVVVVV -inq dev=/dev/scd0
Executing 'test unit ready' command on Bus 0 Target 6, Lun 0 timeout 40s
CDB:  00 00 00 00 00 00
cmd finished after 0.000s timeout 40s

Executing 'test unit ready' command on Bus 0 Target 6, Lun 0 timeout 40s
CDB:  00 00 00 00 00 00
cmd finished after 0.000s timeout 40s

Executing 'inquiry' command on Bus 0 Target 6, Lun 0 timeout 40s
CDB:  12 00 00 00 24 00
resid: 36
cmd finished after 0.000s timeout 40s
Got 0 (0x0), expecting 36 (0x24) bytes of data.
Received Data:
Inquiry Data   :

Comment 1 Harald Hoyer 2004-10-06 15:13:14 UTC
$ cdrecord -VVVVVVVVVVVVV -inq dev=/dev/hdc                          
         
...
Executing 'inquiry' command on Bus 1 Target 0, Lun 0 timeout 40s
CDB:  12 00 00 00 24 00
cmd finished after 0.000s timeout 40s
Got 36 (0x24), expecting 36 (0x24) bytes of data.
Received Data:  05 80 00 32 5B 00 00 00 50 49 4F 4E 45 45 52 20 44 56
44 2D 5257 20 20 44 56 52 2D 31 30 35 20 31 2E 30 30
Inquiry Data   : 05 80 00 32 5B 00 00 00 50 49 4F 4E 45 45 52 20 44 56
44 2D 52 57 20 20 44 56 52 2D 31 30 35 20 31 2E 30 30

...

Comment 2 Harald Hoyer 2004-10-06 15:14:10 UTC
$ uname -r
2.6.8-1.541smp


Comment 3 Harald Hoyer 2004-10-06 15:28:59 UTC
oh... funny... after I inserted a medium..
$ dvd+rw-mediainfo /dev/scd0
INQUIRY:                [YAMAHA  ][CRW4416S        ][1.0e]
:-( not a DVD unit


Comment 4 Harald Hoyer 2004-10-06 15:31:59 UTC
Expected result: INQUIRY should work without a medium inserted, just
like talking to /dev/sg0

Comment 5 Harald Hoyer 2004-10-06 16:59:21 UTC
More evidence found in bug #129671

Comment 6 Ralf Ertzinger 2004-10-06 17:00:32 UTC
*** Bug 129671 has been marked as a duplicate of this bug. ***

Comment 7 Harald Hoyer 2004-10-11 13:26:23 UTC
Still present in
$ uname -r
2.6.8-1.603smp


Comment 8 Harald Hoyer 2004-10-27 08:30:46 UTC
*** Bug 137212 has been marked as a duplicate of this bug. ***

Comment 12 Harald Hoyer 2004-11-03 14:38:28 UTC
and btw, this is no "drive problem", cause it works with /dev/sg0,
only not with /dev/scd0

Comment 17 H.J. Lu 2004-11-23 16:28:58 UTC
*** Bug 127685 has been marked as a duplicate of this bug. ***

Comment 19 Harald Hoyer 2004-12-01 11:19:18 UTC
*** Bug 141433 has been marked as a duplicate of this bug. ***

Comment 20 Doug Ledford 2004-12-02 18:18:20 UTC
Trying to reproduce, give me a bit.  If I can reproduce, then I should
be able to fix it fairly easily.  From the looks of it, it sounds like
the SG_IO based cooked ioctl interface on /dev/scd* devices is doing a
medium check on a few commands that it shouldn't do a medium check on
(such as INQUIRY and eject).

Comment 21 Doug Ledford 2004-12-02 19:09:11 UTC
Reproduced.  Working on it now.


Comment 22 Doug Ledford 2004-12-02 22:38:38 UTC
OK, I reproduced this with 2.6.9-1.784_EL.  However, when I compiled a
kernel from a fresh cvs update as of today, version 2.6.9-1.850_EL,
the problem was gone.  So, as far as I can tell, this is fixed
CURRENTRELEASE, but setting state to MODIFIED for tracking purposes. 
If you have problems with the next tree built with a post 1.850_EL
kernel, please set back to ASSIGNED.

Comment 23 Harald Hoyer 2004-12-06 16:18:12 UTC
ok... new kernel fixes it :)

Please do not forgot the FC2 and FC3 users! Many of them would love to
see an updated kernel!

Comment 24 Harald Hoyer 2004-12-07 16:45:31 UTC
*** Bug 137105 has been marked as a duplicate of this bug. ***

Comment 25 Harald Hoyer 2004-12-07 17:11:02 UTC
*** Bug 140506 has been marked as a duplicate of this bug. ***