* Re: [PATCH] remove dead ATAPI multi-lun support (used for ide-scsi) [not found] <200402202247.02345.bzolnier@elka.pw.edu.pl> @ 2004-03-07 13:49 ` Willem Riede 2004-03-07 16:13 ` Jeff Garzik 0 siblings, 1 reply; 3+ messages in thread From: Willem Riede @ 2004-03-07 13:49 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel, linux-scsi On 2004.02.20 16:47, Bartlomiej Zolnierkiewicz wrote: > > [IDE] remove dead ATAPI multi-lun support (used for ide-scsi) > > ChangeSet@1.889.69.2 03-01-23 14:51:03-05:00 adam@yggdrasil.com > | The following changes to ide-scsi.c are a recovery of the > | changes that I had in ide-scsi.c in the stock kernel's before > | Martin Dalecki's IDE tree was reverted and a few other changes. > ... > > broke it. > > Before this change drive->id->last_id & 0x7 was used as shost->max_lun > and "hdXlun=" kernel parameter could be used to override it. > > It was needed probably only for some rare ATAPI PD-CD drives > (http://www.geocrawler.com/archives/3/58/1999/11/50/2877161/). > > However it was far from optimal: > - people played with "hdXlun=" and then complained about multiple instances > of the same device (most ATAPI drives respond to each LUN) > - probably some devices return 7 not 0 in id->last_id (=> 7 x same device) > > This patch cleans things up, multi-lun will be fixed if needed in ide-scsi. > I think that this may work but can't verify it: > > if (id->last_lun && id->last_lun != 7) > shost->max_lun = id->last_lun + 1; > else > shost->max_lun = 1; I have verified that this works with my PD/CD drive, the patch to ide-scsi.c that I suggest (against linux-2.6.4-rc1-mm2) is below. Thanks, Willem Riede. --- m0/drivers/scsi/ide-scsi.c 2004-03-05 19:54:33.000000000 -0500 +++ m1/drivers/scsi/ide-scsi.c 2004-03-06 14:49:47.000000000 -0500 @@ -1148,7 +1148,16 @@ return 1; host->max_id = 1; - host->max_lun = 1; + +#if IDESCSI_DEBUG_LOG + if (drive->id->last_lun) + printk(KERN_NOTICE "%s: id->last_lun=%u\n", drive->name, drive->id->last_lun); +#endif + if ((drive->id->last_lun & 0x7) != 7) + host->max_lun = (drive->id->last_lun & 0x7) + 1; + else + host->max_lun = 1; + drive->driver_data = host; idescsi = scsihost_to_idescsi(host); idescsi->drive = drive; ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] remove dead ATAPI multi-lun support (used for ide-scsi) 2004-03-07 13:49 ` [PATCH] remove dead ATAPI multi-lun support (used for ide-scsi) Willem Riede @ 2004-03-07 16:13 ` Jeff Garzik 2004-03-07 16:53 ` Willem Riede 0 siblings, 1 reply; 3+ messages in thread From: Jeff Garzik @ 2004-03-07 16:13 UTC (permalink / raw) To: wrlk; +Cc: Bartlomiej Zolnierkiewicz, linux-ide, linux-kernel, linux-scsi Willem Riede wrote: > On 2004.02.20 16:47, Bartlomiej Zolnierkiewicz wrote: > >>[IDE] remove dead ATAPI multi-lun support (used for ide-scsi) >> >>ChangeSet@1.889.69.2 03-01-23 14:51:03-05:00 adam@yggdrasil.com >>| The following changes to ide-scsi.c are a recovery of the >>| changes that I had in ide-scsi.c in the stock kernel's before >>| Martin Dalecki's IDE tree was reverted and a few other changes. >>... >> >>broke it. >> >>Before this change drive->id->last_id & 0x7 was used as shost->max_lun >>and "hdXlun=" kernel parameter could be used to override it. >> >>It was needed probably only for some rare ATAPI PD-CD drives >>(http://www.geocrawler.com/archives/3/58/1999/11/50/2877161/). >> >>However it was far from optimal: >>- people played with "hdXlun=" and then complained about multiple instances >> of the same device (most ATAPI drives respond to each LUN) >>- probably some devices return 7 not 0 in id->last_id (=> 7 x same device) >> >>This patch cleans things up, multi-lun will be fixed if needed in ide-scsi. >>I think that this may work but can't verify it: >> >> if (id->last_lun && id->last_lun != 7) >> shost->max_lun = id->last_lun + 1; >> else >> shost->max_lun = 1; > > > I have verified that this works with my PD/CD drive, the patch to ide-scsi.c > that I suggest (against linux-2.6.4-rc1-mm2) is below. I have a multi-LUN ATAPI CD changer here... Jeff ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] remove dead ATAPI multi-lun support (used for ide-scsi) 2004-03-07 16:13 ` Jeff Garzik @ 2004-03-07 16:53 ` Willem Riede 0 siblings, 0 replies; 3+ messages in thread From: Willem Riede @ 2004-03-07 16:53 UTC (permalink / raw) To: Jeff Garzik Cc: wrlk, Bartlomiej Zolnierkiewicz, linux-ide, linux-kernel, linux-scsi On 2004.03.07 11:13, Jeff Garzik wrote: > Willem Riede wrote: > > > > I have verified that this works with my PD/CD drive, the patch to ide-scsi.c > > that I suggest (against linux-2.6.4-rc1-mm2) is below. > > > I have a multi-LUN ATAPI CD changer here... If you can test my patch with it, that would be great. My CD changer doesn't report multiple LUNs :-( Thanks, Willem Riede. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-07 16:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200402202247.02345.bzolnier@elka.pw.edu.pl>
2004-03-07 13:49 ` [PATCH] remove dead ATAPI multi-lun support (used for ide-scsi) Willem Riede
2004-03-07 16:13 ` Jeff Garzik
2004-03-07 16:53 ` Willem Riede
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox