Discussion:
PATCH: cdrecord: avoiding scsi device numbering for ide devices
(too old to reply)
H.Rosmanith (Kernel Mailing List)
1970-01-01 00:00:00 UTC
Permalink
hi,

I've written a patch for cdrecord/cdrtools. I've sent it to Joerg Schilling
already, but got no answer so far. Probably he's on vaccation.

I'm sending this to LKML too, because I've read about some ... nebulosity
with respect to scsi device numbering as used by cdrtools.

To cut a long story short: the patch avoids cdrecord having to use the
"virtual" scsi device numbering in the form of "ATAPI:x.y.z" and allows
you to use the name of the device, e.g. /dev/hdc instead.

By removing the IDE to virtual scsi bus/host/lun mapping, a lot of confusion
can be avoided especially if you have a lot devices of this kind in one
system.

with kind regards,
Herbert "herp" Rosmanith

Version: cdrtools-2.01a34

Solution: when the device specified in dev= starts with "/dev/hd" and
this device can be found in /proc/ide, then cdrecord (and all
it's components, such as e.g. cdrdao) is forced to use the
ATAPI driver.

The patch is really very short and works at least on our system.

with kind regards,
Herbert Rosmanith

--- snip ---
diff -ru cdrtools-2.01.orig/libscg/scsi-linux-ata.c cdrtools-2.01/libscg/scsi-linux-ata.c
--- cdrtools-2.01.orig/libscg/scsi-linux-ata.c Sat Jun 12 12:48:12 2004
+++ cdrtools-2.01/libscg/scsi-linux-ata.c Wed Aug 4 14:19:31 2004
@@ -42,6 +42,11 @@
* You should have received a copy of the GNU General Public License along with
* this program; see the file COPYING. If not, write to the Free Software
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
*/

#ifdef USE_ATA
@@ -60,7 +65,7 @@
LOCAL int scgo_areset __PR((SCSI *scgp, int what));
LOCAL int scgo_asend __PR((SCSI *scgp));

-LOCAL scg_ops_t ata_ops = {
+EXPORT scg_ops_t scg_ata_ops = {
scgo_asend,
scgo_aversion,
scgo_ahelp,
diff -ru cdrtools-2.01.orig/libscg/scsi-linux-sg.c cdrtools-2.01/libscg/scsi-linux-sg.c
--- cdrtools-2.01.orig/libscg/scsi-linux-sg.c Thu May 20 15:42:12 2004
+++ cdrtools-2.01/libscg/scsi-linux-sg.c Wed Aug 4 14:20:56 2004
@@ -40,6 +40,11 @@
* string is related to a modified source.
*
* Copyright (c) 1997 J. Schilling
+ *
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
*/
/*
* This program is free software; you can redistribute it and/or modify
@@ -315,7 +320,7 @@
if (device != NULL && *device != '\0') {
#ifdef USE_ATA
if (strncmp(device, "ATAPI", 5) == 0) {
- scgp->ops = &ata_ops;
+ scgp->ops = &scg_ata_ops;
return (SCGO_OPEN(scgp, device));
}
#endif
diff -ru cdrtools-2.01.orig/libscg/scsitransp.c cdrtools-2.01/libscg/scsitransp.c
--- cdrtools-2.01.orig/libscg/scsitransp.c Thu Jun 17 22:20:27 2004
+++ cdrtools-2.01/libscg/scsitransp.c Wed Aug 4 14:26:07 2004
@@ -13,6 +13,11 @@
* string is related to a modified source.
*
* Copyright (c) 1988,1995,2000-2004 J. Schilling
+ *
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
*/
/*
* This program is free software; you can redistribute it and/or modify
@@ -34,6 +39,7 @@
#include <stdio.h>
#include <standard.h>
#include <stdxlib.h>
+#include <sys/stat.h>
#include <unixstd.h>
#include <errno.h>
#include <timedefs.h>
@@ -157,7 +163,7 @@
{
int ret;
scg_ops_t *ops;
-extern scg_ops_t scg_std_ops;
+extern scg_ops_t scg_std_ops,scg_ata_ops;

/*
* Begin restricted code for quality assurance.
@@ -185,6 +191,16 @@
scgp->ops = ops;
}

+ // XXX herp - check if atapi driver neccessary
+ // and load if ide device found
+
+ if (device && strncmp(device,"/dev/hd",7)==0) {
+ char pdev[]="/proc/ide/XXXX";
+ struct stat st;
+ strncpy(pdev+10,device+5,4); /* hdXY should be enough, eh? */
+ if (stat(pdev,&st)==0)
+ scgp->ops=&scg_ata_ops;
+ }
ret = SCGO_OPEN(scgp, device);
if (ret < 0)
return (ret);
--- snip ---
Jens Axboe
2004-08-04 12:43:36 UTC
Permalink
Post by H.Rosmanith (Kernel Mailing List)
hi,
I've written a patch for cdrecord/cdrtools. I've sent it to Joerg Schilling
already, but got no answer so far. Probably he's on vaccation.
I'm sending this to LKML too, because I've read about some ... nebulosity
with respect to scsi device numbering as used by cdrtools.
To cut a long story short: the patch avoids cdrecord having to use the
"virtual" scsi device numbering in the form of "ATAPI:x.y.z" and allows
you to use the name of the device, e.g. /dev/hdc instead.
By removing the IDE to virtual scsi bus/host/lun mapping, a lot of confusion
can be avoided especially if you have a lot devices of this kind in one
system.
with kind regards,
Herbert "herp" Rosmanith
Version: cdrtools-2.01a34
Solution: when the device specified in dev= starts with "/dev/hd" and
this device can be found in /proc/ide, then cdrecord (and all
it's components, such as e.g. cdrdao) is forced to use the
ATAPI driver.
The patch is really very short and works at least on our system.
with kind regards,
Herbert Rosmanith
--- snip ---
diff -ru cdrtools-2.01.orig/libscg/scsi-linux-ata.c cdrtools-2.01/libscg/scsi-linux-ata.c
--- cdrtools-2.01.orig/libscg/scsi-linux-ata.c Sat Jun 12 12:48:12 2004
+++ cdrtools-2.01/libscg/scsi-linux-ata.c Wed Aug 4 14:19:31 2004
@@ -42,6 +42,11 @@
* You should have received a copy of the GNU General Public License along with
* this program; see the file COPYING. If not, write to the Free Software
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
That's an extremely bad idea, you want to force ATA driver in either
case.
--
Jens Axboe
Jens Axboe
2004-08-04 12:58:18 UTC
Permalink
Post by Jens Axboe
Post by H.Rosmanith (Kernel Mailing List)
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
That's an extremely bad idea, you want to force ATA driver in either
case.
Which, happily, is what already happens and why it works fine when you
just do -dev=/dev/hdX. What should be removed is the warning that
cdrecord spits out when you do this, and the whole ATAPI thing should
just mirror ATA and scsi-linux-ata be killed completely.

So I suggest you do that instead and send it to Joerg, cdrecord/cdrtool
patches are off topic here.
--
Jens Axboe
H.Rosmanith (Kernel Mailing List)
1970-01-01 00:00:00 UTC
Permalink
Post by Jens Axboe
Post by Jens Axboe
Post by H.Rosmanith (Kernel Mailing List)
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
That's an extremely bad idea, you want to force ATA driver in either
case.
Which, happily, is what already happens and why it works fine when you
okay - my last email in this matter to LKML, but: it seems to only work
fine if you use ide-scsi and configure it acordingly. on our system, where
I have disabled scsi completely (ide-scsi doesnt work at all for certain
tasks, and beside from that, I need scsi), cdrecord/cdrtools will terminate with
"Cannot open /dev/hdX. Cannot open SCSI driver".

this is the reason why the patch forces the ata (atapi?) driver. no
SCSI driver or configuring of ide-scsi required.
Post by Jens Axboe
just do -dev=/dev/hdX. What should be removed is the warning that
cdrecord spits out when you do this, and the whole ATAPI thing should
just mirror ATA and scsi-linux-ata be killed completely.
So I suggest you do that instead and send it to Joerg, cdrecord/cdrtool
well, sigh .... been there, done that, but emails to Joerg seem to have
a long RTT. therefore, LKML. sorry for the inconvenience :->

bye,
herp
Jens Axboe
2004-08-05 05:47:12 UTC
Permalink
Post by H.Rosmanith (Kernel Mailing List)
Post by Jens Axboe
Post by Jens Axboe
Post by H.Rosmanith (Kernel Mailing List)
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
That's an extremely bad idea, you want to force ATA driver in either
case.
Which, happily, is what already happens and why it works fine when you
okay - my last email in this matter to LKML, but: it seems to only work
fine if you use ide-scsi and configure it acordingly. on our system, where
I have disabled scsi completely (ide-scsi doesnt work at all for certain
tasks, and beside from that, I need scsi), cdrecord/cdrtools will
terminate with "Cannot open /dev/hdX. Cannot open SCSI driver".
this is the reason why the patch forces the ata (atapi?) driver. no
SCSI driver or configuring of ide-scsi required.
Maybe newer version broke then. Until very recently, cdrecord worked
just fine as-is and used SG_IO access method when you used open by
device name. Which was just the way we wanted it.

If that doesn't work now, I suggest you take it up with Joerg. It's a
problem with his program.
Post by H.Rosmanith (Kernel Mailing List)
Post by Jens Axboe
just do -dev=/dev/hdX. What should be removed is the warning that
cdrecord spits out when you do this, and the whole ATAPI thing
should just mirror ATA and scsi-linux-ata be killed completely.
So I suggest you do that instead and send it to Joerg,
cdrecord/cdrtool
well, sigh .... been there, done that, but emails to Joerg seem to
have a long RTT. therefore, LKML. sorry for the inconvenience :->
Is there no cdrecord list? lkml surely isn't appropriate.
--
Jens Axboe
H.Rosmanith (Kernel Mailing List)
1970-01-01 00:00:00 UTC
Permalink
Post by Jens Axboe
Post by H.Rosmanith (Kernel Mailing List)
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
That's an extremely bad idea, you want to force ATA driver in either
case.
I don't think so.

If "dev=/dev/hd?" and "/dev/hd?" is *not* present in /proc/ide, then
cdrtools falls back to the default behaviour, which is: treat it as
scsi device.

If the device cannot be found in /proc/ide, it simply does not make sense
to treat it as atapi device - because it is none.

best regards,
Herbert Rosmanith
Jens Axboe
2004-08-05 05:43:54 UTC
Permalink
Post by H.Rosmanith (Kernel Mailing List)
Post by Jens Axboe
Post by H.Rosmanith (Kernel Mailing List)
+ * Sat Jun 12 12:48:12 CEST 2004 herp - Herbert Rosmanith
+ * Force ATAPI driver if dev= starts with /dev/hd and device
+ * is present in /proc/ide/hdX
+ *
That's an extremely bad idea, you want to force ATA driver in either
case.
I don't think so.
If "dev=/dev/hd?" and "/dev/hd?" is *not* present in /proc/ide, then
cdrtools falls back to the default behaviour, which is: treat it as
scsi device.
If the device cannot be found in /proc/ide, it simply does not make sense
to treat it as atapi device - because it is none.
ATA method is misnamed, it's really SG_IO that is used. And you want to
use that regardless of the device type, SCSI or ATAPI. There's no such
thing as an ATA burner, and there's no need to differentiate between
SCSI or ATAPI CD-ROM's when burning - SG_IO is the method to use. So
forget browsing /proc/ide and other hacks.
--
Jens Axboe
Joerg Schilling
2004-08-05 11:50:50 UTC
Permalink
I've written a patch for cdrecord/cdrtools. I've sent it to Joerg Schi=
lling
already, but got no answer so far. Probably he's on vaccation.
Looks like I first need to correct you :-(

You send a mail on July 5th and received a reply on July 6th, wo where =
is
your problem?
I'm sending this to LKML too, because I've read about some ... nebulos=
ity
with respect to scsi device numbering as used by cdrtools.
This is caused by the "mist" throughn out by parts of the Linux kernel =
:-(
To cut a long story short: the patch avoids cdrecord having to use the
"virtual" scsi device numbering in the form of "ATAPI:x.y.z" and allow=
s
you to use the name of the device, e.g. /dev/hdc instead.
I am sorry, but using something like dev=3D/dev/hdc is deprecated.
In addition, several programs distinct between so called Cooked ioctl()=
s and
generic SCSI by checking for UNIX device names vs. SCSI address specs.



J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily
Joerg Schilling
2004-08-05 11:53:48 UTC
Permalink
Post by Jens Axboe
Post by Jens Axboe
That's an extremely bad idea, you want to force ATA driver in either
case.
Which, happily, is what already happens and why it works fine when you
just do -dev=3D/dev/hdX. What should be removed is the warning that
cdrecord spits out when you do this, and the whole ATAPI thing should
just mirror ATA and scsi-linux-ata be killed completely.
Nice idea!

So please start with fixing ide-scsi for Linux-2.4 so Linux won't panic=
()
when trying to access CD/DVD-drives that are connected via a PC-card in=
terface
using ide-scsi.

J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily
Jens Axboe
2004-08-05 12:05:08 UTC
Permalink
Post by Joerg Schilling
Post by Jens Axboe
Post by Jens Axboe
That's an extremely bad idea, you want to force ATA driver in either
case.
Which, happily, is what already happens and why it works fine when you
just do -dev=/dev/hdX. What should be removed is the warning that
cdrecord spits out when you do this, and the whole ATAPI thing should
just mirror ATA and scsi-linux-ata be killed completely.
Nice idea!
So please start with fixing ide-scsi for Linux-2.4 so Linux won't
panic() when trying to access CD/DVD-drives that are connected via a
PC-card interface using ide-scsi.
Let me dig through my mail box and find that report. Hmm that's strange,
you don't seem to have sent one. I'll just dig out the crystal ball and
get cracking on that fix.
--
Jens Axboe
Joerg Schilling
2004-08-05 12:22:14 UTC
Permalink
well, sigh .... been there, done that, but emails to Joerg seem to hav=
e
a long RTT. therefore, LKML. sorry for the inconvenience :->
One day is long ?????

J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily
Joerg Schilling
2004-08-05 12:25:29 UTC
Permalink
ATA method is misnamed, it's really SG_IO that is used. And you want t=
o
use that regardless of the device type, SCSI or ATAPI. There's no such
thing as an ATA burner, and there's no need to differentiate between
SCSI or ATAPI CD-ROM's when burning - SG_IO is the method to use. So
forget browsing /proc/ide and other hacks.
I am sorry but as Linux already has 6 different interfaces for sending=20
Generic SCSI commands and thus, we are running out of names.

Let me give you an advise: consolidate Linux so that is does only need
/dev/sg and fix the bugs in ide-scsi instead of constantly inventing ne=
w
unneeded interfaces.


J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily
Jens Axboe
2004-08-05 12:29:08 UTC
Permalink
Post by Joerg Schilling
Post by Jens Axboe
ATA method is misnamed, it's really SG_IO that is used. And you want to
use that regardless of the device type, SCSI or ATAPI. There's no such
thing as an ATA burner, and there's no need to differentiate between
SCSI or ATAPI CD-ROM's when burning - SG_IO is the method to use. So
forget browsing /proc/ide and other hacks.
I am sorry but as Linux already has 6 different interfaces for sending
Generic SCSI commands and thus, we are running out of names.
Let me give you an advise: consolidate Linux so that is does only need
/dev/sg and fix the bugs in ide-scsi instead of constantly inventing new
unneeded interfaces.
That's been the general direction for quite some time, just that SG_IO
is the preferred method since that works all around. You were the one
that merged support for the CDROM_SEND_PACKET interface, which has
_never_ been advertised as a way to burn CDs in Linux. I'd suggest you
remove that.
--
Jens Axboe
Joerg Schilling
2004-08-05 12:30:04 UTC
Permalink
Post by Jens Axboe
Post by H.Rosmanith (Kernel Mailing List)
this is the reason why the patch forces the ata (atapi?) driver. no
SCSI driver or configuring of ide-scsi required.
Maybe newer version broke then. Until very recently, cdrecord worked
just fine as-is and used SG_IO access method when you used open by
device name. Which was just the way we wanted it.
If that doesn't work now, I suggest you take it up with Joerg. It's a
problem with his program.
It's a problem caused by the design in the Linux kernel and not a probl=
em of
libscg or cdrecord.=20

The point is that Linux constantly invents new ugly and unneeded things=
and
after I found a workaround, people try to prevent the workaround from
being usable.=20

In 1998, I did send a patch against the sg.c driver that introduced
everything that is needed for Generic SCSI transport. I am still waitin=
g=20
for even the needed features to appear........

J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily
Jens Axboe
2004-08-05 12:38:59 UTC
Permalink
Post by Jens Axboe
Post by H.Rosmanith (Kernel Mailing List)
this is the reason why the patch forces the ata (atapi?) driver. no
SCSI driver or configuring of ide-scsi required.
Maybe newer version broke then. Until very recently, cdrecord worked
just fine as-is and used SG_IO access method when you used open by
device name. Which was just the way we wanted it.
If that doesn't work now, I suggest you take it up with Joerg. It's a
problem with his program.
It's a problem caused by the design in the Linux kernel and not a problem of
libscg or cdrecord.
The point is that Linux constantly invents new ugly and unneeded things and
after I found a workaround, people try to prevent the workaround from
being usable.
It's been bad in the past, I agree. But the advertised way to work with
this hasn't changed in the past few years, and was and is still sg v3.
So you should support that through read(2)/write(2) to /dev/sg*, or
through SG_IO ioctl to the device. The latter is recommended since
currently works for all devices, plus it's the simpler (and good enough)
interface to use for cdrecord since it doesn't require queuing.
In 1998, I did send a patch against the sg.c driver that introduced
everything that is needed for Generic SCSI transport. I am still
waiting for even the needed features to appear........
If you have issues with SG_IO, please feel free to address them. If they
are valid, I'd love to help you get it fixed.
--
Jens Axboe
Jens Axboe
2004-08-05 12:47:10 UTC
Permalink
The point is that Linux constantly invents new ugly and unneeded things and
after I found a workaround, people try to prevent the workaround from
being usable.
BTW, what is that work-around?
--
Jens Axboe
Joerg Schilling
2004-08-05 12:45:23 UTC
Permalink
Post by Joerg Schilling
Which, happily, is what already happens and why it works fine when =
you
Post by Joerg Schilling
just do -dev=3D/dev/hdX. What should be removed is the warning that
cdrecord spits out when you do this, and the whole ATAPI thing shou=
ld
Post by Joerg Schilling
just mirror ATA and scsi-linux-ata be killed completely.
=20
Nice idea!
=20
So please start with fixing ide-scsi for Linux-2.4 so Linux won't
panic() when trying to access CD/DVD-drives that are connected via a
PC-card interface using ide-scsi.
Let me dig through my mail box and find that report. Hmm that's strang=
e,
you don't seem to have sent one. I'll just dig out the crystal ball an=
d
get cracking on that fix.
=2E...I am not repsonsible for your mail box....

I send it to Alan Cox and to LKML.... a long toime ago (in 2000)

J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily
Joerg Schilling
2004-08-05 12:49:36 UTC
Permalink
Post by Jens Axboe
Let me give you an advise: consolidate Linux so that is does only ne=
ed
Post by Jens Axboe
/dev/sg and fix the bugs in ide-scsi instead of constantly inventing=
new
Post by Jens Axboe
unneeded interfaces.
That's been the general direction for quite some time, just that SG_IO
is the preferred method since that works all around. You were the one
that merged support for the CDROM_SEND_PACKET interface, which has
_never_ been advertised as a way to burn CDs in Linux. I'd suggest you
remove that.
Again:

I'd be happy to start a discussion on this topic after the problem=20
with kernel panic() or general unusability with ide-scsi for PC-card
or PCMCIA connected drives has been fixed for Linux-2.4 and all kernels
outside have been replaced by working ones...

I reported this problem to the end of y2000, this is long time ago.

J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily
Jens Axboe
2004-08-05 12:57:16 UTC
Permalink
Post by Joerg Schilling
Post by Jens Axboe
Post by Joerg Schilling
Let me give you an advise: consolidate Linux so that is does only need
/dev/sg and fix the bugs in ide-scsi instead of constantly inventing new
unneeded interfaces.
That's been the general direction for quite some time, just that SG_IO
is the preferred method since that works all around. You were the one
that merged support for the CDROM_SEND_PACKET interface, which has
_never_ been advertised as a way to burn CDs in Linux. I'd suggest you
remove that.
I'd be happy to start a discussion on this topic after the problem
with kernel panic() or general unusability with ide-scsi for PC-card
or PCMCIA connected drives has been fixed for Linux-2.4 and all kernels
outside have been replaced by working ones...
I reported this problem to the end of y2000, this is long time ago.
Well resend it then? Maybe it's your attitude that prevents it from
being fixed, if you think we will chase back a 4 year old email to fix
some obscure bug.
--
Jens Axboe
Joerg Schilling
2004-08-05 13:48:47 UTC
Permalink
Post by Joerg Schilling
In 1998, I did send a patch against the sg.c driver that introduced
everything that is needed for Generic SCSI transport. I am still
waiting for even the needed features to appear........
If you have issues with SG_IO, please feel free to address them. If th=
ey
are valid, I'd love to help you get it fixed.
Here is the current list of problems with CD/DVD writing on Linux:

- Linux sometimes bastardizes the SCSI commands sent to ATAPI drives.

Some people report that they cannot blank their CD-RW media for
this reason. See:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D186099

Similar things happen when trying to read defective "CD-DA" media
created by the "Music Mafia". If you use a Plextor drive, everything
works fine. If you use a Pioneer drive, the SCSI command "READ FULL TO=
C"
aborts with "illegal field in CDB", rebooting the same PC to
SCO UnixWare makes the problem go away.

This problem has not yet been reported because I got the impression=20
that nobody on LKML is interested in fixing CD/DVD writing related=20
bugs.=20

Time to fix: unknown - may be more than 2 weeks.

- ide-scsi does not use DMA if the "DMA size" is not a multiple of 512.
This bug has been reported many times! Last time was when you introduc=
ed
the unneeded SCSI transport via /dev/hd*. This interface initially
did have the same bug - it has been fixed. The same bug in ide-scsi
has not been fixed although I send several related mails :-(

Time to fix: less than a day (for Jens)

- Parallel (50 bin) SCSI (unknown HBA) on Linux-2.6 does not work if
DMA size is not a multiple of 4. The data transferred from the SCSI
device is OK for the first part that is a multiple of 4.
The remainder of bytes arrive as binary zeroes.

This is a new bug (I received the related information this week).

Time to fix: approx. one day

- ioctl(f, SCSI_IOCTL_GET_IDLUN, &sg_id)) and ioctl(f, SCSI_IOCTL_GET_B=
US_NUMBER, &Bus)
do not return instance numbers if applied to a fd from /dev/hd*

This bug has been reported 2 years ago.

Time to fix: 10 minutes

- DMA residual count is not returned (reported in 1998).
This is extremely important - it prevents me from unsing Linux as a
development platform.

Time to fix: about one month to rework the whole SCSI driver stack.

- Only the first 14 bytes of SCSI Sense data is returned (reported in 1=
998)
This is extremely important - it prevents me from unsing Linux as a
development platform.=09

Time to fix: about one month to rework the whole SCSI driver stack.
With good luck, this may be done on 2 days.

- Unclear documentation whether DID_TIME_OUT should apply to a selectio=
n
time out, a SCSI command timeout or both.

Time to fix: one day

- It seems that the only way to find out whether a SCSI command did tim=
e=20
out is to meter the time it takes and guess for any unclear return
codes that coincidence with a command time >=3D the set up timeout to
assume a SCSI command timeout.

Time to fix: one day

- Many unclear problem reports lead me to the assumption that Linux-2.6
does not set up the SCSI command timeout properly. See previous point!

Time to fix:=20

- Linux Kernel include files (starting with Linux-2.5) are buggy and=20
prevent compilation. Many files may be affected but let me name
the most important files for me:

- /usr/src/linux/include/scsi/scsi.h depends on a nonexistant
type "u8". The correct way to fix this would be to replace
any "u8" by "uint8_t". A quick and dirty fix is to call:

"change u8 __u8 /usr/src/linux/include/scsi/scsi.h"

ftp://ftp.berlios.de/pub/change/

- /usr/src/linux/include/scsi/sg.h includes "extra text" "__user"
in some structure definitions. This may be fixed by adding
#include <linux/compiler.h> somewhere at the beginning of
/usr/src/linux/include/scsi/sg.h

This bug has been reported several times (starting with Linux-2.5).

Time to fix: 5 minutes.
=09
There may be other problems that I do not remember now. If I would get =
the=20
impression that LKML is interested in fixing CD/DVD writing related bug=
s, I=20
would report more.....

=46rom the current number of problem reports, it looks like Linux-2.6 i=
s not yet=20
ready for general use as too many problems only appear on Linux-2.6. I=20
currently give peeople the advise to either go back to Linux-2.4 or to =
check
Solaris (see http://wwws.sun.com/software/solaris/solaris-express/get.h=
tml).

As my previous experiences with discussions on LKML have not been very=20
fruitful, I would propose to suspend the current discussion to a time a=
fter
at least some bugs from the list above have been fixed.




J=F6rg

--=20
EMail:***@schily.isdn.cs.tu-berlin.de (home) J=F6rg Schilling D-1335=
3 Berlin
***@cs.tu-berlin.de (uni) If you don't have iso-8859-1
***@fokus.fraunhofer.de (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.d=
e/pub/schily

Continue reading on narkive:
Loading...