Commit 9ca3fc76 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] add __ide_set_handler to fix abort race

parent 61b9de84
...@@ -999,13 +999,11 @@ EXPORT_SYMBOL(ide_config_drive_speed); ...@@ -999,13 +999,11 @@ EXPORT_SYMBOL(ide_config_drive_speed);
* *
* See also ide_execute_command * See also ide_execute_command
*/ */
void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
unsigned int timeout, ide_expiry_t *expiry) unsigned int timeout, ide_expiry_t *expiry)
{ {
unsigned long flags;
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
spin_lock_irqsave(&ide_lock, flags);
if (hwgroup->handler != NULL) { if (hwgroup->handler != NULL) {
printk(KERN_CRIT "%s: ide_set_handler: handler not null; " printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
"old=%p, new=%p\n", "old=%p, new=%p\n",
...@@ -1015,11 +1013,21 @@ void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, ...@@ -1015,11 +1013,21 @@ void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
hwgroup->expiry = expiry; hwgroup->expiry = expiry;
hwgroup->timer.expires = jiffies + timeout; hwgroup->timer.expires = jiffies + timeout;
add_timer(&hwgroup->timer); add_timer(&hwgroup->timer);
}
EXPORT_SYMBOL(__ide_set_handler);
void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
unsigned int timeout, ide_expiry_t *expiry)
{
unsigned long flags;
spin_lock_irqsave(&ide_lock, flags);
__ide_set_handler(drive, handler, timeout, expiry);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
} }
EXPORT_SYMBOL(ide_set_handler); EXPORT_SYMBOL(ide_set_handler);
/** /**
* ide_execute_command - execute an IDE command * ide_execute_command - execute an IDE command
* @drive: IDE drive to issue the command against * @drive: IDE drive to issue the command against
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment