diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-09-14 01:34:23 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:48:38 -0400 |
commit | 77e63ed44305e89c0564f8292f9cd5764d4fddfb (patch) | |
tree | 66aab9af95be1daadf6e648b008f9c1d77cf1ac0 /drivers/scsi/mpt2sas/mpt2sas_transport.c | |
parent | 595bb0bd62edb28a965993d90e0fa1285560ce53 (diff) |
[SCSI] mpt2sas: Target Reset will be issued from Interrupt context.
(1) Added three new functions to handle sending target resest and OP_REMOVE
from interrupt time, they are _scsih_tm_tr_send, _scsih_tm_tr_complete, and
_scsih_sas_control_complete. This code will create a link list of pending
target resets if there is no more available request in the hipriority
request queue. The list is stored in ioc->delayed_tr_list.
(2) All callback handler return type is changed from void to u8.
Now _base_interrupt will check for return type of callback handlers to
take decision of message frame is already freed or not.
In genral,
Return 1 meaning mf should be freed from _base_interrupt
0 means the mf is freed from function.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_transport.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_transport.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c index 4b7201a1e867..8bc57e315ce8 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_transport.c +++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c | |||
@@ -218,9 +218,10 @@ _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
218 | * Callback handler when sending internal generated transport cmds. | 218 | * Callback handler when sending internal generated transport cmds. |
219 | * The callback index passed is `ioc->transport_cb_idx` | 219 | * The callback index passed is `ioc->transport_cb_idx` |
220 | * | 220 | * |
221 | * Return nothing. | 221 | * Return 1 meaning mf should be freed from _base_interrupt |
222 | * 0 means the mf is freed from this function. | ||
222 | */ | 223 | */ |
223 | void | 224 | u8 |
224 | mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | 225 | mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
225 | u32 reply) | 226 | u32 reply) |
226 | { | 227 | { |
@@ -228,9 +229,9 @@ mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | |||
228 | 229 | ||
229 | mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply); | 230 | mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply); |
230 | if (ioc->transport_cmds.status == MPT2_CMD_NOT_USED) | 231 | if (ioc->transport_cmds.status == MPT2_CMD_NOT_USED) |
231 | return; | 232 | return 1; |
232 | if (ioc->transport_cmds.smid != smid) | 233 | if (ioc->transport_cmds.smid != smid) |
233 | return; | 234 | return 1; |
234 | ioc->transport_cmds.status |= MPT2_CMD_COMPLETE; | 235 | ioc->transport_cmds.status |= MPT2_CMD_COMPLETE; |
235 | if (mpi_reply) { | 236 | if (mpi_reply) { |
236 | memcpy(ioc->transport_cmds.reply, mpi_reply, | 237 | memcpy(ioc->transport_cmds.reply, mpi_reply, |
@@ -239,6 +240,7 @@ mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | |||
239 | } | 240 | } |
240 | ioc->transport_cmds.status &= ~MPT2_CMD_PENDING; | 241 | ioc->transport_cmds.status &= ~MPT2_CMD_PENDING; |
241 | complete(&ioc->transport_cmds.done); | 242 | complete(&ioc->transport_cmds.done); |
243 | return 1; | ||
242 | } | 244 | } |
243 | 245 | ||
244 | /* report manufacture request structure */ | 246 | /* report manufacture request structure */ |