• Steve Sistare's avatar
    scsi: megaraid_sas: reduce module load time · 31b6a05f
    Steve Sistare authored
    megaraid_sas takes 1+ seconds to load while waiting for firmware:
    
    [2.822603] megaraid_sas 0000:03:00.0: Waiting for FW to come to ready state
    [3.871003] megaraid_sas 0000:03:00.0: FW now in Ready state
    
    This is due to the following loop in megasas_transition_to_ready(), which
    waits a minimum of 1 second, even though the FW becomes ready in tens of
    millisecs:
    
            /*
             * The cur_state should not last for more than max_wait secs
             */
            for (i = 0; i < max_wait; i++) {
                    ...
                    msleep(1000);
            ...
            dev_info(&instance->pdev->dev, "FW now in Ready state\n");
    
    This is a regression, caused by a change of the msleep granularity from 1
    to 1000 due to concern about waiting too long on systems with coarse
    jiffies.
    
    To fix, increase iterations and use msleep(20), which results in:
    
    [2.670627] megaraid_sas 0000:03:00.0: Waiting for FW to come to ready state
    [2.739386] megaraid_sas 0000:03:00.0: FW now in Ready state
    
    Fixes: fb2f3e96d80f ("scsi: megaraid_sas: Fix msleep granularity")
    Signed-off-by: default avatarSteve Sistare <steven.sistare@oracle.com>
    Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    31b6a05f
megaraid_sas_base.c 227 KB