-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolling-io-7-of-7.patch
174 lines (158 loc) · 5.05 KB
/
polling-io-7-of-7.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
From [email protected] Mon Mar 7 19:28:03 2005
Date: Mon, 7 Mar 2005 19:28:03 -0800
From: Jason Uhlenkott <[email protected]>
Subject: [PATCH 7/7] Polling I/O: fusion support
Message-ID: <[email protected]>
References: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[email protected]>
User-Agent: Mutt/1.5.6i
Status: RO
Content-Length: 4622
Lines: 157
Polling I/O support for LSI Logic Fusion MPT.
Index: linux/drivers/message/fusion/mptscsih.c
===================================================================
--- linux.orig/drivers/message/fusion/mptscsih.c 2005-03-07 17:48:57.856843063 -0800
+++ linux/drivers/message/fusion/mptscsih.c 2005-03-07 17:49:11.494653458 -0800
@@ -2366,7 +2366,7 @@
/* If our attempts to reset the host failed, then return a failed
* status. The host will be taken off line by the SCSI mid-layer.
*/
- spin_unlock_irq(host_lock);
+ MPT_HOST_UNLOCK(host_lock);
if (mpt_HardResetHandler(hd->ioc, CAN_SLEEP) < 0){
status = FAILED;
} else {
@@ -2376,7 +2376,7 @@
hd->tmPending = 0;
hd->tmState = TM_STATE_NONE;
}
- spin_lock_irq(host_lock);
+ MPT_HOST_LOCK(host_lock);
dtmprintk( ( KERN_WARNING MYNAM ": mptscsih_host_reset: "
@@ -2698,6 +2698,27 @@
}
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ * OS entry point to poll whether the adapter has raised an interrupt,
+ * and if so, handle it. Called repeatedly after I/O commands are
+ * issued to this adapter.
+ */
+void
+mptscsih_poll(struct scsi_device *sdev)
+{
+ MPT_SCSI_HOST *hd;
+
+ hd = (MPT_SCSI_HOST *) sdev->host->hostdata;
+ if (!hd)
+ return;
+
+ /* check interrupt pending */
+ mpt_poll_interrupt(hd->ioc);
+}
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+
+
/*
* OS entry point to adjust the queue_depths on a per-device basis.
* Called once per device the bus scan. Use it to force the queue_depth
@@ -3142,6 +3163,7 @@
.cmd_per_lun = 7,
.use_clustering = ENABLE_CLUSTERING,
.sdev_attrs = mptscsih_dev_attrs,
+ .dump_poll = mptscsih_poll,
};
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -4590,6 +4612,9 @@
}
spin_unlock_irqrestore(&dvtaskQ_lock, flags);
+ if (crashdump_mode())
+ return;
+
/* For this ioc, loop through all devices and do dv to each device.
* When complete with this ioc, search through the ioc list, and
* for each scsi ioc found, do dv for all devices. Exit when no
Index: linux/drivers/message/fusion/mptbase.c
===================================================================
--- linux.orig/drivers/message/fusion/mptbase.c 2005-03-07 17:48:57.857819633 -0800
+++ linux/drivers/message/fusion/mptbase.c 2005-03-07 17:49:11.505395736 -0800
@@ -3088,7 +3088,7 @@
*
*/
CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_DISABLE_ARM);
- mdelay (1);
+ MPT_MDELAY (1);
/*
* Now hit the reset bit in the Diagnostic register
@@ -5833,6 +5833,23 @@
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/**
+ * mpt_poll_interrupt - Check if the adapter has raised an interrupt and
+ * if so, call the interrupt handler.
+ * @ioc: Pointer to MPT_ADAPTER structure
+ */
+void
+mpt_poll_interrupt(MPT_ADAPTER *ioc)
+{
+ u32 intstat;
+
+ intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
+
+ if (intstat & MPI_HIS_REPLY_MESSAGE_INTERRUPT)
+ mpt_interrupt(0, ioc, NULL);
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
EXPORT_SYMBOL(ioc_list);
EXPORT_SYMBOL(mpt_proc_root_dir);
EXPORT_SYMBOL(mpt_register);
@@ -5942,6 +5959,7 @@
#endif
}
+EXPORT_SYMBOL_GPL(mpt_poll_interrupt);
module_init(fusion_init);
module_exit(fusion_exit);
Index: linux/drivers/message/fusion/mptbase.h
===================================================================
--- linux.orig/drivers/message/fusion/mptbase.h 2005-03-07 17:48:57.857819633 -0800
+++ linux/drivers/message/fusion/mptbase.h 2005-03-07 17:49:11.512231731 -0800
@@ -961,6 +961,7 @@
extern void mpt_free_fw_memory(MPT_ADAPTER *ioc);
extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc);
+extern void mpt_poll_interrupt(MPT_ADAPTER *ioc);
/*
* Public data decl's...
@@ -971,6 +972,29 @@
extern int mpt_lan_index; /* needed by mptlan.c */
extern int mpt_stm_index; /* needed by mptstm.c */
+/*
+ * Dump stuff...
+ */
+#include <linux/diskdump.h>
+
+#define MPT_HOST_LOCK(host_lock) \
+ if (crashdump_mode()) \
+ spin_lock(host_lock); \
+ else \
+ spin_lock_irq(host_lock);
+
+#define MPT_HOST_UNLOCK(host_lock) \
+ if (crashdump_mode()) \
+ spin_unlock(host_lock); \
+ else \
+ spin_unlock_irq(host_lock);
+
+#define MPT_MDELAY(n) \
+ if (crashdump_mode()) \
+ diskdump_mdelay(n); \
+ else \
+ mdelay(n);
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* } __KERNEL__ */