]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-floppy.c
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-floppy.c
index c949e98df4b6da35da013d26ddb1b2d979cb36b4..e83f54d37f9668625d95649f766d4fe74e2741e7 100644 (file)
@@ -317,7 +317,7 @@ typedef struct ide_floppy_obj {
        unsigned long flags;
 } idefloppy_floppy_t;
 
-#define IDEFLOPPY_TICKS_DELAY  3       /* default delay for ZIP 100 */
+#define IDEFLOPPY_TICKS_DELAY  HZ/20   /* default delay for ZIP 100 (50ms) */
 
 /*
  *     Floppy flag bits values.
@@ -661,10 +661,12 @@ static void idefloppy_output_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, un
 
        idefloppy_do_end_request(drive, 1, done >> 9);
 
+#if IDEFLOPPY_DEBUG_BUGS
        if (bcount) {
                printk(KERN_ERR "%s: leftover data in idefloppy_output_buffers, bcount == %d\n", drive->name, bcount);
                idefloppy_write_zeros(drive, bcount);
        }
+#endif
 }
 
 static void idefloppy_update_buffers (ide_drive_t *drive, idefloppy_pc_t *pc)
@@ -1048,6 +1050,9 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
        atapi_bcount_t bcount;
        ide_handler_t *pkt_xfer_routine;
 
+#if 0 /* Accessing floppy->pc is not valid here, the previous pc may be gone
+         and have lived on another thread's stack; that stack may have become
+         unmapped meanwhile (CONFIG_DEBUG_PAGEALLOC). */
 #if IDEFLOPPY_DEBUG_BUGS
        if (floppy->pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD &&
            pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD) {
@@ -1055,6 +1060,7 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *p
                        "Two request sense in serial were issued\n");
        }
 #endif /* IDEFLOPPY_DEBUG_BUGS */
+#endif
 
        if (floppy->failed_pc == NULL &&
            pc->c[0] != IDEFLOPPY_REQUEST_SENSE_CMD)
@@ -2140,7 +2146,7 @@ static int ide_floppy_probe(struct device *dev)
                printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
                goto failed;
        }
-       if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
+       if ((floppy = (idefloppy_floppy_t *) kzalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
                printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
                goto failed;
        }
@@ -2153,8 +2159,6 @@ static int ide_floppy_probe(struct device *dev)
 
        ide_register_subdriver(drive, &idefloppy_driver);
 
-       memset(floppy, 0, sizeof(*floppy));
-
        kref_init(&floppy->kref);
 
        floppy->drive = drive;