Commit 0a11c0b0 authored by Shivasharan S's avatar Shivasharan S Committed by Martin K. Petersen

scsi: megaraid_sas: Add debug prints for device list

Add debug prints related to device list being returned by firmware.  The a
debug flag to activate these prints.
Signed-off-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: default avatarShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f7331f18
...@@ -1499,6 +1499,7 @@ struct megasas_ctrl_info { ...@@ -1499,6 +1499,7 @@ struct megasas_ctrl_info {
/* Driver's internal Logging levels*/ /* Driver's internal Logging levels*/
#define OCR_DEBUG (1 << 0) #define OCR_DEBUG (1 << 0)
#define TM_DEBUG (1 << 1) #define TM_DEBUG (1 << 1)
#define LD_PD_DEBUG (1 << 2)
#define SCAN_PD_CHANNEL 0x1 #define SCAN_PD_CHANNEL 0x1
#define SCAN_VD_CHANNEL 0x2 #define SCAN_VD_CHANNEL 0x2
......
...@@ -4511,6 +4511,9 @@ megasas_get_pd_list(struct megasas_instance *instance) ...@@ -4511,6 +4511,9 @@ megasas_get_pd_list(struct megasas_instance *instance)
case DCMD_SUCCESS: case DCMD_SUCCESS:
pd_addr = ci->addr; pd_addr = ci->addr;
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev, "%s, sysPD count: 0x%x\n",
__func__, le32_to_cpu(ci->count));
if ((le32_to_cpu(ci->count) > if ((le32_to_cpu(ci->count) >
(MEGASAS_MAX_PD_CHANNELS * MEGASAS_MAX_DEV_PER_CHANNEL))) (MEGASAS_MAX_PD_CHANNELS * MEGASAS_MAX_DEV_PER_CHANNEL)))
...@@ -4526,6 +4529,11 @@ megasas_get_pd_list(struct megasas_instance *instance) ...@@ -4526,6 +4529,11 @@ megasas_get_pd_list(struct megasas_instance *instance)
pd_addr->scsiDevType; pd_addr->scsiDevType;
instance->local_pd_list[le16_to_cpu(pd_addr->deviceId)].driveState = instance->local_pd_list[le16_to_cpu(pd_addr->deviceId)].driveState =
MR_PD_STATE_SYSTEM; MR_PD_STATE_SYSTEM;
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev,
"PD%d: targetID: 0x%03x deviceType:0x%x\n",
pd_index, le16_to_cpu(pd_addr->deviceId),
pd_addr->scsiDevType);
pd_addr++; pd_addr++;
} }
...@@ -4629,6 +4637,10 @@ megasas_get_ld_list(struct megasas_instance *instance) ...@@ -4629,6 +4637,10 @@ megasas_get_ld_list(struct megasas_instance *instance)
break; break;
case DCMD_SUCCESS: case DCMD_SUCCESS:
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev, "%s, LD count: 0x%x\n",
__func__, ld_count);
if (ld_count > instance->fw_supported_vd_count) if (ld_count > instance->fw_supported_vd_count)
break; break;
...@@ -4638,6 +4650,10 @@ megasas_get_ld_list(struct megasas_instance *instance) ...@@ -4638,6 +4650,10 @@ megasas_get_ld_list(struct megasas_instance *instance)
if (ci->ldList[ld_index].state != 0) { if (ci->ldList[ld_index].state != 0) {
ids = ci->ldList[ld_index].ref.targetId; ids = ci->ldList[ld_index].ref.targetId;
instance->ld_ids[ids] = ci->ldList[ld_index].ref.targetId; instance->ld_ids[ids] = ci->ldList[ld_index].ref.targetId;
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev,
"LD%d: targetID: 0x%03x\n",
ld_index, ids);
} }
} }
...@@ -4741,6 +4757,10 @@ megasas_ld_list_query(struct megasas_instance *instance, u8 query_type) ...@@ -4741,6 +4757,10 @@ megasas_ld_list_query(struct megasas_instance *instance, u8 query_type)
case DCMD_SUCCESS: case DCMD_SUCCESS:
tgtid_count = le32_to_cpu(ci->count); tgtid_count = le32_to_cpu(ci->count);
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev, "%s, LD count: 0x%x\n",
__func__, tgtid_count);
if ((tgtid_count > (instance->fw_supported_vd_count))) if ((tgtid_count > (instance->fw_supported_vd_count)))
break; break;
...@@ -4748,6 +4768,9 @@ megasas_ld_list_query(struct megasas_instance *instance, u8 query_type) ...@@ -4748,6 +4768,9 @@ megasas_ld_list_query(struct megasas_instance *instance, u8 query_type)
for (ld_index = 0; ld_index < tgtid_count; ld_index++) { for (ld_index = 0; ld_index < tgtid_count; ld_index++) {
ids = ci->targetId[ld_index]; ids = ci->targetId[ld_index];
instance->ld_ids[ids] = ci->targetId[ld_index]; instance->ld_ids[ids] = ci->targetId[ld_index];
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev, "LD%d: targetID: 0x%03x\n",
ld_index, ci->targetId[ld_index]);
} }
break; break;
...@@ -4827,6 +4850,10 @@ megasas_host_device_list_query(struct megasas_instance *instance, ...@@ -4827,6 +4850,10 @@ megasas_host_device_list_query(struct megasas_instance *instance,
*/ */
count = le32_to_cpu(ci->count); count = le32_to_cpu(ci->count);
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev, "%s, Device count: 0x%x\n",
__func__, count);
memset(instance->local_pd_list, 0, memset(instance->local_pd_list, 0,
MEGASAS_MAX_PD * sizeof(struct megasas_pd_list)); MEGASAS_MAX_PD * sizeof(struct megasas_pd_list));
memset(instance->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT); memset(instance->ld_ids, 0xff, MAX_LOGICAL_DRIVES_EXT);
...@@ -4838,8 +4865,16 @@ megasas_host_device_list_query(struct megasas_instance *instance, ...@@ -4838,8 +4865,16 @@ megasas_host_device_list_query(struct megasas_instance *instance,
ci->host_device_list[i].scsi_type; ci->host_device_list[i].scsi_type;
instance->local_pd_list[target_id].driveState = instance->local_pd_list[target_id].driveState =
MR_PD_STATE_SYSTEM; MR_PD_STATE_SYSTEM;
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev,
"Device %d: PD targetID: 0x%03x deviceType:0x%x\n",
i, target_id, ci->host_device_list[i].scsi_type);
} else { } else {
instance->ld_ids[target_id] = target_id; instance->ld_ids[target_id] = target_id;
if (megasas_dbg_lvl & LD_PD_DEBUG)
dev_info(&instance->pdev->dev,
"Device %d: LD targetID: 0x%03x\n",
i, target_id);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment