Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42785
b: refs/heads/master
c: 9a2239b
h: refs/heads/master
i:
  42783: ba7bbc3
v: v3
  • Loading branch information
Peter Zijlstra authored and Linus Torvalds committed Dec 7, 2006
1 parent 36349d6 commit e769da0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23a1b2a78705caa2ecaccf8422a1e22eaca59574
refs/heads/master: 9a2239b1174bdf0952a21ed328cd74240d2dd173
19 changes: 15 additions & 4 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,8 @@ ide_settings_t *ide_find_setting_by_name (ide_drive_t *drive, char *name)
* @drive: drive
*
* Automatically remove all the driver specific settings for this
* drive. This function may sleep and must not be called from IRQ
* context. The caller must hold ide_setting_sem.
* drive. This function may not be called from IRQ context. The
* caller must hold ide_setting_sem.
*/

static void auto_remove_settings (ide_drive_t *drive)
Expand Down Expand Up @@ -1874,11 +1874,22 @@ void ide_unregister_subdriver(ide_drive_t *drive, ide_driver_t *driver)
{
unsigned long flags;

down(&ide_setting_sem);
spin_lock_irqsave(&ide_lock, flags);
#ifdef CONFIG_PROC_FS
ide_remove_proc_entries(drive->proc, driver->proc);
#endif
down(&ide_setting_sem);
spin_lock_irqsave(&ide_lock, flags);
/*
* ide_setting_sem protects the settings list
* ide_lock protects the use of settings
*
* so we need to hold both, ide_settings_sem because we want to
* modify the settings list, and ide_lock because we cannot take
* a setting out that is being used.
*
* OTOH both ide_{read,write}_setting are only ever used under
* ide_setting_sem.
*/
auto_remove_settings(drive);
spin_unlock_irqrestore(&ide_lock, flags);
up(&ide_setting_sem);
Expand Down

0 comments on commit e769da0

Please sign in to comment.