aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h35
1 files changed, 6 insertions, 29 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 8b74ccdd221c..00df155b5a02 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -828,6 +828,7 @@ typedef struct hwif_s {
828 828
829 unsigned present : 1; /* this interface exists */ 829 unsigned present : 1; /* this interface exists */
830 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 830 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
831 unsigned busy : 1; /* serializes devices on a port */
831 832
832 struct device gendev; 833 struct device gendev;
833 struct device *portdev; 834 struct device *portdev;
@@ -851,8 +852,13 @@ struct ide_host {
851 unsigned long host_flags; 852 unsigned long host_flags;
852 void *host_priv; 853 void *host_priv;
853 ide_hwif_t *cur_port; /* for hosts requiring serialization */ 854 ide_hwif_t *cur_port; /* for hosts requiring serialization */
855
856 /* used for hosts requiring serialization */
857 volatile long host_busy;
854}; 858};
855 859
860#define IDE_HOST_BUSY 0
861
856/* 862/*
857 * internal ide interrupt handler type 863 * internal ide interrupt handler type
858 */ 864 */
@@ -866,8 +872,6 @@ typedef struct hwgroup_s {
866 /* irq handler, if active */ 872 /* irq handler, if active */
867 ide_startstop_t (*handler)(ide_drive_t *); 873 ide_startstop_t (*handler)(ide_drive_t *);
868 874
869 /* BOOL: protects all fields below */
870 volatile int busy;
871 /* BOOL: polling active & poll_timeout field valid */ 875 /* BOOL: polling active & poll_timeout field valid */
872 unsigned int polling : 1; 876 unsigned int polling : 1;
873 877
@@ -1271,26 +1275,6 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
1271 1275
1272extern void ide_timer_expiry(unsigned long); 1276extern void ide_timer_expiry(unsigned long);
1273extern irqreturn_t ide_intr(int irq, void *dev_id); 1277extern irqreturn_t ide_intr(int irq, void *dev_id);
1274
1275static inline int ide_lock_hwgroup(ide_hwgroup_t *hwgroup, ide_hwif_t *hwif)
1276{
1277 if (hwgroup->busy)
1278 return 1;
1279
1280 hwgroup->busy = 1;
1281 /* for atari only */
1282 ide_get_lock(ide_intr, hwif);
1283
1284 return 0;
1285}
1286
1287static inline void ide_unlock_hwgroup(ide_hwgroup_t *hwgroup)
1288{
1289 /* for atari only */
1290 ide_release_lock();
1291 hwgroup->busy = 0;
1292}
1293
1294extern void do_ide_request(struct request_queue *); 1278extern void do_ide_request(struct request_queue *);
1295 1279
1296void ide_init_disk(struct gendisk *, ide_drive_t *); 1280void ide_init_disk(struct gendisk *, ide_drive_t *);
@@ -1617,13 +1601,6 @@ static inline void ide_set_max_pio(ide_drive_t *drive)
1617 1601
1618extern spinlock_t ide_lock; 1602extern spinlock_t ide_lock;
1619extern struct mutex ide_cfg_mtx; 1603extern struct mutex ide_cfg_mtx;
1620/*
1621 * Structure locking:
1622 *
1623 * ide_hwgroup_t->busy: hwgroup->lock
1624 * ide_hwif_t->{hwgroup,mate}: constant, no locking
1625 * ide_drive_t->hwif: constant, no locking
1626 */
1627 1604
1628#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) 1605#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0)
1629 1606