lkml.org 
[lkml]   [2003]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patches in this message
    /
    Date
    From
    SubjectPATCH:ide_do_reset() fix for 2.5.66
    Hi Alan,
    I found just changing ide_do_reset() to wait till completion can
    handle the handler race. can this be enough?

    regards
    rain.w


    --- /usr/src/linux/drivers/ide/ide-iops.c Thu Apr 3 14:13:51 2003
    +++ ide-iops.c Thu Apr 3 14:29:47 2003
    @@ -1107,6 +1107,10 @@
    }
    /* done polling */
    hwgroup->poll_timeout = 0;
    +
    + /* tell ide_do_reset it complete */
    + complete((struct completion *)hwif->hwif_data);
    +
    return ide_stopped;
    }

    @@ -1171,6 +1175,10 @@
    }
    }
    hwgroup->poll_timeout = 0; /* done polling */
    +
    + /* tell ide_do_reset it complete */
    + complete((struct completion *)hwif->hwif_data);
    +
    return ide_stopped;
    }

    @@ -1307,7 +1315,27 @@

    ide_startstop_t ide_do_reset (ide_drive_t *drive)
    {
    - return do_reset1(drive, 0);
    + /*
    + * Waiting for completion needed.
    + */
    + unsigned long flags;
    + ide_hwif_t *hwif;
    + void *old_data;
    + DECLARE_COMPLETION(wait);
    +
    + spin_lock_irqsave(&ide_lock, flags);
    + hwif = HWIF(drive);
    +
    + old_data = hwif->hwif_data;
    + hwif->hwif_data = &wait;
    +
    + (void) do_reset1(drive, 0);
    +
    + wait_for_completion(&wait);
    +
    + hwif->hwif_data = old_data;
    + spin_unlock_irqrestore(&ide_lock, flags);
    + return ide_stopped;
    }

    EXPORT_SYMBOL(ide_do_reset);--- /usr/src/linux/drivers/ide/ide.c Tue Apr 1 17:26:45 2003
    +++ ide.c Thu Apr 3 14:31:38 2003
    @@ -1586,8 +1586,6 @@
    spin_lock_irqsave(&ide_lock, flags);

    DRIVER(drive)->abort(drive, "drive reset");
    - if(HWGROUP(drive)->handler)
    - BUG();

    /* Ensure nothing gets queued after we
    drop the lock. Reset will clear the busy */
    \
     
     \ /
      Last update: 2005-03-22 13:34    [W:9.464 / U:2.212 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site