James/linux-scsi, This patch for megaraid_sas will continue booting immediately if FW is in FAULT state at driver load time. Signed-off-by: Adam Radford <aradford@xxxxxxxxx> diff -Naur scsi-misc-2.6/drivers/scsi/megaraid/megaraid_sas_base.c scsi-misc-2.6.new/drivers/scsi/megaraid/megaraid_sas_base.c --- scsi-misc-2.6/drivers/scsi/megaraid/megaraid_sas_base.c 2011-10-07 12:10:42.000000000 -0700 +++ scsi-misc-2.6.new/drivers/scsi/megaraid/megaraid_sas_base.c 2011-10-07 17:38:45.026330261 -0700 @@ -84,7 +84,7 @@ MODULE_AUTHOR("megaraidlinux@xxxxxxx"); MODULE_DESCRIPTION("LSI MegaRAID SAS Driver"); -int megasas_transition_to_ready(struct megasas_instance *instance); +int megasas_transition_to_ready(struct megasas_instance *instance, int ocr); static int megasas_get_pd_list(struct megasas_instance *instance); static int megasas_issue_init_mfi(struct megasas_instance *instance); static int megasas_register_aen(struct megasas_instance *instance, @@ -2477,7 +2477,7 @@ msleep(1000); } - if (megasas_transition_to_ready(instance)) { + if (megasas_transition_to_ready(instance, 1)) { printk(KERN_NOTICE "megaraid_sas:adapter not ready\n"); megaraid_sas_kill_hba(instance); @@ -2617,7 +2617,7 @@ * has to wait for the ready state. */ int -megasas_transition_to_ready(struct megasas_instance* instance) +megasas_transition_to_ready(struct megasas_instance *instance, int ocr) { int i; u8 max_wait; @@ -2639,11 +2639,13 @@ switch (fw_state) { case MFI_STATE_FAULT: - printk(KERN_DEBUG "megasas: FW in FAULT state!!\n"); - max_wait = MEGASAS_RESET_WAIT_TIME; - cur_state = MFI_STATE_FAULT; - break; + if (ocr) { + max_wait = MEGASAS_RESET_WAIT_TIME; + cur_state = MFI_STATE_FAULT; + break; + } else + return -ENODEV; case MFI_STATE_WAIT_HANDSHAKE: /* @@ -3520,7 +3522,7 @@ /* * We expect the FW state to be READY */ - if (megasas_transition_to_ready(instance)) + if (megasas_transition_to_ready(instance, 0)) goto fail_ready_state; /* Check if MSI-X is supported while in ready state */ @@ -4357,7 +4359,7 @@ /* * We expect the FW state to be READY */ - if (megasas_transition_to_ready(instance)) + if (megasas_transition_to_ready(instance, 0)) goto fail_ready_state; /* Now re-enable MSI-X */ diff -Naur scsi-misc-2.6/drivers/scsi/megaraid/megaraid_sas_fusion.c scsi-misc-2.6.new/drivers/scsi/megaraid/megaraid_sas_fusion.c --- scsi-misc-2.6/drivers/scsi/megaraid/megaraid_sas_fusion.c 2011-10-07 12:10:42.000000000 -0700 +++ scsi-misc-2.6.new/drivers/scsi/megaraid/megaraid_sas_fusion.c 2011-10-07 17:33:25.854175220 -0700 @@ -89,7 +89,7 @@ struct LD_LOAD_BALANCE_INFO *lbInfo); u16 get_updated_dev_handle(struct LD_LOAD_BALANCE_INFO *lbInfo, struct IO_REQUEST_INFO *in_info); -int megasas_transition_to_ready(struct megasas_instance *instance); +int megasas_transition_to_ready(struct megasas_instance *instance, int ocr); void megaraid_sas_kill_hba(struct megasas_instance *instance); extern u32 megasas_dbg_lvl; @@ -2173,7 +2173,7 @@ } /* Wait for FW to become ready */ - if (megasas_transition_to_ready(instance)) { + if (megasas_transition_to_ready(instance, 1)) { printk(KERN_WARNING "megaraid_sas: Failed to " "transition controller to ready.\n"); continue;
Attachment:
megaraid_sas.patch1
Description: Binary data