diff --git a/src/5.x/drivers/scsi/hpsa.c b/src/5.x/drivers/scsi/hpsa.c index 2669d6df..cc7a372f 100644 --- a/src/5.x/drivers/scsi/hpsa.c +++ b/src/5.x/drivers/scsi/hpsa.c @@ -4393,6 +4393,12 @@ static bool hpsa_skip_device(struct ctlr_info *h, u8 *lunaddrbytes, return false; } +static bool is_hba_supported(const struct bmic_identify_controller *id_ctlr) +{ + return le32_to_cpu(id_ctlr->yet_more_controller_flags) & + YET_MORE_CTLR_FLAG_HBA_MODE_SUPP; +} + static int hpsa_nvram_hba_flag_enabled(struct ctlr_info *h, bool *flag_enabled) { int rc; @@ -4415,7 +4421,8 @@ out: return rc; } -static int hpsa_update_nvram_hba_mode(struct ctlr_info *h, u32 nlogicals) +static int hpsa_update_nvram_hba_mode(struct ctlr_info *h, u32 nlogicals, + const struct bmic_identify_controller *id_ctlr) { int rc; bool flag_enabled; @@ -4424,6 +4431,11 @@ static int hpsa_update_nvram_hba_mode(struct ctlr_info *h, u32 nlogicals) if (!hpsa_use_nvram_hba_flag) return 0; + if (!is_hba_supported(id_ctlr)) { + dev_info(&h->pdev->dev, "NVRAM HBA flag: not supported\n"); + return 0; + } + rc = hpsa_nvram_hba_flag_enabled(h, &flag_enabled); if (rc == -ENOMEM) dev_warn(&h->pdev->dev, "Out of memory.\n"); @@ -4497,7 +4509,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) __func__); } - if (hpsa_update_nvram_hba_mode(h, nlogicals)) { + if (hpsa_update_nvram_hba_mode(h, nlogicals, id_ctlr)) { h->drv_req_rescan = 1; goto out; } diff --git a/src/5.x/drivers/scsi/hpsa_cmd.h b/src/5.x/drivers/scsi/hpsa_cmd.h index 32c84b1a..001a0316 100644 --- a/src/5.x/drivers/scsi/hpsa_cmd.h +++ b/src/5.x/drivers/scsi/hpsa_cmd.h @@ -808,6 +808,10 @@ struct bmic_identify_controller { }; +/* ssacli calls this bit "Hba Mode Supported". */ +#define YET_MORE_CTLR_FLAG_HBA_MODE_SUPP (1 << 25) + + struct bmic_identify_physical_device { u8 scsi_bus; /* SCSI Bus number on controller */ u8 scsi_id; /* SCSI ID on this bus */