Re: PATCH: cdrecord: avoiding scsi device numbering for ide devices

From: Joerg Schilling
Date: Sun Aug 08 2004 - 03:23:43 EST


----> This is a resend as it seems that somebody did remove
linux-kernel@xxxxxxxxxxxxxxx

>From: "H.Rosmanith (Kernel Mailing List)" <kernel@xxxxxxxxxxxxxxxxx>

>> I can just that if you set 64KiB now, it'll be a much better alround
>> value.

>very good, it works with 64kB:

> 887 /*
> 888 * First try to raise the DMA limit to a moderate value that
> 889 * most likely does not use up all kernel memory.
> 890 */
> 891 //val = 126*1024;
> 892 val = 64*1024;

>now cdrecord will happily use the scsi-linux-sg driver even for the IDE
>burners connected to the "Digitus" controllers handled by the siimage driver.

So you found a nasty bug in the Linux kernel :-(

The official behavior for SG_SET_RESERVED_SIZE is:

1) You call SG_SET_RESERVED_SIZE with whatever size val you like

2) It says "thank you" and _always_ returns success

3) You call SG_GET_RESERVED_SIZE to read the value set up
in the kernel. This value is not directly related to the value
used with SG_SET_RESERVED_SIZE. The proposal from Douglas
Gilbert was to always use 512 KB. I am unhappy with this behavior
but I have to take it as it has been defined by the Author :-(
He told me that the value returned with SG_GET_RESERVED_SIZE
is the value available for DMA and may be much smaller than
the size used with SG_SET_RESERVED_SIZE.

AGAIN: I am unhappy with this behavior but this _is_ the official behavior.
If the current Linux kernel for some reasons does not behave this way it
is broken and needs to be fixed.

See also: http://www.mail-archive.com/cdwrite@xxxxxxxxxxxxxxxx/msg00232.html

Jörg

--
EMail:joerg@xxxxxxxxxxxxxxxxxxxxxxxxxxx (home) Jörg Schilling D-13353 Berlin
js@xxxxxxxxxxxxxxx (uni) If you don't have iso-8859-1
schilling@xxxxxxxxxxxxxxxxxxx (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/