[PATCH 3/7] ide: __ide_port_unregister_devices() doesn't need an ide_lock held

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bartlomiej Zolnierkiewicz
Date: Wednesday, October 8, 2008 - 1:29 pm

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: __ide_port_unregister_devices() doesn't need an ide_lock held

[ and ide_cfg_mtx mutex provides a sufficient protection for callers ]

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide.c |    7 -------
 1 file changed, 7 deletions(-)

Index: b/drivers/ide/ide.c
===================================================================
--- a/drivers/ide/ide.c	2008-09-17 22:17:58.000000000 -0700
+++ b/drivers/ide/ide.c	2008-09-17 22:20:15.000000000 -0700
@@ -130,7 +130,6 @@
 	}
 }
 
-/* Called with ide_lock held. */
 static void __ide_port_unregister_devices(ide_hwif_t *hwif)
 {
 	int i;
@@ -139,10 +138,8 @@
 		ide_drive_t *drive = &hwif->drives[i];
 
 		if (drive->dev_flags & IDE_DFLAG_PRESENT) {
-			spin_unlock_irq(&ide_lock);
 			device_unregister(&drive->gendev);
 			wait_for_completion(&drive->gendev_rel_comp);
-			spin_lock_irq(&ide_lock);
 		}
 	}
 }
@@ -150,11 +147,9 @@
 void ide_port_unregister_devices(ide_hwif_t *hwif)
 {
 	mutex_lock(&ide_cfg_mtx);
-	spin_lock_irq(&ide_lock);
 	__ide_port_unregister_devices(hwif);
 	hwif->present = 0;
 	ide_port_init_devices_data(hwif);
-	spin_unlock_irq(&ide_lock);
 	mutex_unlock(&ide_cfg_mtx);
 }
 EXPORT_SYMBOL_GPL(ide_port_unregister_devices);
@@ -192,12 +187,10 @@
 
 	mutex_lock(&ide_cfg_mtx);
 
-	spin_lock_irq(&ide_lock);
 	if (hwif->present) {
 		__ide_port_unregister_devices(hwif);
 		hwif->present = 0;
 	}
-	spin_unlock_irq(&ide_lock);
 
 	ide_proc_unregister_port(hwif);
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/7] ide: locking improvements, Bartlomiej Zolnierki ..., (Wed Oct 8, 1:29 pm)
[PATCH 1/7] ide: unify ide_intr()'s exit points, Bartlomiej Zolnierki ..., (Wed Oct 8, 1:29 pm)
[PATCH 2/7] ide: IDE settings don't need an ide_lock held, Bartlomiej Zolnierki ..., (Wed Oct 8, 1:29 pm)
[PATCH 3/7] ide: __ide_port_unregister_devices() doesn't n ..., Bartlomiej Zolnierki ..., (Wed Oct 8, 1:29 pm)
[PATCH 4/7] ide: ide_hwgroup_t.rq doesn't need an ide_lock ..., Bartlomiej Zolnierki ..., (Wed Oct 8, 1:30 pm)
[PATCH 5/7] ide: push ide_lock to __ide_end_request(), Bartlomiej Zolnierki ..., (Wed Oct 8, 1:30 pm)
[PATCH 6/7] ide: ide_lock + __blk_end_request() -&gt; blk_end ..., Bartlomiej Zolnierki ..., (Wed Oct 8, 1:30 pm)
[PATCH 7/7] ide: use queue lock instead of ide_lock when p ..., Bartlomiej Zolnierki ..., (Wed Oct 8, 1:30 pm)
Re: [PATCH 0/7] ide: locking improvements, Jens Axboe, (Wed Oct 8, 11:51 pm)
Re: [PATCH 0/7] ide: locking improvements, Bartlomiej Zolnierki ..., (Thu Oct 9, 1:36 am)
Re: [PATCH 0/7] ide: locking improvements, Jens Axboe, (Thu Oct 9, 1:40 am)