diff options
author | James Smart <james.smart@emulex.com> | 2012-10-31 14:44:33 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-11-26 23:59:43 -0500 |
commit | c71ab8616d62d8d857c438f058839d9a0282e64c (patch) | |
tree | 1c5f1029704ad8c64c13d15e274a77760bd46dbb /drivers/scsi/lpfc/lpfc_attr.c | |
parent | 286aa031664ba5223bcb3dfd49a9e2d89d6b3aec (diff) |
[SCSI] lpfc 8.3.36: Fixed boot from san failure
Fixed boot from san failure when SLI4 FC device presented on the same PCI bus
The request_firmware interface can induce delays while looking
for firmware files, even if no fw file is present. In some situations
the delays exceeded scan_wait timeouts, resulting in situations in which
the boot device had not been discovered in time. Boot Device does not
need to be on a lpfc device.
Change request_firmware use to be module paramater driven. Default is to
not attempt firmware download on boot. Add sysfs parameter to invoke
firmware update.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index ad16e54ac383..a71c7ebe7b74 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -3618,6 +3618,77 @@ static DEVICE_ATTR(lpfc_sriov_nr_virtfn, S_IRUGO | S_IWUSR, | |||
3618 | lpfc_sriov_nr_virtfn_show, lpfc_sriov_nr_virtfn_store); | 3618 | lpfc_sriov_nr_virtfn_show, lpfc_sriov_nr_virtfn_store); |
3619 | 3619 | ||
3620 | /** | 3620 | /** |
3621 | * lpfc_request_firmware_store - Request for Linux generic firmware upgrade | ||
3622 | * | ||
3623 | * @dev: class device that is converted into a Scsi_host. | ||
3624 | * @attr: device attribute, not used. | ||
3625 | * @buf: containing the string the number of vfs to be enabled. | ||
3626 | * @count: unused variable. | ||
3627 | * | ||
3628 | * Description: | ||
3629 | * | ||
3630 | * Returns: | ||
3631 | * length of the buf on success if val is in range the intended mode | ||
3632 | * is supported. | ||
3633 | * -EINVAL if val out of range or intended mode is not supported. | ||
3634 | **/ | ||
3635 | static ssize_t | ||
3636 | lpfc_request_firmware_upgrade_store(struct device *dev, | ||
3637 | struct device_attribute *attr, | ||
3638 | const char *buf, size_t count) | ||
3639 | { | ||
3640 | struct Scsi_Host *shost = class_to_shost(dev); | ||
3641 | struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; | ||
3642 | struct lpfc_hba *phba = vport->phba; | ||
3643 | int val = 0, rc = -EINVAL; | ||
3644 | |||
3645 | /* Sanity check on user data */ | ||
3646 | if (!isdigit(buf[0])) | ||
3647 | return -EINVAL; | ||
3648 | if (sscanf(buf, "%i", &val) != 1) | ||
3649 | return -EINVAL; | ||
3650 | if (val != 1) | ||
3651 | return -EINVAL; | ||
3652 | |||
3653 | rc = lpfc_sli4_request_firmware_update(phba, RUN_FW_UPGRADE); | ||
3654 | if (rc) | ||
3655 | rc = -EPERM; | ||
3656 | else | ||
3657 | rc = strlen(buf); | ||
3658 | return rc; | ||
3659 | } | ||
3660 | |||
3661 | static int lpfc_req_fw_upgrade; | ||
3662 | module_param(lpfc_req_fw_upgrade, int, S_IRUGO|S_IWUSR); | ||
3663 | MODULE_PARM_DESC(lpfc_req_fw_upgrade, "Enable Linux generic firmware upgrade"); | ||
3664 | lpfc_param_show(request_firmware_upgrade) | ||
3665 | |||
3666 | /** | ||
3667 | * lpfc_request_firmware_upgrade_init - Enable initial linux generic fw upgrade | ||
3668 | * @phba: lpfc_hba pointer. | ||
3669 | * @val: 0 or 1. | ||
3670 | * | ||
3671 | * Description: | ||
3672 | * Set the initial Linux generic firmware upgrade enable or disable flag. | ||
3673 | * | ||
3674 | * Returns: | ||
3675 | * zero if val saved. | ||
3676 | * -EINVAL val out of range | ||
3677 | **/ | ||
3678 | static int | ||
3679 | lpfc_request_firmware_upgrade_init(struct lpfc_hba *phba, int val) | ||
3680 | { | ||
3681 | if (val >= 0 && val <= 1) { | ||
3682 | phba->cfg_request_firmware_upgrade = val; | ||
3683 | return 0; | ||
3684 | } | ||
3685 | return -EINVAL; | ||
3686 | } | ||
3687 | static DEVICE_ATTR(lpfc_req_fw_upgrade, S_IRUGO | S_IWUSR, | ||
3688 | lpfc_request_firmware_upgrade_show, | ||
3689 | lpfc_request_firmware_upgrade_store); | ||
3690 | |||
3691 | /** | ||
3621 | * lpfc_fcp_imax_store | 3692 | * lpfc_fcp_imax_store |
3622 | * | 3693 | * |
3623 | * @dev: class device that is converted into a Scsi_host. | 3694 | * @dev: class device that is converted into a Scsi_host. |
@@ -4069,6 +4140,7 @@ struct device_attribute *lpfc_hba_attrs[] = { | |||
4069 | &dev_attr_lpfc_aer_support, | 4140 | &dev_attr_lpfc_aer_support, |
4070 | &dev_attr_lpfc_aer_state_cleanup, | 4141 | &dev_attr_lpfc_aer_state_cleanup, |
4071 | &dev_attr_lpfc_sriov_nr_virtfn, | 4142 | &dev_attr_lpfc_sriov_nr_virtfn, |
4143 | &dev_attr_lpfc_req_fw_upgrade, | ||
4072 | &dev_attr_lpfc_suppress_link_up, | 4144 | &dev_attr_lpfc_suppress_link_up, |
4073 | &dev_attr_lpfc_iocb_cnt, | 4145 | &dev_attr_lpfc_iocb_cnt, |
4074 | &dev_attr_iocb_hw, | 4146 | &dev_attr_iocb_hw, |
@@ -5051,6 +5123,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) | |||
5051 | lpfc_hba_log_verbose_init(phba, lpfc_log_verbose); | 5123 | lpfc_hba_log_verbose_init(phba, lpfc_log_verbose); |
5052 | lpfc_aer_support_init(phba, lpfc_aer_support); | 5124 | lpfc_aer_support_init(phba, lpfc_aer_support); |
5053 | lpfc_sriov_nr_virtfn_init(phba, lpfc_sriov_nr_virtfn); | 5125 | lpfc_sriov_nr_virtfn_init(phba, lpfc_sriov_nr_virtfn); |
5126 | lpfc_request_firmware_upgrade_init(phba, lpfc_req_fw_upgrade); | ||
5054 | lpfc_suppress_link_up_init(phba, lpfc_suppress_link_up); | 5127 | lpfc_suppress_link_up_init(phba, lpfc_suppress_link_up); |
5055 | lpfc_iocb_cnt_init(phba, lpfc_iocb_cnt); | 5128 | lpfc_iocb_cnt_init(phba, lpfc_iocb_cnt); |
5056 | phba->cfg_enable_dss = 1; | 5129 | phba->cfg_enable_dss = 1; |