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

* Re: [PATCH,RFC] make ide-scsi more selective
  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
  1 sibling, 0 replies; 17+ messages in thread
From: André Dahlqvist @ 2001-08-25 12:37 UTC (permalink / raw)
  To: linux-kernel

Mikael Pettersson <mikpe@csd.uu.se> wrote:

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

There are no cd-recoders which are completely ATAPI only. Read the cdrecord
website.
-- 

André Dahlqvist <andre.dahlqvist@telia.com>

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

* Re: [PATCH,RFC] make ide-scsi more selective
  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
  1 sibling, 0 replies; 17+ messages in thread
From: safemode @ 2001-08-25 17:33 UTC (permalink / raw)
  To: Mikael Pettersson, ionut; +Cc: alan, linux-kernel

On Saturday 25 August 2001 08:10, Mikael Pettersson wrote:


> 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?
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


Is there something wrong with making the Atapi cdrom driver as module and 
then loading that with an ignore hdX then loading the ide-scsi module?  That 
doesn't seem hard at all.  just two pretty lines in /etc/modules.  Just make 
both drivers modular.   otherwise you have people needing to do boot 
arguments through lilo.  


and andre had a patch at one time that was supposed to do something like 
allow you to use the recording function of ide CDR's without the scsi layer.  
Not sure if it was complete or even really working but i tried it once.  
Maybe you can ask him if it's possible.  

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

* Re: [PATCH,RFC] make ide-scsi more selective
       [not found] <200108251734.NAA28426@cs.columbia.edu>
@ 2001-08-27 14:37 ` Ion Badulescu
  0 siblings, 0 replies; 17+ messages in thread
From: Ion Badulescu @ 2001-08-27 14:37 UTC (permalink / raw)
  To: safemode; +Cc: Mikael Pettersson, Alan Cox, linux-kernel

On Sat, 25 Aug 2001, safemode wrote:

> Is there something wrong with making the Atapi cdrom driver as module and 
> then loading that with an ignore hdX then loading the ide-scsi module?  That 
> doesn't seem hard at all.  just two pretty lines in /etc/modules.  Just make 
> both drivers modular.   otherwise you have people needing to do boot 
> arguments through lilo.  

Some people actually _like_ having a non-modular kernel and passing 
arguments through lilo. As for myself, personally I just like having both 
equally functional so I can choose whichever is better for the task at 
hand.

> and andre had a patch at one time that was supposed to do something like 
> allow you to use the recording function of ide CDR's without the scsi layer.  
> Not sure if it was complete or even really working but i tried it once.  
> Maybe you can ask him if it's possible.  

The packet writing stuff? That's actually Jens Axboe's work, and is very 
different from the good ol' CD burning technique.

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.


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

* Re: [PATCH,RFC] make ide-scsi more selective
  2001-08-22 21:17 ` Alan Cox
  2001-08-22 21:53   ` Nicholas Knight
@ 2001-08-25  6:56   ` Ion Badulescu
  1 sibling, 0 replies; 17+ messages in thread
From: Ion Badulescu @ 2001-08-25  6:56 UTC (permalink / raw)
  To: Alan Cox; +Cc: Mikael Pettersson, linux-kernel

On Wed, 22 Aug 2001, Alan Cox wrote:

> 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 ?

Mostly because sr_open() does not make any calls into the host driver, 
which makes it impossible to claim any resources on open.

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.

Thanks,
Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.
-----------------------------------
diff -ur ../linux-2.4-ac/drivers/ide/ide-cd.c linux-2.4.8-ac7/drivers/ide/ide-cd.c
--- ../linux-2.4-ac/drivers/ide/ide-cd.c	Sat Aug 18 06:03:21 2001
+++ linux-2.4.8-ac7/drivers/ide/ide-cd.c	Sat Aug 25 02:30:03 2001
@@ -3026,7 +3026,7 @@
 				continue;
 			}
 		}
-		if (drive->scsi) {
+		if (drive->scsi == 1) {
 			printk("ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);
 			continue;
 		}
diff -ur ../linux-2.4-ac/drivers/ide/ide-floppy.c linux-2.4.8-ac7/drivers/ide/ide-floppy.c
--- ../linux-2.4-ac/drivers/ide/ide-floppy.c	Sat Aug 18 06:03:21 2001
+++ linux-2.4.8-ac7/drivers/ide/ide-floppy.c	Sat Aug 25 02:29:51 2001
@@ -2018,7 +2018,7 @@
 			printk (KERN_ERR "ide-floppy: %s: not supported by this version of ide-floppy\n", drive->name);
 			continue;
 		}
-		if (drive->scsi) {
+		if (drive->scsi == 1) {
 			printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
 			continue;
 		}
diff -ur ../linux-2.4-ac/drivers/ide/ide-tape.c linux-2.4.8-ac7/drivers/ide/ide-tape.c
--- ../linux-2.4-ac/drivers/ide/ide-tape.c	Sat Aug 18 06:03:21 2001
+++ linux-2.4.8-ac7/drivers/ide/ide-tape.c	Sat Aug 25 02:29:39 2001
@@ -6235,7 +6235,7 @@
 			printk (KERN_ERR "ide-tape: %s: not supported by this version of ide-tape\n", drive->name);
 			continue;
 		}
-		if (drive->scsi) {
+		if (drive->scsi == 1) {
 			if (strstr(drive->id->model, "OnStream DI-")) {
 				printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model);
 			} else {
diff -ur ../linux-2.4-ac/drivers/ide/ide.c linux-2.4.8-ac7/drivers/ide/ide.c
--- ../linux-2.4-ac/drivers/ide/ide.c	Sat Aug 18 06:03:21 2001
+++ linux-2.4.8-ac7/drivers/ide/ide.c	Sat Aug 25 02:29:24 2001
@@ -3045,7 +3045,7 @@
 		const char *hd_words[] = {"none", "noprobe", "nowerr", "cdrom",
 				"serialize", "autotune", "noautotune",
 				"slow", "swapdata", "bswap", "flash",
-				"remap", "noremap", "scsi", NULL};
+				"remap", "noremap", "scsi", "noscsi", NULL};
 		unit = s[2] - 'a';
 		hw   = unit / MAX_DRIVES;
 		unit = unit % MAX_DRIVES;
@@ -3109,13 +3109,15 @@
 				drive->remap_0_to_1 = 2;
 				goto done;
 			case -14: /* "scsi" */
-#if defined(CONFIG_BLK_DEV_IDESCSI) && defined(CONFIG_SCSI)
+#if defined(CONFIG_BLK_DEV_IDESCSI) || defined(CONFIG_BLK_DEV_IDESCSI_MODULE)
 				drive->scsi = 1;
-				goto done;
 #else
-				drive->scsi = 0;
-				goto bad_option;
-#endif /* defined(CONFIG_BLK_DEV_IDESCSI) && defined(CONFIG_SCSI) */
+				printk(" -- ide-scsi support unavailable, ignoring.\n");
+#endif /* defined(CONFIG_BLK_DEV_IDESCSI) || defined(CONFIG_BLK_DEV_IDESCSI_MODULE) */
+				goto done;
+			case -15: /* "noscsi" */
+				drive->scsi = 2;
+				goto done;
 			case 3: /* cyl,head,sect */
 				drive->media	= ide_disk;
 				drive->cyl	= drive->bios_cyl  = vals[0];
--- ../linux-2.4-ac/drivers/scsi/ide-scsi.c	Fri Feb  9 14:30:23 2001
+++ linux-2.4.8-ac7/drivers/scsi/ide-scsi.c	Sat Aug 25 02:29:04 2001
@@ -580,7 +580,10 @@
 	for (i = 0; media[i] != 255; i++) {
 		failed = 0;
 		while ((drive = ide_scan_devices (media[i], idescsi_driver.name, NULL, failed++)) != NULL) {
-
+			if (drive->scsi == 2) {
+				printk ("ide-scsi: skipping reserved drive %s.\n", 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

* Re: [PATCH,RFC] make ide-scsi more selective
  2001-08-23  3:54         ` Ion Badulescu
@ 2001-08-23  4:29           ` Nicholas Knight
  0 siblings, 0 replies; 17+ messages in thread
From: Nicholas Knight @ 2001-08-23  4:29 UTC (permalink / raw)
  To: Ion Badulescu; +Cc: linux-kernel

On Wednesday 22 August 2001 08:54 pm, Ion Badulescu wrote:
> On Wed, 22 Aug 2001, Nicholas Knight wrote:
> > Could you elaborate on this? I almost never use modules for my
> > primary desktop system, SCSI emulation support and SCSI generic
> > driver were both compiled in, and I had "hdc=ide-scsi" and later also
> > tried "hdc=scsi" and
>
> Well, hdc=ide-scsi is for 2.2 and hdc=scsi is for 2.4. Yup, yet another
> of those gratuitious incompatibilities.

tried both, neither worked, even with SCSI CD-ROM support enabled

>
> > I was unable to read from it with any device, /dev/sr0 /dev/sda
> > /dev/scd0 were all dead-ends, but I was able to WRITE just fine... I
> > just don't want to reboot every time I want to write to the drive,
> > nor reboot when I want to READ from it.
>
> I'm not sure why this is happening for you, my CDR drive works for both
> reading and writing using the ide-scsi driver. But it's a known fact
> that ide-scsi is not perfect, so that could explain it.

I've gotten the impression that ide-scsi isn't perfect :)

>
> > Disabling ATAPI CD-ROM support, and enabling SCSI CD-ROM (along with
> > SCSI emulation support and SCSI generic support) worked, and now I
> > just access both my CD-RW drive and my DVD-ROM drive through /dev/sr0
> > and /dev/sr1.
>
> So now you're saying it *does* work with ide-scsi? I'm utterly
> confused...

I'll be more specific:

I've used this in 2.4.8 and 2.4.8-ac9 to read from my IDE/ATAPI CD-RW 
drive while also using it to write to
I now have IDE/ATAPI CD-ROM support DISABLED in the ATA/* menu
SCSI emulation is ENABLED in the ATA/* menu
SCSI CD-ROM support is ENABLED in the SCSI menu
SCSI Generic is ENABLED in the SCSI menu
I do not have any parameters (such as hdX=scsi or ide-scsi) being passed 
to the kernel except those for my SB16 card, which doesn't have any 
devices hooked to its IDE port.

this appears at kernel boot:
SCSI subsystem driver Revision: 1.00
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
  Vendor: PLEXTOR   Model: CD-R   PX-W1610A  Rev: 1.00
  Type:   CD-ROM                             ANSI SCSI revision: 02
  Vendor: PIONEER   Model: DVD-ROM DVD-113   Rev: 1.08
  Type:   CD-ROM                             ANSI SCSI revision: 02
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
Attached scsi CD-ROM sr1 at scsi0, channel 0, id 1, lun 0
sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12
sr1: scsi3-mmc drive: 0x/0x cd/rw xa/form2 cdda tray

using 0,0,0 works for cdrecord, and using /dev/sr0 to mount discs in my 
CD-RW drive and /dev/sr1
using /dev/hdc and /dev/hdd does NOT work now

Without this setup, I've been unable to read from my CD-RW drive while 
it's also setup to write to with SCSI generic.

>
> > My primary concern here is other users who haven't figured this out,
> > I know at least one ATAPI/IDE CD-R(W) in Linux HOWTO tells the user
> > that they'll have to use two seperate kernel images, one to allow
> > reading from their drive and the other for writing, infact that was
> > my original method.
>
> Nope. Ide-scsi should be fine for both reading and writing.

didn't for me

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

* Re: [PATCH,RFC] make ide-scsi more selective
  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
  1 sibling, 1 reply; 17+ messages in thread
From: Ion Badulescu @ 2001-08-23  3:54 UTC (permalink / raw)
  To: Nicholas Knight; +Cc: linux-kernel

On Wed, 22 Aug 2001, Nicholas Knight wrote:

> Could you elaborate on this? I almost never use modules for my primary 
> desktop system, SCSI emulation support and SCSI generic driver were both 
> compiled in, and I had "hdc=ide-scsi" and later also tried "hdc=scsi" and 

Well, hdc=ide-scsi is for 2.2 and hdc=scsi is for 2.4. Yup, yet another of 
those gratuitious incompatibilities.

> I was unable to read from it with any device, /dev/sr0 /dev/sda /dev/scd0 
> were all dead-ends, but I was able to WRITE just fine... I just don't 
> want to reboot every time I want to write to the drive, nor reboot when I 
> want to READ from it.

I'm not sure why this is happening for you, my CDR drive works for both 
reading and writing using the ide-scsi driver. But it's a known fact that 
ide-scsi is not perfect, so that could explain it.

> Disabling ATAPI CD-ROM support, and enabling SCSI CD-ROM (along with SCSI 
> emulation support and SCSI generic support) worked, and now I just access 
> both my CD-RW drive and my DVD-ROM drive through /dev/sr0 and /dev/sr1.

So now you're saying it *does* work with ide-scsi? I'm utterly confused...

> My primary concern here is other users who haven't figured this out, I 
> know at least one ATAPI/IDE CD-R(W) in Linux HOWTO tells the user that 
> they'll have to use two seperate kernel images, one to allow reading from 
> their drive and the other for writing, infact that was my original method.

Nope. Ide-scsi should be fine for both reading and writing.

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.


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

* Re: [PATCH,RFC] make ide-scsi more selective
  2001-08-22 22:39       ` Nicholas Knight
@ 2001-08-23  3:42         ` mhobgood
  2001-08-23  3:54         ` Ion Badulescu
  1 sibling, 0 replies; 17+ messages in thread
From: mhobgood @ 2001-08-23  3:42 UTC (permalink / raw)
  To: linux-kernel

Well,
	I just double checked my system.  Sure enough I'm using ide-scsi
along with hdd="ide-scsi" with lilo.  It grabs hdd, which is my HP-7200
CD-RW and leaves hdc, which is my DVD alone.  I've no trouble at all
in reading or writing to hdd; no different kernel images, nothing.  I
use modules and have them normally loaded at boot time since I routinely
use both drives to read from.  My understanding was that I only needed
the hdd="ide-scsi" in lilo to prevent ATAPI from grabbing all the drives
it found.  BTW, everything pertaining to scsi is a module on this system.

Cordially,
Mike Hobgood


On Wed, Aug 22, 2001 at 03:39:12PM -0700, Nicholas Knight wrote:
> On Wednesday 22 August 2001 03:00 pm, Ion Badulescu wrote:
> > On Wed, 22 Aug 2001, Nicholas Knight wrote:
> > > 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..
> >
> > Just doing hdX=scsi would have been enough, however. Except it doesn't
> > work (currently) if ide-scsi is a module.
> 
> Could you elaborate on this? I almost never use modules for my primary 
> desktop system, SCSI emulation support and SCSI generic driver were both 
> compiled in, and I had "hdc=ide-scsi" and later also tried "hdc=scsi" and 
> 
> I was unable to read from it with any device, /dev/sr0 /dev/sda /dev/scd0 
> were all dead-ends, but I was able to WRITE just fine... I just don't 
> want to reboot every time I want to write to the drive, nor reboot when I 
> want to READ from it.
> 
> Disabling ATAPI CD-ROM support, and enabling SCSI CD-ROM (along with SCSI 
> emulation support and SCSI generic support) worked, and now I just access 
> both my CD-RW drive and my DVD-ROM drive through /dev/sr0 and /dev/sr1.
> 
> My primary concern here is other users who haven't figured this out, I 
> know at least one ATAPI/IDE CD-R(W) in Linux HOWTO tells the user that 
> they'll have to use two seperate kernel images, one to allow reading from 
> their drive and the other for writing, infact that was my original method.
> 
> > I agree with Alan that the problem is the grab-on-load strategy that
> > ide-scsi (and ide-cd for that matter) uses. I am willing to look into
> > changing that to grab-on-open but I'm not sure if the change is an
> > appropriate one for a stable series kernel -- it looks pretty
> > non-trivial.
> >
> > Ion
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH,RFC] make ide-scsi more selective
  2001-08-22 19:46 Mikael Pettersson
@ 2001-08-23  2:49 ` Keith Owens
  0 siblings, 0 replies; 17+ messages in thread
From: Keith Owens @ 2001-08-23  2:49 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: linux-kernel

On Wed, 22 Aug 2001 21:46:03 +0200 (MET DST), 
Mikael Pettersson <mikpe@csd.uu.se> wrote:
>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.

man modules.conf, under options keyword

  If any of the MODULE_SPECIFIC_OPTIONS contain characters that are
  special to the shell (e.g.  space, comma, parentheses) then the
  option must be enclosed in '"..."'.  The '' delimit the option in
  modules.conf, the "" delimit the option when it is passed to the
  shell.  For example,

    abc='"def,ghi jkl (xyz)"'

If that does not work for a string, tell me.


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

* Re: [PATCH,RFC] make ide-scsi more selective
  2001-08-22 22:00     ` Ion Badulescu
  2001-08-22 22:39       ` Nicholas Knight
@ 2001-08-23  0:12       ` Willem Riede
  1 sibling, 0 replies; 17+ messages in thread
From: Willem Riede @ 2001-08-23  0:12 UTC (permalink / raw)
  To: Ion Badulescu; +Cc: Nicholas Knight, Alan Cox, Mikael Pettersson, linux-kernel

Alan Cox wrote:
> 
> > 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.
> 
> 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 ?
> 
Ion Badulescu wrote:
> 
> On Wed, 22 Aug 2001, Nicholas Knight wrote:
> 
> > 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..
> 
> Just doing hdX=scsi would have been enough, however. Except it doesn't
> work (currently) if ide-scsi is a module.
> 
Well, at least on my system (RH 7.1) in rc.sysinit there's a fragment
that checks if ide-scsi is asked for and if so loads ide-cd first, so
it can grab CD drives that are not targeted for scsi emulation.

Personally, I've added a modprobe of ide-tape there so that ide-scsi 
can't grab any tape drives it is not supposed to either.

> I agree with Alan that the problem is the grab-on-load strategy that
> ide-scsi (and ide-cd for that matter) uses. I am willing to look into
> changing that to grab-on-open but I'm not sure if the change is an
> appropriate one for a stable series kernel -- it looks pretty non-trivial.
> 
Right. And it is not limited to ide-scsi but impacts drivers that
connect to ide-scsi such as the osst tape driver I maintain which
would have to allow a device to be ht0 and osst0 at the user's choice...

Regards, Willem Riede.

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

* 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: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  0:12       ` Willem Riede
  1 sibling, 2 replies; 17+ messages in thread
From: Nicholas Knight @ 2001-08-22 22:39 UTC (permalink / raw)
  To: Ion Badulescu; +Cc: Alan Cox, Mikael Pettersson, linux-kernel

On Wednesday 22 August 2001 03:00 pm, Ion Badulescu wrote:
> On Wed, 22 Aug 2001, Nicholas Knight wrote:
> > 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..
>
> Just doing hdX=scsi would have been enough, however. Except it doesn't
> work (currently) if ide-scsi is a module.

Could you elaborate on this? I almost never use modules for my primary 
desktop system, SCSI emulation support and SCSI generic driver were both 
compiled in, and I had "hdc=ide-scsi" and later also tried "hdc=scsi" and 

I was unable to read from it with any device, /dev/sr0 /dev/sda /dev/scd0 
were all dead-ends, but I was able to WRITE just fine... I just don't 
want to reboot every time I want to write to the drive, nor reboot when I 
want to READ from it.

Disabling ATAPI CD-ROM support, and enabling SCSI CD-ROM (along with SCSI 
emulation support and SCSI generic support) worked, and now I just access 
both my CD-RW drive and my DVD-ROM drive through /dev/sr0 and /dev/sr1.

My primary concern here is other users who haven't figured this out, I 
know at least one ATAPI/IDE CD-R(W) in Linux HOWTO tells the user that 
they'll have to use two seperate kernel images, one to allow reading from 
their drive and the other for writing, infact that was my original method.

> I agree with Alan that the problem is the grab-on-load strategy that
> ide-scsi (and ide-cd for that matter) uses. I am willing to look into
> changing that to grab-on-open but I'm not sure if the change is an
> appropriate one for a stable series kernel -- it looks pretty
> non-trivial.
>
> Ion

^ 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

* Re: [PATCH,RFC] make ide-scsi more selective
  2001-08-22 21:53   ` Nicholas Knight
@ 2001-08-22 22:00     ` Ion Badulescu
  2001-08-22 22:39       ` Nicholas Knight
  2001-08-23  0:12       ` Willem Riede
  0 siblings, 2 replies; 17+ messages in thread
From: Ion Badulescu @ 2001-08-22 22:00 UTC (permalink / raw)
  To: Nicholas Knight; +Cc: Alan Cox, Mikael Pettersson, linux-kernel

On Wed, 22 Aug 2001, Nicholas Knight wrote:

> 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..

Just doing hdX=scsi would have been enough, however. Except it doesn't 
work (currently) if ide-scsi is a module.

I agree with Alan that the problem is the grab-on-load strategy that
ide-scsi (and ide-cd for that matter) uses. I am willing to look into 
changing that to grab-on-open but I'm not sure if the change is an 
appropriate one for a stable series kernel -- it looks pretty non-trivial.

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.



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

* Re: [PATCH,RFC] make ide-scsi more selective
  2001-08-22 21:17 ` Alan Cox
@ 2001-08-22 21:53   ` Nicholas Knight
  2001-08-22 22:00     ` Ion Badulescu
  2001-08-25  6:56   ` Ion Badulescu
  1 sibling, 1 reply; 17+ messages in thread
From: Nicholas Knight @ 2001-08-22 21:53 UTC (permalink / raw)
  To: Alan Cox, Mikael Pettersson; +Cc: linux-kernel, alan, ionut

On Wednesday 22 August 2001 02:17 pm, Alan Cox wrote:
> > 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.
>
> 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 ?

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..
This is a severe inconvienience to the end-user who doesn't know what the 
problem is, esspecialy since I only found the answer to the problem in a 
couple places, I had to go through a ton of google search results to find 
anything.

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

* Re: [PATCH,RFC] make ide-scsi more selective
       [not found] <no.id>
@ 2001-08-22 21:17 ` Alan Cox
  2001-08-22 21:53   ` Nicholas Knight
  2001-08-25  6:56   ` Ion Badulescu
  0 siblings, 2 replies; 17+ messages in thread
From: Alan Cox @ 2001-08-22 21:17 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: linux-kernel, alan, ionut

> 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.

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 ?

Alan

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

* [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).