linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
@ 2006-01-11  8:24 Chuck Ebbert
  2006-01-11  9:23 ` Re[2]: " Andrey Borzenkov
  0 siblings, 1 reply; 7+ messages in thread
From: Chuck Ebbert @ 2006-01-11  8:24 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Andrey Borzenkov, linux-kernel

In-Reply-To: <20060110101346.GO3389@suse.de>

On Tue, 10 Jan 2006, Jens Axboe wrote:

> On Mon, Jan 09 2006, Andrey Borzenkov wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Add CDC-RAM to capability mask. This prevents udev incorrectly reporting RAM 
> > capabilities for device.
> > 
> > Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
> > 
> > - ---
> > 
> > - --- linux-2.6.15/drivers/ide/ide-cd.c.orig        2006-01-03 06:21:10.000000000 +0300
> > +++ linux-2.6.15/drivers/ide/ide-cd.c       2006-01-09 00:31:32.000000000 +0300
> > @@ -2905,6 +2905,8 @@ static int ide_cdrom_register (ide_drive
> >             devinfo->mask |= CDC_CLOSE_TRAY;
> >     if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
> >             devinfo->mask |= CDC_MO_DRIVE;
> > +   if (!CDROM_CONFIG_FLAGS(drive)->ram)
> > +           devinfo->mask |= CDC_RAM;
> >  
> >     devinfo->disk = info->disk;
> >     return register_cdrom(devinfo);
> 
> Thanks, patch is correct.


 There are more problems in that area:

An ancient SCSI CD-ROM reports:

drive name:             sr0
drive speed:            1
drive # of slots:       1
Can close tray:         1
Can open tray:          1
Can lock tray:          1
Can change speed:       0
Can select disk:        0
Can read multisession:  1
Can read MCN:           1
Reports media changed:  1
Can play audio:         1
Can write CD-R:         0
Can write CD-RW:        0
Can read DVD:           0
Can write DVD-R:        0
Can write DVD-RAM:      0
Can read MRW:           1
Can write MRW:          1
Can write RAM:          1

There's no way this drive knows anything about MRW or random-access writing:

[   15.178959]   Vendor: NEC       Model: CD-ROM DRIVE:464  Rev: 1.04
[   15.200086]   Type:   CD-ROM                             ANSI SCSI revision: 02
...
[   16.621463] sr0: scsi-1 drive


And an ATAPI DVD-ROM also reports (before the above patch):

Can read MRW:           1
Can write MRW:          1
Can write RAM:          1


-- 
Chuck
Currently reading: _Olympos_ by Dan Simmons

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

* Re[2]: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
  2006-01-11  8:24 [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask Chuck Ebbert
@ 2006-01-11  9:23 ` Andrey Borzenkov
  2006-01-11  9:29   ` Jens Axboe
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey Borzenkov @ 2006-01-11  9:23 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Jens Axboe, linux-kernel



> drive name:             sr0
> drive speed:            1
> drive # of slots:       1
> Can close tray:         1
> Can open tray:          1
> Can lock tray:          1
> Can change speed:       0
> Can select disk:        0
> Can read multisession:  1
> Can read MCN:           1
> Reports media changed:  1
> Can play audio:         1
> Can write CD-R:         0
> Can write CD-RW:        0
> Can read DVD:           0
> Can write DVD-R:        0
> Can write DVD-RAM:      0
> Can read MRW:           1
> Can write MRW:          1
> Can write RAM:          1
> 
> There's no way this drive knows anything about MRW or random-access writing:
> 
...
> And an ATAPI DVD-ROM also reports (before the above patch):
> 
> Can read MRW:           1
> Can write MRW:          1
> Can write RAM:          1
> 

I know. There were patches from Jens for both 2.4 and 2.6 that add MRW
support to ide-cd for sure; may be for sr too, am not sure. Jens, any
reasons for them not in mainstream? Otherwise probably ide-cd and sr should
not announce MRW capabiliies at all, it is too confusing; I'll send a patch
when I am at home.

-andrey

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

* Re: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
  2006-01-11  9:23 ` Re[2]: " Andrey Borzenkov
@ 2006-01-11  9:29   ` Jens Axboe
  2006-01-11  9:51     ` Re[2]: " Andrey Borzenkov
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Axboe @ 2006-01-11  9:29 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: Chuck Ebbert, linux-kernel

On Wed, Jan 11 2006, Andrey Borzenkov wrote:
> 
> 
> > drive name:             sr0
> > drive speed:            1
> > drive # of slots:       1
> > Can close tray:         1
> > Can open tray:          1
> > Can lock tray:          1
> > Can change speed:       0
> > Can select disk:        0
> > Can read multisession:  1
> > Can read MCN:           1
> > Reports media changed:  1
> > Can play audio:         1
> > Can write CD-R:         0
> > Can write CD-RW:        0
> > Can read DVD:           0
> > Can write DVD-R:        0
> > Can write DVD-RAM:      0
> > Can read MRW:           1
> > Can write MRW:          1
> > Can write RAM:          1
> > 
> > There's no way this drive knows anything about MRW or random-access writing:
> > 
> ...
> > And an ATAPI DVD-ROM also reports (before the above patch):
> > 
> > Can read MRW:           1
> > Can write MRW:          1
> > Can write RAM:          1
> > 
> 
> I know. There were patches from Jens for both 2.4 and 2.6 that add MRW
> support to ide-cd for sure; may be for sr too, am not sure. Jens, any
> reasons for them not in mainstream? Otherwise probably ide-cd and sr should
> not announce MRW capabiliies at all, it is too confusing; I'll send a patch
> when I am at home.

MRW support is in 2.6 since ages. The MRW flag is only detected on open,
so it should disappear from the proc file once you have opened the
drive. It has to be done that way, I'm afraid.

Other than that, it's not uncommon for the cap probe to fail somewhat on
older drives. So the 'info' file isn't always 100% reliable.

-- 
Jens Axboe


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

* Re[2]: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
  2006-01-11  9:29   ` Jens Axboe
@ 2006-01-11  9:51     ` Andrey Borzenkov
  2006-01-11  9:55       ` Jens Axboe
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey Borzenkov @ 2006-01-11  9:51 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Chuck Ebbert, linux-kernel



-----Original Message-----
From: Jens Axboe <axboe@suse.de>
To: Andrey Borzenkov <arvidjaar@mail.ru>
Date: Wed, 11 Jan 2006 10:29:38 +0100
Subject: Re: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask

> 
> On Wed, Jan 11 2006, Andrey Borzenkov wrote:
> > 
> > 
> > > drive name:             sr0
> > > drive speed:            1
> > > drive # of slots:       1
> > > Can close tray:         1
> > > Can open tray:          1
> > > Can lock tray:          1
> > > Can change speed:       0
> > > Can select disk:        0
> > > Can read multisession:  1
> > > Can read MCN:           1
> > > Reports media changed:  1
> > > Can play audio:         1
> > > Can write CD-R:         0
> > > Can write CD-RW:        0
> > > Can read DVD:           0
> > > Can write DVD-R:        0
> > > Can write DVD-RAM:      0
> > > Can read MRW:           1
> > > Can write MRW:          1
> > > Can write RAM:          1
> > > 
> > > There's no way this drive knows anything about MRW or random-access writing:
> > > 
> > ...
> > > And an ATAPI DVD-ROM also reports (before the above patch):
> > > 
> > > Can read MRW:           1
> > > Can write MRW:          1
> > > Can write RAM:          1
> > > 
> > 
> > I know. There were patches from Jens for both 2.4 and 2.6 that add MRW
> > support to ide-cd for sure; may be for sr too, am not sure. Jens, any
> > reasons for them not in mainstream? Otherwise probably ide-cd and sr should
> > not announce MRW capabiliies at all, it is too confusing; I'll send a patch
> > when I am at home.
> 
> MRW support is in 2.6 since ages. The MRW flag is only detected on open,
> so it should disappear from the proc file once you have opened the
> drive. It has to be done that way, I'm afraid.
> 

I see, it is in generic cdrom code, sorry.

is it possible that drive supports MRW_W without supporting any other write
method (_R/_RW)? Should not ide-cd/sr - or possibly even cdrom - mask MRW_W
if they do not support writing at all?

thank you

-andrey

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

* Re: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
  2006-01-11  9:51     ` Re[2]: " Andrey Borzenkov
@ 2006-01-11  9:55       ` Jens Axboe
  0 siblings, 0 replies; 7+ messages in thread
From: Jens Axboe @ 2006-01-11  9:55 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: Chuck Ebbert, linux-kernel

On Wed, Jan 11 2006, Andrey Borzenkov wrote:
> 
> 
> -----Original Message-----
> From: Jens Axboe <axboe@suse.de>
> To: Andrey Borzenkov <arvidjaar@mail.ru>
> Date: Wed, 11 Jan 2006 10:29:38 +0100
> Subject: Re: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
> 
> > 
> > On Wed, Jan 11 2006, Andrey Borzenkov wrote:
> > > 
> > > 
> > > > drive name:             sr0
> > > > drive speed:            1
> > > > drive # of slots:       1
> > > > Can close tray:         1
> > > > Can open tray:          1
> > > > Can lock tray:          1
> > > > Can change speed:       0
> > > > Can select disk:        0
> > > > Can read multisession:  1
> > > > Can read MCN:           1
> > > > Reports media changed:  1
> > > > Can play audio:         1
> > > > Can write CD-R:         0
> > > > Can write CD-RW:        0
> > > > Can read DVD:           0
> > > > Can write DVD-R:        0
> > > > Can write DVD-RAM:      0
> > > > Can read MRW:           1
> > > > Can write MRW:          1
> > > > Can write RAM:          1
> > > > 
> > > > There's no way this drive knows anything about MRW or random-access writing:
> > > > 
> > > ...
> > > > And an ATAPI DVD-ROM also reports (before the above patch):
> > > > 
> > > > Can read MRW:           1
> > > > Can write MRW:          1
> > > > Can write RAM:          1
> > > > 
> > > 
> > > I know. There were patches from Jens for both 2.4 and 2.6 that add MRW
> > > support to ide-cd for sure; may be for sr too, am not sure. Jens, any
> > > reasons for them not in mainstream? Otherwise probably ide-cd and sr should
> > > not announce MRW capabiliies at all, it is too confusing; I'll send a patch
> > > when I am at home.
> > 
> > MRW support is in 2.6 since ages. The MRW flag is only detected on open,
> > so it should disappear from the proc file once you have opened the
> > drive. It has to be done that way, I'm afraid.
> > 
> 
> I see, it is in generic cdrom code, sorry.
> 
> is it possible that drive supports MRW_W without supporting any other write
> method (_R/_RW)? Should not ide-cd/sr - or possibly even cdrom - mask MRW_W
> if they do not support writing at all?

I don't know why anyone would make such a device, but of course it's
possible. Masking MRW if the device can't write sounds like a safe
enough bet, I'll take a patch :)

-- 
Jens Axboe


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

* Re: [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
  2006-01-09 20:16 Andrey Borzenkov
@ 2006-01-10 10:13 ` Jens Axboe
  0 siblings, 0 replies; 7+ messages in thread
From: Jens Axboe @ 2006-01-10 10:13 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: linux-ide, linux-kernel

On Mon, Jan 09 2006, Andrey Borzenkov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Add CDC-RAM to capability mask. This prevents udev incorrectly reporting RAM 
> capabilities for device.
> 
> Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
> 
> - ---
> 
> - --- linux-2.6.15/drivers/ide/ide-cd.c.orig	2006-01-03 06:21:10.000000000 +0300
> +++ linux-2.6.15/drivers/ide/ide-cd.c	2006-01-09 00:31:32.000000000 +0300
> @@ -2905,6 +2905,8 @@ static int ide_cdrom_register (ide_drive
>  		devinfo->mask |= CDC_CLOSE_TRAY;
>  	if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
>  		devinfo->mask |= CDC_MO_DRIVE;
> +	if (!CDROM_CONFIG_FLAGS(drive)->ram)
> +		devinfo->mask |= CDC_RAM;
>  
>  	devinfo->disk = info->disk;
>  	return register_cdrom(devinfo);

Thanks, patch is correct.

-- 
Jens Axboe


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

* [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask
@ 2006-01-09 20:16 Andrey Borzenkov
  2006-01-10 10:13 ` Jens Axboe
  0 siblings, 1 reply; 7+ messages in thread
From: Andrey Borzenkov @ 2006-01-09 20:16 UTC (permalink / raw)
  To: linux-ide; +Cc: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Add CDC-RAM to capability mask. This prevents udev incorrectly reporting RAM 
capabilities for device.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>

- ---

- --- linux-2.6.15/drivers/ide/ide-cd.c.orig	2006-01-03 06:21:10.000000000 +0300
+++ linux-2.6.15/drivers/ide/ide-cd.c	2006-01-09 00:31:32.000000000 +0300
@@ -2905,6 +2905,8 @@ static int ide_cdrom_register (ide_drive
 		devinfo->mask |= CDC_CLOSE_TRAY;
 	if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
 		devinfo->mask |= CDC_MO_DRIVE;
+	if (!CDROM_CONFIG_FLAGS(drive)->ram)
+		devinfo->mask |= CDC_RAM;
 
 	devinfo->disk = info->disk;
 	return register_cdrom(devinfo);
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDwsSvR6LMutpd94wRAuyRAKDVr66aA5cGLoQAliK20dz7FbTP+wCfb8C3
qCm1Sur7eFjCh2i1J95qI68=
=i3pt
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2006-01-11  9:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-11  8:24 [PATCH]trivial: add CDC_RAM to ide-cd capabilities mask Chuck Ebbert
2006-01-11  9:23 ` Re[2]: " Andrey Borzenkov
2006-01-11  9:29   ` Jens Axboe
2006-01-11  9:51     ` Re[2]: " Andrey Borzenkov
2006-01-11  9:55       ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2006-01-09 20:16 Andrey Borzenkov
2006-01-10 10:13 ` Jens Axboe

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