diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-12-29 14:27:31 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-12-29 14:27:31 -0500 |
commit | 2a2ca6a96194c4744a2adeefbc09ce881f3c5abe (patch) | |
tree | 50b43d823d4a589fbfb8f8751278d6101cd3ecf3 /include/linux/ide.h | |
parent | 6ea52226ca131a99bb619bd56fbeee566ea5a966 (diff) |
ide: replace the global ide_lock spinlock by per-hwgroup spinlocks (v2)
Now that (almost) all host drivers have been fixed not to abuse ide_lock
and core code usage of ide_lock has been sanitized we may safely replace
ide_lock by per-hwgroup locks.
This patch is partially based on earlier patch from Ravikiran G Thirumalai.
While at it:
- don't use deprecated HWIF() and HWGROUP() macros
- update locking documentation in ide.h
v2:
Add missing spin_lock_init(&hwgroup->lock). (Noticed by Elias Oltmanns)
Cc: Vaibhav V. Nivargi <vaibhav.nivargi@gmail.com>
Cc: Alok N. Kataria <alokk@calsoftinc.com>
Cc: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Cc: Elias Oltmanns <eo@nebensachen.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 010fb26a1579..c871d325cedb 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -909,6 +909,8 @@ typedef struct hwgroup_s { | |||
909 | 909 | ||
910 | int req_gen; | 910 | int req_gen; |
911 | int req_gen_timer; | 911 | int req_gen_timer; |
912 | |||
913 | spinlock_t lock; | ||
912 | } ide_hwgroup_t; | 914 | } ide_hwgroup_t; |
913 | 915 | ||
914 | typedef struct ide_driver_s ide_driver_t; | 916 | typedef struct ide_driver_s ide_driver_t; |
@@ -1610,13 +1612,13 @@ extern struct mutex ide_cfg_mtx; | |||
1610 | /* | 1612 | /* |
1611 | * Structure locking: | 1613 | * Structure locking: |
1612 | * | 1614 | * |
1613 | * ide_cfg_mtx and ide_lock together protect changes to | 1615 | * ide_cfg_mtx and hwgroup->lock together protect changes to |
1614 | * ide_hwif_t->{next,hwgroup} | 1616 | * ide_hwif_t->next |
1615 | * ide_drive_t->next | 1617 | * ide_drive_t->next |
1616 | * | 1618 | * |
1617 | * ide_hwgroup_t->busy: ide_lock | 1619 | * ide_hwgroup_t->busy: hwgroup->lock |
1618 | * ide_hwgroup_t->hwif: ide_lock | 1620 | * ide_hwgroup_t->hwif: hwgroup->lock |
1619 | * ide_hwif_t->mate: constant, no locking | 1621 | * ide_hwif_t->{hwgroup,mate}: constant, no locking |
1620 | * ide_drive_t->hwif: constant, no locking | 1622 | * ide_drive_t->hwif: constant, no locking |
1621 | */ | 1623 | */ |
1622 | 1624 | ||