Thierry, bug 930 is assigned you but it is pure kernel problem actually :) > > Have a LS120 removable drive. [...] [...] > << sigh >> wish i knew to look here earlier. > Here's a sip from the file: > > scsi0 : SCSI host adapter emulation for IDE ATAPI devices > Vendor: MITBISHI Model: LS-120 SLIM 05 Rev: 0015 > Type: Direct-Access ANSI SCSI revision: 00 > Vendor: MATSHITA Model: DVD-ROM SR-8171 Rev: 059d > Type: CD-ROM ANSI SCSI revision: 02 > Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0 > sda : READ CAPACITY failed. > sda : status = 0, message = 00, host = 0, driver = 28 > Current sd00:00: sense key Not Ready > Additional sense indicates Medium not present > sda : block size assumed to be 512 bytes, disk size 1GB. > /dev/scsi/host0/bus0/target0/lun0: I/O error: dev 08:00, sector 0 > I/O error: dev 08:00, sector 0 > I/O error: dev 08:00, sector 2097144 > I/O error: dev 08:00, sector 2097144 > I/O error: dev 08:00, sector 0 > I/O error: dev 08:00, sector 0 > ldm_validate_partition_table(): Disk read failed.
So it confirms my guess, the problem is caused by sd driver together with a bug in ide-scsi in new kernel that makes ide-floppy devices appear as SCSI ... Here is the patch to sd.c that - sets size of media to 0 if no media is found (that stops kernel from attempting to read media to find partition type) - shuts up messages for this case (as it happens very often and automatically under devfs, messages are quite annoying). I'd like to ask you opinion if it should be so or it should still output a line about "Media not present" Here is the second patch for ppa.c that shuts up this cable warning that fills up my logs (and if you use supermount you have almost _only_ those cable warnings). It adds modules parameter no_cable_warning to supress it. Again the question is should I supress even more messages? I personally would like to do it as again, ppa is attempted to be loaded on many devfs lookups which is quite annoying. Please test them, if it OK they go to our kernel guys (not in this form). -andrey PS Please Cc to me on replies. I do read cooker but off the web so ...
--- /usr/src/linux-2.4.21-0.pre3.1mdk/drivers/scsi/sd.c 2003-01-16 19:18:11.000000000 +0300 +++ linux-2.4.21-0.pre3.1mdk/drivers/scsi/sd.c 2003-01-21 21:29:55.000000000 +0300 @@ -867,8 +867,9 @@ if( the_result != 0 && ((driver_byte(the_result) & DRIVER_SENSE) != 0) && SRpnt->sr_sense_buffer[2] == UNIT_ATTENTION + && SRpnt->sr_sense_buffer[7] >= 6 && SRpnt->sr_sense_buffer[12] == 0x3A ) { - rscsi_disks[i].capacity = 0x1fffff; + rscsi_disks[i].capacity = 0; sector_size = 512; rscsi_disks[i].device->changed = 1; rscsi_disks[i].ready = 0; @@ -950,29 +951,40 @@ */ if (the_result) { - printk("%s : READ CAPACITY failed.\n" - "%s : status = %x, message = %02x, host = %d, driver = %02x \n", - nbuff, nbuff, - status_byte(the_result), - msg_byte(the_result), - host_byte(the_result), - driver_byte(the_result) - ); - if (driver_byte(the_result) & DRIVER_SENSE) - print_req_sense("sd", SRpnt); - else - printk("%s : sense not available. \n", nbuff); - - printk("%s : block size assumed to be 512 bytes, disk size 1GB. \n", - nbuff); - rscsi_disks[i].capacity = 0x1fffff; - sector_size = 512; - - /* Set dirty bit for removable devices if not ready - - * sometimes drives will not report this properly. */ - if (rscsi_disks[i].device->removable && - SRpnt->sr_sense_buffer[2] == NOT_READY) + if (rscsi_disks[i].device->removable + && ((driver_byte(the_result) & DRIVER_SENSE) != 0) + && SRpnt->sr_sense_buffer[2] == NOT_READY + && SRpnt->sr_sense_buffer[7] >= 6 + && SRpnt->sr_sense_buffer[12] == 0x3A ) { + rscsi_disks[i].capacity = 0; + sector_size = 512; rscsi_disks[i].device->changed = 1; + rscsi_disks[i].ready = 0; + } else { + printk("%s : READ CAPACITY failed.\n" + "%s : status = %x, message = %02x, host = %d, driver = +%02x \n", + nbuff, nbuff, + status_byte(the_result), + msg_byte(the_result), + host_byte(the_result), + driver_byte(the_result) + ); + if (driver_byte(the_result) & DRIVER_SENSE) + print_req_sense("sd", SRpnt); + else + printk("%s : sense not available. \n", nbuff); + + printk("%s : block size assumed to be 512 bytes, disk size +1GB. \n", + nbuff); + rscsi_disks[i].capacity = 0x1fffff; + sector_size = 512; + + /* Set dirty bit for removable devices if not ready - + * sometimes drives will not report this properly. */ + if (rscsi_disks[i].device->removable && + SRpnt->sr_sense_buffer[2] == NOT_READY) + rscsi_disks[i].device->changed = 1; + } } else { /*
--- /usr/src/linux-2.4.21-0.pre3.1mdk/drivers/scsi/ppa.c 2002-11-29 02:53:14.000000000 +0300 +++ linux-2.4.21-0.pre3.1mdk/drivers/scsi/ppa.c 2003-01-21 22:15:44.000000000 +0300 @@ -23,6 +23,8 @@ int ppa_release(struct Scsi_Host *); static void ppa_reset_pulse(unsigned int base); +static int no_cable_warning; + typedef struct { struct pardevice *dev; /* Parport device entry */ int base; /* Actual port address */ @@ -217,12 +219,14 @@ } if (nhosts == 0) { if (try_again == 1) { - printk("WARNING - no ppa compatible devices found.\n"); - printk(" As of 31/Aug/1998 Iomega started shipping parallel\n"); - printk(" port ZIP drives with a different interface which is\n"); - printk(" supported by the imm (ZIP Plus) driver. If the\n"); - printk(" cable is marked with \"AutoDetect\", this is what has\n"); - printk(" happened.\n"); + if (!no_cable_warning) { + printk("WARNING - no ppa compatible devices found.\n"); + printk(" As of 31/Aug/1998 Iomega started shipping parallel\n"); + printk(" port ZIP drives with a different interface which is\n"); + printk(" supported by the imm (ZIP Plus) driver. If the\n"); + printk(" cable is marked with \"AutoDetect\", this is what has\n"); + printk(" happened.\n"); + } spin_lock_irq(&io_request_lock); return 0; } @@ -1146,3 +1150,17 @@ return 1; } MODULE_LICENSE("GPL"); +MODULE_PARM(no_cable_warning, "i"); +MODULE_PARM_DESC(no_cable_warning, "Supress annoying cable warning"); + +#ifndef MODULE +static int __init ppa_setup(char *str) +{ + if (!strcmp(str, "no_cable_warning")) + no_cable_warning = 1; + + return 1; +} + +__setup("ppa=", ppa_setup); +#endif