45 #include <linux/kernel.h>
46 #include <linux/module.h>
47 #include <linux/errno.h>
49 #include <linux/slab.h>
50 #include <linux/types.h>
51 #include <linux/pci.h>
52 #include <linux/kdev_t.h>
59 #include <linux/time.h>
67 #define FAULT_POLLING_INTERVAL 1000
69 #define MAX_HBA_QUEUE_DEPTH 30000
70 #define MAX_CHAIN_DEPTH 100000
75 static int max_sgl_entries = -1;
79 static int msix_disable = -1;
81 MODULE_PARM_DESC(msix_disable,
" disable msix routed interrupts (default=0)");
83 static int missing_delay[2] = {-1, -1};
87 static int mpt2sas_fwfault_debug;
88 MODULE_PARM_DESC(mpt2sas_fwfault_debug,
" enable detection of firmware fault "
89 "and halt firmware - (default=0)");
91 static int disable_discovery = -1;
108 printk(
KERN_INFO "setting fwfault_debug(%d)\n", mpt2sas_fwfault_debug);
124 static
int mpt2sas_remove_dead_ioc_func(
void *
arg)
165 ioc->
name, __func__);
182 "mpt2sas_dead_ioc_%d", ioc->
id);
185 "%s: Running mpt2sas_dead_ioc thread failed !!!!\n",
186 ioc->
name, __func__);
189 "%s: Running mpt2sas_dead_ioc thread success !!!!\n",
190 ioc->
name, __func__);
200 __func__, (rc == 0) ?
"success" :
"failed");
239 ioc->
name, __func__, __LINE__);
285 ioc->
name, fault_code);
313 "timeout\n", ioc->
name);
316 panic(
"panic in %s\n", __func__);
319 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING
336 char *func_str =
NULL;
347 switch (ioc_status) {
354 desc =
"invalid function";
360 desc =
"invalid sgl";
363 desc =
"internal error";
366 desc =
"invalid vpid";
369 desc =
"insufficient resources";
372 desc =
"invalid field";
375 desc =
"invalid state";
378 desc =
"op state not supported";
386 desc =
"config invalid action";
389 desc =
"config invalid type";
392 desc =
"config invalid page";
395 desc =
"config invalid data";
398 desc =
"config no defaults";
401 desc =
"config cant commit";
427 desc =
"eedp guard error";
430 desc =
"eedp ref tag error";
433 desc =
"eedp app tag error";
441 desc =
"target invalid io index";
444 desc =
"target aborted";
447 desc =
"target no conn retryable";
450 desc =
"target no connection";
453 desc =
"target xfer count mismatch";
456 desc =
"target data offset error";
459 desc =
"target too much write data";
462 desc =
"target iu too short";
465 desc =
"target ack nak timeout";
468 desc =
"target nak received";
476 desc =
"smp request failed";
479 desc =
"smp data overrun";
487 desc =
"diagnostic released";
499 func_str =
"config_page";
503 func_str =
"task_mgmt";
507 func_str =
"sas_iounit_ctl";
511 func_str =
"enclosure";
515 func_str =
"ioc_init";
519 func_str =
"port_enable";
523 func_str =
"smp_passthru";
527 func_str =
"unknown";
532 " (%s)\n", ioc->
name, desc, ioc_status, request_hdr, func_str);
561 desc =
"Status Change";
564 desc =
"Hard Reset Received";
567 desc =
"Event Change";
570 desc =
"Device Status Change";
574 desc =
"IR Operation Status";
584 printk(
"discovery_status(0x%08x)",
590 desc =
"SAS Broadcast Primitive";
593 desc =
"SAS Init Device Status Change";
596 desc =
"SAS Init Table Overflow";
599 desc =
"SAS Topology Change List";
602 desc =
"SAS Enclosure Device Status Change";
610 desc =
"IR Physical Disk";
614 desc =
"IR Configuration Change List";
618 desc =
"Log Entry Added";
648 union loginfo_type sas_loginfo;
649 char *originator_str =
NULL;
651 sas_loginfo.loginfo = log_info;
652 if (sas_loginfo.dw.bus_type != 3 )
656 if (log_info == 0x31170000)
661 0x31140000 || log_info == 0x31130000))
664 switch (sas_loginfo.dw.originator) {
666 originator_str =
"IOP";
669 originator_str =
"PL";
673 originator_str =
"IR";
675 originator_str =
"WarpDrive";
680 "code(0x%02x), sub_code(0x%04x)\n", ioc->
name, log_info,
681 originator_str, sas_loginfo.dw.code,
682 sas_loginfo.dw.subcode);
704 ioc->
name, __FILE__, __LINE__, __func__);
708 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING
711 _base_sas_ioc_info(ioc , mpi_reply,
774 #ifdef CONFIG_SCSI_MPT2SAS_LOGGING
775 _base_display_event_data(ioc, mpi_reply);
782 ioc->
name, __func__);
791 ack_request->
VF_ID = 0;
792 ack_request->
VP_ID = 0;
819 if (smid < ioc->hi_priority_smid) {
822 }
else if (smid < ioc->internal_smid) {
825 }
else if (smid <= ioc->hba_queue_depth) {
889 _base_interrupt(
int irq,
void *bus_id)
894 u8 request_desript_type;
906 if (!atomic_add_unless(&reply_q->
busy, 1, 1))
925 if (request_desript_type ==
932 }
else if (request_desript_type ==
935 else if (request_desript_type ==
939 cb_idx = _base_get_cb_idx(ioc, smid);
942 rc = mpt_callbacks[cb_idx](ioc, smid,
945 _base_display_reply_info(ioc, smid,
952 _base_async_event(ioc, msix_index, reply);
956 ioc->reply_free_host_index =
957 (ioc->reply_free_host_index ==
958 (ioc->reply_free_queue_depth - 1)) ?
959 0 : ioc->reply_free_host_index + 1;
960 ioc->reply_free[ioc->reply_free_host_index] =
963 writel(ioc->reply_free_host_index,
964 &ioc->chip->ReplyFreeHostIndex);
972 (ioc->reply_post_queue_depth - 1)) ? 0 :
974 request_desript_type =
988 if (!completed_cmds) {
993 if (ioc->is_warpdrive) {
995 ioc->reply_post_host_index[msix_index]);
1013 return (ioc->
facts.IOCCapabilities &
1036 if (!_base_is_controller_msix_enabled(ioc))
1045 _base_interrupt(reply_q->
vector, (
void *)reply_q);
1058 mpt_callbacks[cb_idx] =
NULL;
1073 if (mpt_callbacks[cb_idx] ==
NULL)
1076 mpt_callbacks[cb_idx] = cb_func;
1154 #define convert_to_kb(x) ((x) << (PAGE_SHIFT - 10))
1172 if ((required_mask >
DMA_BIT_MASK(32)) && !pci_set_dma_mask(pdev,
1173 DMA_BIT_MASK(64)) && !pci_set_consistent_dma_mask(pdev,
1183 && !pci_set_consistent_dma_mask(pdev,
DMA_BIT_MASK(32))) {
1209 u16 message_control;
1215 ioc->
pdev->revision == 0x01) {
1222 "supported\n", ioc->
name));
1237 pci_read_config_word(ioc->
pdev, base + 2, &message_control);
1302 reply_q->
name, vector);
1307 INIT_LIST_HEAD(&reply_q->
list);
1326 int cpu_grouping, loop, grouping, grouping_mod;
1328 if (!_base_is_controller_msix_enabled(ioc))
1338 if (grouping < 2 || (grouping == 2 && !grouping_mod))
1340 else if (grouping < 4 || (grouping == 4 && !grouping_mod))
1342 else if (grouping < 8 || (grouping == 8 && !grouping_mod))
1353 if (!cpu_grouping) {
1358 if (loop < cpu_grouping) {
1402 if (msix_disable == -1 || msix_disable == 0)
1408 if (_base_check_enable_msix(ioc) != 0)
1418 "failed @ at %s:%d/%s() !!!\n", ioc->
name, __FILE__,
1419 __LINE__, __func__));
1429 "failed (r=%d) !!!\n", ioc->
name, r));
1436 r = _base_request_irq(ioc, i, a->vector);
1438 _base_free_irq(ioc);
1439 _base_disable_msix(ioc);
1451 r = _base_request_irq(ioc, 0, ioc->
pdev->irq);
1474 ioc->
name, __func__));
1479 "failed\n", ioc->
name);
1487 "failed\n", ioc->
name);
1497 if (_base_config_dma_addressing(ioc, pdev) != 0) {
1499 ioc->
name, pci_name(pdev));
1521 "adapter memory!\n", ioc->
name);
1529 _base_mask_interrupts(ioc);
1530 r = _base_enable_msix(ioc);
1537 "IO-APIC enabled"), reply_q->
vector);
1540 ioc->
name, (
unsigned long long)chip_phys, ioc->
chip, memap_sz);
1542 ioc->
name, (
unsigned long long)pio_chip, pio_sz);
1624 unsigned long flags;
1632 ioc->
name, __func__);
1639 smid = request->
smid;
1657 unsigned long flags;
1665 ioc->
name, __func__);
1673 smid = request->
smid;
1689 unsigned long flags;
1702 smid = request->
smid;
1719 unsigned long flags;
1724 if (smid < ioc->hi_priority_smid) {
1727 if (!list_empty(&ioc->
scsi_lookup[i].chain_list)) {
1752 }
else if (smid < ioc->internal_smid) {
1758 }
else if (smid <= ioc->hba_queue_depth) {
1783 unsigned long flags;
1788 writel((
u32)(data_out >> 32), (addr + 4));
1789 spin_unlock_irqrestore(writeq_lock, flags);
1792 static inline void _base_writeq(
__u64 b,
volatile void __iomem *addr,
1915 switch (ioc->
pdev->subsystem_device) {
1948 sprintf(dell_branding,
"0x%4X", ioc->
pdev->subsystem_device);
1953 " SSVID(0x%04X), SSDID(0x%04X)\n", ioc->
name, dell_branding,
1954 ioc->
pdev->vendor, ioc->
pdev->device, ioc->
pdev->subsystem_vendor,
1955 ioc->
pdev->subsystem_device);
1970 switch (ioc->
pdev->device) {
1972 switch (ioc->
pdev->subsystem_device) {
1989 switch (ioc->
pdev->subsystem_device) {
2030 switch (ioc->
pdev->device) {
2032 switch (ioc->
pdev->subsystem_device) {
2041 switch (ioc->
pdev->subsystem_device) {
2077 u32 iounit_pg1_flags;
2083 "ChipRevision(0x%02x), BiosVersion(%02d.%02d.%02d.%02d)\n",
2085 (ioc->
facts.FWVersion.Word & 0xFF000000) >> 24,
2086 (ioc->
facts.FWVersion.Word & 0x00FF0000) >> 16,
2087 (ioc->
facts.FWVersion.Word & 0x0000FF00) >> 8,
2088 ioc->
facts.FWVersion.Word & 0x000000FF,
2089 ioc->
pdev->revision,
2090 (bios_version & 0xFF000000) >> 24,
2091 (bios_version & 0x00FF0000) >> 16,
2092 (bios_version & 0x0000FF00) >> 8,
2093 bios_version & 0x000000FF);
2095 _base_display_dell_branding(ioc);
2096 _base_display_intel_branding(ioc);
2097 _base_display_hp_branding(ioc);
2107 printk(
"%sTarget", i ?
"," :
"");
2113 printk(
"Capabilities=(");
2116 if (ioc->
facts.IOCCapabilities &
2124 printk(
"%sTLR", i ?
"," :
"");
2129 printk(
"%sMulticast", i ?
"," :
"");
2133 if (ioc->
facts.IOCCapabilities &
2135 printk(
"%sBIDI Target", i ?
"," :
"");
2140 printk(
"%sEEDP", i ?
"," :
"");
2144 if (ioc->
facts.IOCCapabilities &
2146 printk(
"%sSnapshot Buffer", i ?
"," :
"");
2150 if (ioc->
facts.IOCCapabilities &
2152 printk(
"%sDiag Trace Buffer", i ?
"," :
"");
2156 if (ioc->
facts.IOCCapabilities &
2162 if (ioc->
facts.IOCCapabilities &
2164 printk(
"%sTask Set Full", i ?
"," :
"");
2170 printk(
"%sNCQ", i ?
"," :
"");
2191 u16 device_missing_delay,
u8 io_missing_delay)
2193 u16 dmd, dmd_new, dmd_orignal;
2194 u8 io_missing_delay_original;
2208 if (!sas_iounit_pg1) {
2210 ioc->
name, __FILE__, __LINE__, __func__);
2214 sas_iounit_pg1, sz))) {
2216 ioc->
name, __FILE__, __LINE__, __func__);
2223 ioc->
name, __FILE__, __LINE__, __func__);
2234 if (device_missing_delay > 0x7F) {
2235 dmd = (device_missing_delay > 0x7F0) ? 0x7F0 :
2236 device_missing_delay;
2240 dmd = device_missing_delay;
2249 if (dmd & MPI2_SASIOUNIT1_REPORT_MISSING_UNIT_16)
2256 "new(%d)\n", ioc->
name, dmd_orignal, dmd_new);
2258 "new(%d)\n", ioc->
name, io_missing_delay_original,
2265 kfree(sas_iounit_pg1);
2278 u32 iounit_pg1_flags;
2289 _base_display_ioc_capabilities(ioc);
2296 if ((ioc->
facts.IOCCapabilities &
2366 "reply_post_free_pool(0x%p): free\n", ioc->
name,
2373 "config_page(0x%p): free\n", ioc->
name,
2408 _base_allocate_memory_pools(
struct MPT2SAS_ADAPTER *ioc,
int sleep_flag)
2411 u16 max_sge_elements;
2412 u16 chains_needed_per_io;
2413 u32 sz, total_sz, reply_post_free_sz;
2415 u16 max_request_credit;
2422 facts = &ioc->
facts;
2425 if (max_sgl_entries != -1) {
2426 ioc->
shost->sg_tablesize = (max_sgl_entries <
2472 chains_needed_per_io = ((ioc->
shost->sg_tablesize -
2479 * chains_needed_per_io), ioc->
shost->sg_tablesize);
2504 "sge_in_main_msg(%d), sge_per_chain(%d), sge_per_io(%d), "
2517 "can_queue depth (%d)\n", ioc->
name, ioc->
shost->can_queue));
2535 "failed: hba_depth(%d), chains_per_io(%d), frame_sz(%d), "
2542 goto retry_allocation;
2547 "succeed: hba_depth(%d), chains_per_io(%d), frame_sz(%d), "
2566 "depth(%d), frame_size(%d), pool_size(%d kB)\n", ioc->
name,
2579 "sz(%d)\n", ioc->
name, (
int)sz);
2595 "sz(%d)\n", ioc->
name, (
int)sz);
2602 "failed\n", ioc->
name);
2617 "(%d), frame_size(%d), pool_size(%d kB)\n", ioc->
name,
2644 "depth(%d), start smid(%d)\n", ioc->
name, ioc->
internal,
2664 "sense pool(0x%p): depth(%d), element_size(%d), pool_size"
2690 "(%d), frame_size(%d), pool_size(%d kB)\n", ioc->
name, ioc->
reply,
2699 ioc->
pdev, sz, 16, 0);
2702 "failed\n", ioc->
name);
2709 "failed\n", ioc->
name);
2714 "depth(%d), element_size(%d), pool_size(%d kB)\n", ioc->
name,
2723 if (_base_is_controller_msix_enabled(ioc))
2726 sz = reply_post_free_sz;
2728 ioc->
pdev, sz, 16, 0);
2731 "failed\n", ioc->
name);
2738 "failed\n", ioc->
name);
2743 "(0x%p): depth(%d), element_size(%d), pool_size(%d kB)\n",
2747 "(0x%llx)\n", ioc->
name, (
unsigned long long)
2756 "failed\n", ioc->
name);
2766 ioc->
name, total_sz/1024);
2768 "Max Controller Queue Depth(%d)\n",
2794 return cooked ? sc :
s;
2813 cntdn = (sleep_flag ==
CAN_SLEEP) ? 1000*timeout : 2000*timeout;
2816 if (current_state == ioc_state)
2827 return current_state;
2849 cntdn = (sleep_flag ==
CAN_SLEEP) ? 1000*timeout : 2000*timeout;
2854 "successful count(%d), timeout(%d)\n", ioc->
name,
2855 __func__, count, timeout));
2866 "int_status(%x)!\n", ioc->
name, __func__, count, int_status);
2890 cntdn = (sleep_flag ==
CAN_SLEEP) ? 1000*timeout : 2000*timeout;
2895 "successful count(%d), timeout(%d)\n", ioc->
name,
2896 __func__, count, timeout));
2898 }
else if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) {
2900 if ((doorbell & MPI2_IOC_STATE_MASK) ==
2905 }
else if (int_status == 0xFFFFFFFF)
2917 "int_status(%x)!\n", ioc->
name, __func__, count, int_status);
2931 _base_wait_for_doorbell_not_used(
struct MPT2SAS_ADAPTER *ioc,
int timeout,
2938 cntdn = (sleep_flag ==
CAN_SLEEP) ? 1000*timeout : 2000*timeout;
2943 "successful count(%d), timeout(%d)\n", ioc->
name,
2944 __func__, count, timeout));
2955 "doorbell_reg(%x)!\n", ioc->
name, __func__, count, doorbell_reg);
2977 ioc->
name, __func__);
2981 if (!(ioc->
facts.IOCCapabilities &
2989 if ((_base_wait_for_doorbell_ack(ioc, 15, sleep_flag))) {
2994 timeout, sleep_flag);
2997 " (ioc_state=0x%x)\n", ioc->
name, __func__, ioc_state);
3003 ioc->
name, ((r == 0) ?
"SUCCESS" :
"FAILED"));
3020 _base_handshake_req_reply_wait(
struct MPT2SAS_ADAPTER *ioc,
int request_bytes,
3021 u32 *
request,
int reply_bytes,
u16 *reply,
int timeout,
int sleep_flag)
3032 " (line=%d)\n", ioc->
name, __LINE__);
3038 MPI2_HIS_IOC2SYS_DB_STATUS)
3046 if ((_base_wait_for_doorbell_int(ioc, 5,
NO_SLEEP))) {
3048 "int failed (line=%d)\n", ioc->
name, __LINE__);
3053 if ((_base_wait_for_doorbell_ack(ioc, 5, sleep_flag))) {
3055 "ack failed (line=%d)\n", ioc->
name, __LINE__);
3060 for (i = 0, failed = 0; i < request_bytes/4 && !failed; i++) {
3062 if ((_base_wait_for_doorbell_ack(ioc, 5, sleep_flag)))
3068 "sending request failed (line=%d)\n", ioc->
name, __LINE__);
3073 if ((_base_wait_for_doorbell_int(ioc, timeout, sleep_flag))) {
3075 "int failed (line=%d)\n", ioc->
name, __LINE__);
3083 if ((_base_wait_for_doorbell_int(ioc, 5, sleep_flag))) {
3085 "int failed (line=%d)\n", ioc->
name, __LINE__);
3092 for (i = 2; i < default_reply->
MsgLength * 2; i++) {
3093 if ((_base_wait_for_doorbell_int(ioc, 5, sleep_flag))) {
3095 "handshake int failed (line=%d)\n", ioc->
name,
3099 if (i >= reply_bytes/2)
3107 _base_wait_for_doorbell_int(ioc, 5, sleep_flag);
3108 if (_base_wait_for_doorbell_not_used(ioc, 5, sleep_flag) != 0) {
3110 " (line=%d)\n", ioc->
name, __LINE__));
3117 for (i = 0; i < reply_bytes/4; i++)
3145 unsigned long timeleft;
3149 u16 wait_state_count;
3158 ioc->
name, __func__);
3163 wait_state_count = 0;
3166 if (wait_state_count++ == 10) {
3168 "%s: failed due to ioc not operational\n",
3169 ioc->
name, __func__);
3176 "operational state(count=%d)\n", ioc->
name,
3177 __func__, wait_state_count);
3183 ioc->
name, __func__);
3206 ioc->
name, __func__);
3211 goto issue_host_reset;
3250 unsigned long timeleft;
3254 u16 wait_state_count;
3263 ioc->
name, __func__);
3268 wait_state_count = 0;
3271 if (wait_state_count++ == 10) {
3273 "%s: failed due to ioc not operational\n",
3274 ioc->
name, __func__);
3281 "operational state(count=%d)\n", ioc->
name,
3282 __func__, wait_state_count);
3288 ioc->
name, __func__);
3304 ioc->
name, __func__);
3309 goto issue_host_reset;
3343 int mpi_reply_sz, mpi_request_sz,
r;
3350 memset(&mpi_request, 0, mpi_request_sz);
3353 r = _base_handshake_req_reply_wait(ioc, mpi_request_sz,
3358 ioc->
name, __func__, r);
3386 int mpi_reply_sz, mpi_request_sz,
r;
3393 memset(&mpi_request, 0, mpi_request_sz);
3395 r = _base_handshake_req_reply_wait(ioc, mpi_request_sz,
3400 ioc->
name, __func__, r);
3404 facts = &ioc->
facts;
3427 ioc->
shost->max_id = -1;
3440 "reply frame size(%d)\n", ioc->
name,
3467 mpi_request.
VF_ID = 0;
3468 mpi_request.
VP_ID = 0;
3472 if (_base_is_controller_msix_enabled(ioc))
3497 (current_time.tv_usec / 1000));
3503 mfp = (
__le32 *)&mpi_request;
3510 r = _base_handshake_req_reply_wait(ioc,
3517 ioc->
name, __func__, r);
3595 unsigned long timeleft;
3604 ioc->
name, __func__);
3611 ioc->
name, __func__);
3627 ioc->
name, __func__);
3641 ioc->
name, __func__, ioc_status);
3648 "SUCCESS" :
"FAILED"));
3668 ioc->
name, __func__);
3675 ioc->
name, __func__);
3753 desired_event = (1 << (
event % 32));
3757 else if (event < 64)
3759 else if (event < 96)
3761 else if (event < 128)
3776 unsigned long timeleft;
3786 ioc->
name, __func__);
3793 ioc->
name, __func__);
3801 mpi_request->
VF_ID = 0;
3802 mpi_request->
VP_ID = 0;
3811 ioc->
name, __func__);
3820 ioc->
name, __func__));
3837 u32 event_mask, desired_event;
3838 u8 send_update_to_fw;
3840 for (i = 0, send_update_to_fw = 0; i <
3842 event_mask = ~event_type[
i];
3844 for (j = 0; j < 32; j++) {
3845 if (!(event_mask & desired_event) &&
3848 send_update_to_fw = 1;
3850 desired_event = (desired_event << 1);
3854 if (!send_update_to_fw)
3858 _base_event_notification(ioc,
CAN_SLEEP);
3872 u32 host_diagnostic;
3887 "sequence\n", ioc->
name));
3907 "sequence: count(%d), host_diagnostic(0x%08x)\n",
3908 ioc->
name, count, host_diagnostic));
3923 for (count = 0; count < 3000000 ; count++) {
3927 if (host_diagnostic == 0xFFFFFFFF)
3942 "assuming the HCB Address points to good F/W\n",
3949 "re-enable the HCDW\n", ioc->
name));
3960 "diagnostic register\n", ioc->
name));
3964 "READY state\n", ioc->
name));
3969 " (ioc_state=0x%x)\n", ioc->
name, __func__, ioc_state);
3991 enum reset_type
type)
4004 ioc->
name, __func__, ioc_state));
4009 if (ioc_state & MPI2_DOORBELL_USED) {
4011 "active!\n", ioc->
name));
4012 goto issue_diag_reset;
4018 goto issue_diag_reset;
4022 goto issue_diag_reset;
4025 if (!(_base_send_ioc_reset(ioc,
4045 _base_make_ioc_operational(
struct MPT2SAS_ADAPTER *ioc,
int sleep_flag)
4048 unsigned long flags;
4051 struct _tr_list *delayed_tr, *delayed_tr_next;
4055 u32 reply_post_free_sz;
4117 i < ioc->reply_free_queue_depth ; i++, reply_address +=
4123 _base_assign_reply_queues(ioc);
4136 if (!_base_is_controller_msix_enabled(ioc))
4137 goto skip_init_reply_post_free_queue;
4138 reply_post_free += reply_post_free_sz;
4140 skip_init_reply_post_free_queue:
4142 r = _base_send_ioc_init(ioc, sleep_flag);
4154 if (!_base_is_controller_msix_enabled(ioc))
4155 goto skip_init_reply_post_host_index;
4158 skip_init_reply_post_host_index:
4160 _base_unmask_interrupts(ioc);
4162 r = _base_event_notification(ioc, sleep_flag);
4167 _base_static_config_pages(ioc);
4180 _base_determine_wait_on_discovery(ioc);
4183 r = _base_send_port_enable(ioc, sleep_flag);
4204 _base_mask_interrupts(ioc);
4208 _base_free_irq(ioc);
4209 _base_disable_msix(ioc);
4229 int cpu_id, last_cpu_id = 0;
4243 "cpu_msix_table failed!!!\n", ioc->
name));
4245 goto out_free_resources;
4253 "for cpu_msix_table failed!!!\n", ioc->
name));
4255 goto out_free_resources;
4261 goto out_free_resources;
4274 r = _base_get_ioc_facts(ioc,
CAN_SLEEP);
4276 goto out_free_resources;
4280 goto out_free_resources;
4286 goto out_free_resources;
4289 for (i = 0 ; i < ioc->
facts.NumberOfPorts; i++) {
4290 r = _base_get_port_facts(ioc, i,
CAN_SLEEP);
4292 goto out_free_resources;
4295 r = _base_allocate_memory_pools(ioc,
CAN_SLEEP);
4297 goto out_free_resources;
4302 if (ioc->
facts.MaxDevHandle % 8)
4308 goto out_free_resources;
4314 goto out_free_resources;
4358 goto out_free_resources;
4365 goto out_free_resources;
4382 r = _base_make_ioc_operational(ioc,
CAN_SLEEP);
4384 goto out_free_resources;
4386 if (missing_delay[0] != -1 && missing_delay[1] != -1)
4387 _base_update_missing_delay(ioc, missing_delay[0],
4396 _base_release_memory_pools(ioc);
4438 _base_release_memory_pools(ioc);
4473 switch (reset_phase) {
4476 "MPT2_IOC_PRE_RESET\n", ioc->
name, __func__));
4480 "MPT2_IOC_AFTER_RESET\n", ioc->
name, __func__));
4514 "MPT2_IOC_DONE_RESET\n", ioc->
name, __func__));
4528 _wait_for_commands_to_complete(
struct MPT2SAS_ADAPTER *ioc,
int sleep_flag)
4531 unsigned long flags;
4566 enum reset_type type)
4569 unsigned long flags;
4576 ioc->
name, __func__);
4581 if (mpt2sas_fwfault_debug)
4606 _wait_for_commands_to_complete(ioc, sleep_flag);
4607 _base_mask_interrupts(ioc);
4608 r = _base_make_ioc_ready(ioc, sleep_flag, type);
4621 r = _base_make_ioc_operational(ioc, sleep_flag);
4626 ioc->
name, __func__, ((r == 0) ?
"SUCCESS" :
"FAILED")));