0006-scsi-hpsa-Do-not-use-HBA-flag-from-NVRAM-if-HBA-is-n.patch

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-19 18:15:22 +02:00
parent 60b75ed2f2
commit 98fb84ac2b
2 changed files with 18 additions and 2 deletions

View File

@ -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;
}

View File

@ -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 */