linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH,RFC] make ide-scsi more selective
@ 2001-08-25 12:10 Mikael Pettersson
  2001-08-25 12:37 ` André Dahlqvist
  2001-08-25 17:33 ` safemode
  0 siblings, 2 replies; 17+ messages in thread
From: Mikael Pettersson @ 2001-08-25 12:10 UTC (permalink / raw)
  To: ionut; +Cc: alan, linux-kernel

On Sat, 25 Aug 2001 02:56:20 -0400 (EDT), Ion Badulescu wrote:

>I've concocted another patch, which includes my previous one and
>implements Mikael's idea somewhat more consistently. It adds another
>option, "noscsi", so that by saying hdX=noscsi on the kernel command line
>the user can prevent the ide-scsi driver from ever claiming that drive.
>
>So:
>- by default it's first come, first served
>- hdX=scsi means only the ide-scsi driver can claim hdX
>- hdX=noscsi means the ide-scsi driver must not claim hdX ever
>
>Sounds good? If so, please apply, it makes many CDR users' lives easier.

Looks fine to me. Tested briefly and it does get the job done.

/Mikael

p.s. anyone know if cdrecord will ever support ATAPI CDRs natively?

^ permalink raw reply	[flat|nested] 17+ messages in thread
[parent not found: <200108251734.NAA28426@cs.columbia.edu>]
* Re: [PATCH,RFC] make ide-scsi more selective
@ 2001-08-22 23:51 Chris Rankin
  0 siblings, 0 replies; 17+ messages in thread
From: Chris Rankin @ 2001-08-22 23:51 UTC (permalink / raw)
  To: linux-kernel

> The real problem is that the drivers are claiming
> resources on load not
> on open. Why shouldnt I be able to load ide-cd and
> ide-scsi and open either
> /dev/hda or /dev/sr0 but not both together ? 

What about kernels that use devfs? To open the device,
devfs would need to have already created the device
node, and this must surely happen when the module
loads. Can devfs create a node without claiming any
resources?

For reference, I use devfs, and have a DVD-ROM (hdc)
and a CD burner (hdd). The DVD uses ide-cd and the
burner uses ide-scsi, and I have to preload ide-cd
(with the "ignore=hdd" parameter) so that ide-scsi
doesn't grab the DVD.

Chris




__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

^ permalink raw reply	[flat|nested] 17+ messages in thread
* RE: [PATCH,RFC] make ide-scsi more selective
@ 2001-08-22 22:37 Torrey Hoffman
  0 siblings, 0 replies; 17+ messages in thread
From: Torrey Hoffman @ 2001-08-22 22:37 UTC (permalink / raw)
  To: 'tegeran@home.com', Alan Cox, mikpe; +Cc: linux-kernel, ionut


> Here's an end-user perspective for you... I just spent 2 days 
> trying to 
> figure out how to use my CD-RW drive to read when using 
> ide-scsi, before 
> I finnaly realized that I had to do it by disabling ATAPI CD 
> support and 
> enabling SCSI CD support..

Also note:

The SCSI-CD driver is also required if you want any kind of
reasonable performance for cdparanoia (the music CD ripper),
even for perfectly ordinary CD or DVD drives.  This took me
a couple tries last weekend, and I even knew what the problem
was.

Is there _any_ hardware where the ide-cd driver works better
than ide-scsi emulation?

If not, I suppose the only reason to keep it around is so 
people don't need to compile all the SCSI support just for 
ordinary access to ISO-9660 cds with an IDE CDROM.

In the meantime, perhaps the kernel configuration help could 
mention this little gotcha?  And maybe distributions should 
make ide-scsi the default?  At least CD ripping would work 
"out of the box" like that.

Torrey Hoffman
torrey.hoffman@myrio.com

^ permalink raw reply	[flat|nested] 17+ messages in thread
[parent not found: <no.id>]
* [PATCH,RFC] make ide-scsi more selective
@ 2001-08-22 19:46 Mikael Pettersson
  2001-08-23  2:49 ` Keith Owens
  0 siblings, 1 reply; 17+ messages in thread
From: Mikael Pettersson @ 2001-08-22 19:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: alan, ionut

On Mon, 20 Aug 2001 12:28:27 -0400 (EDT), Ion Badulescu wrote:

>The current IDE code doesn't allow the user to reserve a drive to be used 
>only with ide-scsi emulation, if the ide-scsi layer is compiled as a 
>module.

I've been rather annoyed by a dual problem in the ide-scsi setup:
during initialisation, ide-scsi will claim ALL currently unassigned
IDE devices. This is a problem in modular setups, since there's
no guarantee that currently unassigned devices actually are intended
for ide-scsi.

In my case ide-scsi would often steal my ATAPI tape drive since
my ide-tape module usually isn't loaded. Since I don't want this
to happen (for both practical and aesthetic reasons) I've used a
hack in my /etc/modules.conf to forcibly load ide-tape before
scsi_mod, but this is extremely ugly.

Seeing Ion's comment I decided to do something about this, so I
implemented a "units=" module parameter for ide-scsi, which causes
ide-scsi to skip units not explicitly listed. For symmetry one can
also specify this with a "idescsi=" kernel boot parameter.

Caveat: When listing multiple units, don't use "," to separate their
names (e.g. units=hdc,hdd). modutils insists that "," separates array
elements but the actual MODULE_PARM is a single string. I'd use "+"
instead (e.g. units=hdc+hdd), except I actually want to restrict
ide-scsi to a single unit, so I pass "units=hdc" to it.

The patch below implements this option for 2.4.8-ac9. I've also put
it in http://www.csd.uu.se/~mikpe/linux/idescsi/ together with patches
for 2.2.20pre9 with and without Andre's big IDE patch.

Comments?

/Mikael

--- linux-2.4.8-ac9/drivers/ide/ide.c.~1~	Wed Aug 22 14:13:03 2001
+++ linux-2.4.8-ac9/drivers/ide/ide.c	Wed Aug 22 14:20:56 2001
@@ -3006,6 +3006,9 @@
 	if (strncmp(s,"hd",2) == 0 && s[2] == '=')	/* hd= is for hd.c   */
 		return 0;				/* driver and not us */
 
+	if (!strncmp(s, "idescsi=", 8))	/* for ide-scsi.c not us */
+		return 0;
+
 	if (strncmp(s,"ide",3) &&
 	    strncmp(s,"idebus",6) &&
 	    strncmp(s,"hd",2))		/* hdx= & hdxlun= */
--- linux-2.4.8-ac9/drivers/scsi/ide-scsi.c.~1~	Thu Feb 22 15:23:46 2001
+++ linux-2.4.8-ac9/drivers/scsi/ide-scsi.c	Wed Aug 22 14:20:56 2001
@@ -561,6 +561,19 @@
 	NULL
 };
 
+static char *units;
+#ifdef MODULE
+MODULE_PARM(units, "s");
+#else
+/* the name "idescsi_setup" has already been taken :-( */
+static int __init setup_idescsi(char *s)
+{
+	units = s;
+	return 1;
+}
+__setup("idescsi=", setup_idescsi);
+#endif
+
 /*
  *	idescsi_init will register the driver for each scsi.
  */
@@ -580,7 +593,8 @@
 	for (i = 0; media[i] != 255; i++) {
 		failed = 0;
 		while ((drive = ide_scan_devices (media[i], idescsi_driver.name, NULL, failed++)) != NULL) {
-
+			if (units && !strstr(units, drive->name))
+				continue;
 			if ((scsi = (idescsi_scsi_t *) kmalloc (sizeof (idescsi_scsi_t), GFP_KERNEL)) == NULL) {
 				printk (KERN_ERR "ide-scsi: %s: Can't allocate a scsi structure\n", drive->name);
 				continue;

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2001-08-27 14:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-25 12:10 [PATCH,RFC] make ide-scsi more selective Mikael Pettersson
2001-08-25 12:37 ` André Dahlqvist
2001-08-25 17:33 ` safemode
     [not found] <200108251734.NAA28426@cs.columbia.edu>
2001-08-27 14:37 ` Ion Badulescu
  -- strict thread matches above, loose matches on Subject: below --
2001-08-22 23:51 Chris Rankin
2001-08-22 22:37 Torrey Hoffman
     [not found] <no.id>
2001-08-22 21:17 ` Alan Cox
2001-08-22 21:53   ` Nicholas Knight
2001-08-22 22:00     ` Ion Badulescu
2001-08-22 22:39       ` Nicholas Knight
2001-08-23  3:42         ` mhobgood
2001-08-23  3:54         ` Ion Badulescu
2001-08-23  4:29           ` Nicholas Knight
2001-08-23  0:12       ` Willem Riede
2001-08-25  6:56   ` Ion Badulescu
2001-08-22 19:46 Mikael Pettersson
2001-08-23  2:49 ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).