aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2009-05-29 07:09:06 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-09 18:22:08 -0400
commitfd76175a7d3abf4d14df17f5f4c7e68b466b455d (patch)
tree7bbf8c68103d3501b428747e63871d5756933484
parent7b5a65b9e649dad9cf9c6d282df4162843070351 (diff)
[SCSI] mpt fusion: Optimized SendEvent notification Using Doorbell instead FIFO
SendEventNotification was handled through FIFO, now it is using doorbell to communicate with hardware. Added Sleep Flag as an extra argument to support Can-Sleep feature. Resending patch including compilation error fix reviewed by Grant Grundler. Signed-off-by: Kashyap Desai <kadesai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/message/fusion/mptbase.c76
1 files changed, 42 insertions, 34 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 54326e09629c..0d2fb0eb34b9 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -192,7 +192,8 @@ static void mpt_read_ioc_pg_1(MPT_ADAPTER *ioc);
192static void mpt_read_ioc_pg_4(MPT_ADAPTER *ioc); 192static void mpt_read_ioc_pg_4(MPT_ADAPTER *ioc);
193static void mpt_timer_expired(unsigned long data); 193static void mpt_timer_expired(unsigned long data);
194static void mpt_get_manufacturing_pg_0(MPT_ADAPTER *ioc); 194static void mpt_get_manufacturing_pg_0(MPT_ADAPTER *ioc);
195static int SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch); 195static int SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch,
196 int sleepFlag);
196static int SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp); 197static int SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp);
197static int mpt_host_page_access_control(MPT_ADAPTER *ioc, u8 access_control_value, int sleepFlag); 198static int mpt_host_page_access_control(MPT_ADAPTER *ioc, u8 access_control_value, int sleepFlag);
198static int mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init); 199static int mpt_host_page_alloc(MPT_ADAPTER *ioc, pIOCInit_t ioc_init);
@@ -208,7 +209,8 @@ static int procmpt_iocinfo_read(char *buf, char **start, off_t offset,
208static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc); 209static void mpt_get_fw_exp_ver(char *buf, MPT_ADAPTER *ioc);
209 210
210//int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag); 211//int mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag);
211static int ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers); 212static int ProcessEventNotification(MPT_ADAPTER *ioc,
213 EventNotificationReply_t *evReply, int *evHandlers);
212static void mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf); 214static void mpt_iocstatus_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf);
213static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info); 215static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
214static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info); 216static void mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info);
@@ -2472,28 +2474,36 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
2472 } 2474 }
2473 } 2475 }
2474 2476
2477 /* Enable MPT base driver management of EventNotification
2478 * and EventAck handling.
2479 */
2480 if ((ret == 0) && (!ioc->facts.EventState)) {
2481 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT
2482 "SendEventNotification\n",
2483 ioc->name));
2484 ret = SendEventNotification(ioc, 1, sleepFlag); /* 1=Enable */
2485 }
2486
2487 if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState)
2488 rc = SendEventNotification(ioc->alt_ioc, 1, sleepFlag);
2489
2475 if (ret == 0) { 2490 if (ret == 0) {
2476 /* Enable! (reply interrupt) */ 2491 /* Enable! (reply interrupt) */
2477 CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM); 2492 CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
2478 ioc->active = 1; 2493 ioc->active = 1;
2479 } 2494 }
2480 2495 if (rc == 0) { /* alt ioc */
2481 if (reset_alt_ioc_active && ioc->alt_ioc) { 2496 if (reset_alt_ioc_active && ioc->alt_ioc) {
2482 /* (re)Enable alt-IOC! (reply interrupt) */ 2497 /* (re)Enable alt-IOC! (reply interrupt) */
2483 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "alt_ioc reply irq re-enabled\n", 2498 dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "alt-ioc"
2484 ioc->alt_ioc->name)); 2499 "reply irq re-enabled\n",
2485 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask, MPI_HIM_DIM); 2500 ioc->alt_ioc->name));
2486 ioc->alt_ioc->active = 1; 2501 CHIPREG_WRITE32(&ioc->alt_ioc->chip->IntMask,
2502 MPI_HIM_DIM);
2503 ioc->alt_ioc->active = 1;
2504 }
2487 } 2505 }
2488 2506
2489 /* Enable MPT base driver management of EventNotification
2490 * and EventAck handling.
2491 */
2492 if ((ret == 0) && (!ioc->facts.EventState))
2493 (void) SendEventNotification(ioc, 1); /* 1=Enable EventNotification */
2494
2495 if (ioc->alt_ioc && alt_ioc_ready && !ioc->alt_ioc->facts.EventState)
2496 (void) SendEventNotification(ioc->alt_ioc, 1); /* 1=Enable EventNotification */
2497 2507
2498 /* Add additional "reason" check before call to GetLanConfigPages 2508 /* Add additional "reason" check before call to GetLanConfigPages
2499 * (combined with GetIoUnitPage2 call). This prevents a somewhat 2509 * (combined with GetIoUnitPage2 call). This prevents a somewhat
@@ -6019,30 +6029,28 @@ mpt_get_manufacturing_pg_0(MPT_ADAPTER *ioc)
6019 * SendEventNotification - Send EventNotification (on or off) request to adapter 6029 * SendEventNotification - Send EventNotification (on or off) request to adapter
6020 * @ioc: Pointer to MPT_ADAPTER structure 6030 * @ioc: Pointer to MPT_ADAPTER structure
6021 * @EvSwitch: Event switch flags 6031 * @EvSwitch: Event switch flags
6032 * @sleepFlag: Specifies whether the process can sleep
6022 */ 6033 */
6023static int 6034static int
6024SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch) 6035SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch, int sleepFlag)
6025{ 6036{
6026 EventNotification_t *evnp; 6037 EventNotification_t evn;
6038 MPIDefaultReply_t reply_buf;
6027 6039
6028 evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc); 6040 memset(&evn, 0, sizeof(EventNotification_t));
6029 if (evnp == NULL) { 6041 memset(&reply_buf, 0, sizeof(MPIDefaultReply_t));
6030 devtverboseprintk(ioc, printk(MYIOC_s_WARN_FMT "Unable to allocate event request frame!\n",
6031 ioc->name));
6032 return 0;
6033 }
6034 memset(evnp, 0, sizeof(*evnp));
6035
6036 devtverboseprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Sending EventNotification (%d) request %p\n", ioc->name, EvSwitch, evnp));
6037 6042
6038 evnp->Function = MPI_FUNCTION_EVENT_NOTIFICATION; 6043 evn.Function = MPI_FUNCTION_EVENT_NOTIFICATION;
6039 evnp->ChainOffset = 0; 6044 evn.Switch = EvSwitch;
6040 evnp->MsgFlags = 0; 6045 evn.MsgContext = cpu_to_le32(mpt_base_index << 16);
6041 evnp->Switch = EvSwitch;
6042 6046
6043 mpt_put_msg_frame(mpt_base_index, ioc, (MPT_FRAME_HDR *)evnp); 6047 devtverboseprintk(ioc, printk(MYIOC_s_DEBUG_FMT
6048 "Sending EventNotification (%d) request %p\n",
6049 ioc->name, EvSwitch, &evn));
6044 6050
6045 return 0; 6051 return mpt_handshake_req_reply_wait(ioc, sizeof(EventNotification_t),
6052 (u32 *)&evn, sizeof(MPIDefaultReply_t), (u16 *)&reply_buf, 30,
6053 sleepFlag);
6046} 6054}
6047 6055
6048/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6056/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/