* patch (was Usage question)
2005-04-03 1:38 ` Usage question Dan Dennedy
@ 2005-05-04 21:19 ` Stefan Richter
2005-05-13 10:43 ` Usage question Olaf Hering
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Richter @ 2005-05-04 21:19 UTC (permalink / raw)
To: linux-scsi; +Cc: linux1394-user
Dan Dennedy wrote on 2005-04-03:
> On Sat, 2005-04-02 at 15:55 +0200, Matthias Bläsing wrote:
[hotplugging of SBP-2 CD-ROMs]
>>There was a patch for the kernel on this list, which work quite good for
>>me (sr.c and sr_ioctl.c have to be modified - Olaf Hering on
>>24.10.2004). I couldn't find any bad side effects of this.
>
> Thanks, I located the message on the linux1394-devel list:
> http://marc.theaimsgroup.com/?l=linux1394-devel&m=109862922621832&w=2
>
> There is a very good report response to Olaf's little patch.
> http://marc.theaimsgroup.com/?l=linux1394-devel&m=109925711513542&w=2
>
> Please, others, try it as well. I'm going to....
I tried it with up to two different CD-RWs and a HDD on the same FireWire
bus. Works for me. There have been other positive reports on linux1394-user
as well. Quote from Olaf's posting:
| The trouble starts in register_cdrom(), it sets the ->exit() function if
| the CD can do CDC_MRW_W.
| On unregister, it tries to send a packet to the device which is already
| gone.
|
| How about this patch?
diff -purN linux-2.6.9.orig/drivers/scsi/sr.c linux-2.6.9-olh/drivers/scsi/sr.c
--- linux-2.6.9.orig/drivers/scsi/sr.c 2004-10-22 19:02:43.545400072 +0200
+++ linux-2.6.9-olh/drivers/scsi/sr.c 2004-10-24 16:32:10.765682704 +0200
@@ -916,6 +918,7 @@ static void sr_kref_release(struct kref
struct gendisk *disk = cd->disk;
spin_lock(&sr_index_lock);
+ cd->use = 0;
clear_bit(disk->first_minor, sr_index_bits);
spin_unlock(&sr_index_lock);
diff -purN linux-2.6.9.orig/drivers/scsi/sr_ioctl.c linux-2.6.9-olh/drivers/scsi/sr_ioctl.c
--- linux-2.6.9.orig/drivers/scsi/sr_ioctl.c 2004-10-22 19:02:43.547399768 +0200
+++ linux-2.6.9-olh/drivers/scsi/sr_ioctl.c 2004-10-24 16:31:05.921540512 +0200
@@ -86,6 +86,11 @@ int sr_do_ioctl(Scsi_CD *cd, struct pack
struct request *req;
int result, err = 0, retries = 0;
+ if(!cd->use) {
+ err = -ENODEV;
+ goto out;
+ }
+
SDev = cd->device;
SRpnt = scsi_allocate_request(SDev, GFP_KERNEL);
if (!SRpnt) {
--
Stefan Richter
-=====-=-=-= -=-= --=--
http://arcgraph.de/sr/
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Usage question
2005-04-03 1:38 ` Usage question Dan Dennedy
2005-05-04 21:19 ` patch (was Usage question) Stefan Richter
@ 2005-05-13 10:43 ` Olaf Hering
1 sibling, 0 replies; 3+ messages in thread
From: Olaf Hering @ 2005-05-13 10:43 UTC (permalink / raw)
To: Dan Dennedy; +Cc: Matthias Bläsing, linux-scsi, linux1394-user
On Sat, Apr 02, Dan Dennedy wrote:
> On Sat, 2005-04-02 at 15:55 +0200, Matthias Bläsing wrote:
> > Am Sa, den 02.04.2005 schrieb Stefan Richter um 4:07:
> > > ...CD/DVD-ROMs, because there are problems with device and host
> > > structures management if sr_mod of Linux 2.6 is involved. It is an old
> > > known bug whose cause has not yet been figured out.
> >
> > There was a patch for the kernel on this list, which work quite good for
> > me (sr.c and sr_ioctl.c have to be modified - Olaf Hering on
> > 24.10.2004). I couldn't find any bad side effects of this.
>
> Thanks, I located the message on the linux1394-devel list:
> http://marc.theaimsgroup.com/?l=linux1394-devel&m=109862922621832&w=2
>
> There is a very good report response to Olaf's little patch.
> http://marc.theaimsgroup.com/?l=linux1394-devel&m=109925711513542&w=2
>
> Please, others, try it as well. I'm going to....
This patch is just a workaround.
ide-scsi shows exactly the same oops.
ide-scsi was fixed in 2.6.11 or 2.6.12, it should now have proper
refcounting. Someone has to implement the same for the sbp2 driver.
I cant help you with that challenge.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread