Commit 919d8a3f authored by Joe Perches's avatar Joe Perches Committed by Martin K. Petersen

scsi: mpt3sas: Convert uses of pr_<level> with MPT3SAS_FMT to ioc_<level>

Use a more common logging style.

Done using the perl script below and some typing

$ git grep --name-only -w MPT3SAS_FMT -- "*.c" | \
  xargs perl -i -e 'local $/; while (<>) { s/\bpr_(info|err|notice|warn)\s*\(\s*MPT3SAS_FMT\s*("[^"]+"(?:\s*\\?\s*"[^"]+"\s*){0,5}\s*),\s*ioc->name\s*/ioc_\1(ioc, \2/g; print;}'

Miscellanea for these conversions:

o Coalesce formats
o Realign arguments
o Remove unnecessary parentheses
o Use casts to u64 instead of unsigned long long where appropriate
o Convert broken pr_info uses to pr_cont
o Fix broken format string concatenation with line continuations and
  excess whitespace
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarSuganath Prabu <suganath-prabu.subramani@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 645a20c6
This diff is collapsed.
...@@ -175,9 +175,8 @@ _config_display_some_debug(struct MPT3SAS_ADAPTER *ioc, u16 smid, ...@@ -175,9 +175,8 @@ _config_display_some_debug(struct MPT3SAS_ADAPTER *ioc, u16 smid,
if (!desc) if (!desc)
return; return;
pr_info(MPT3SAS_FMT ioc_info(ioc, "%s: %s(%d), action(%d), form(0x%08x), smid(%d)\n",
"%s: %s(%d), action(%d), form(0x%08x), smid(%d)\n", calling_function_name, desc,
ioc->name, calling_function_name, desc,
mpi_request->Header.PageNumber, mpi_request->Action, mpi_request->Header.PageNumber, mpi_request->Action,
le32_to_cpu(mpi_request->PageAddress), smid); le32_to_cpu(mpi_request->PageAddress), smid);
...@@ -185,9 +184,8 @@ _config_display_some_debug(struct MPT3SAS_ADAPTER *ioc, u16 smid, ...@@ -185,9 +184,8 @@ _config_display_some_debug(struct MPT3SAS_ADAPTER *ioc, u16 smid,
return; return;
if (mpi_reply->IOCStatus || mpi_reply->IOCLogInfo) if (mpi_reply->IOCStatus || mpi_reply->IOCLogInfo)
pr_info(MPT3SAS_FMT ioc_info(ioc, "\tiocstatus(0x%04x), loginfo(0x%08x)\n",
"\tiocstatus(0x%04x), loginfo(0x%08x)\n", le16_to_cpu(mpi_reply->IOCStatus),
ioc->name, le16_to_cpu(mpi_reply->IOCStatus),
le32_to_cpu(mpi_reply->IOCLogInfo)); le32_to_cpu(mpi_reply->IOCLogInfo));
} }
...@@ -210,9 +208,8 @@ _config_alloc_config_dma_memory(struct MPT3SAS_ADAPTER *ioc, ...@@ -210,9 +208,8 @@ _config_alloc_config_dma_memory(struct MPT3SAS_ADAPTER *ioc,
mem->page = dma_alloc_coherent(&ioc->pdev->dev, mem->sz, mem->page = dma_alloc_coherent(&ioc->pdev->dev, mem->sz,
&mem->page_dma, GFP_KERNEL); &mem->page_dma, GFP_KERNEL);
if (!mem->page) { if (!mem->page) {
pr_err(MPT3SAS_FMT ioc_err(ioc, "%s: dma_alloc_coherent failed asking for (%d) bytes!!\n",
"%s: dma_alloc_coherent failed asking for (%d) bytes!!\n", __func__, mem->sz);
ioc->name, __func__, mem->sz);
r = -ENOMEM; r = -ENOMEM;
} }
} else { /* use tmp buffer if less than 512 bytes */ } else { /* use tmp buffer if less than 512 bytes */
...@@ -313,8 +310,7 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t ...@@ -313,8 +310,7 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
mutex_lock(&ioc->config_cmds.mutex); mutex_lock(&ioc->config_cmds.mutex);
if (ioc->config_cmds.status != MPT3_CMD_NOT_USED) { if (ioc->config_cmds.status != MPT3_CMD_NOT_USED) {
pr_err(MPT3SAS_FMT "%s: config_cmd in use\n", ioc_err(ioc, "%s: config_cmd in use\n", __func__);
ioc->name, __func__);
mutex_unlock(&ioc->config_cmds.mutex); mutex_unlock(&ioc->config_cmds.mutex);
return -EAGAIN; return -EAGAIN;
} }
...@@ -362,34 +358,30 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t ...@@ -362,34 +358,30 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
r = -EFAULT; r = -EFAULT;
goto free_mem; goto free_mem;
} }
pr_info(MPT3SAS_FMT "%s: attempting retry (%d)\n", ioc_info(ioc, "%s: attempting retry (%d)\n",
ioc->name, __func__, retry_count); __func__, retry_count);
} }
wait_state_count = 0; wait_state_count = 0;
ioc_state = mpt3sas_base_get_iocstate(ioc, 1); ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {
if (wait_state_count++ == MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT) { if (wait_state_count++ == MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT) {
pr_err(MPT3SAS_FMT ioc_err(ioc, "%s: failed due to ioc not operational\n",
"%s: failed due to ioc not operational\n", __func__);
ioc->name, __func__);
ioc->config_cmds.status = MPT3_CMD_NOT_USED; ioc->config_cmds.status = MPT3_CMD_NOT_USED;
r = -EFAULT; r = -EFAULT;
goto free_mem; goto free_mem;
} }
ssleep(1); ssleep(1);
ioc_state = mpt3sas_base_get_iocstate(ioc, 1); ioc_state = mpt3sas_base_get_iocstate(ioc, 1);
pr_info(MPT3SAS_FMT ioc_info(ioc, "%s: waiting for operational state(count=%d)\n",
"%s: waiting for operational state(count=%d)\n", __func__, wait_state_count);
ioc->name, __func__, wait_state_count);
} }
if (wait_state_count) if (wait_state_count)
pr_info(MPT3SAS_FMT "%s: ioc is operational\n", ioc_info(ioc, "%s: ioc is operational\n", __func__);
ioc->name, __func__);
smid = mpt3sas_base_get_smid(ioc, ioc->config_cb_idx); smid = mpt3sas_base_get_smid(ioc, ioc->config_cb_idx);
if (!smid) { if (!smid) {
pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n", ioc_err(ioc, "%s: failed obtaining a smid\n", __func__);
ioc->name, __func__);
ioc->config_cmds.status = MPT3_CMD_NOT_USED; ioc->config_cmds.status = MPT3_CMD_NOT_USED;
r = -EAGAIN; r = -EAGAIN;
goto free_mem; goto free_mem;
...@@ -453,8 +445,8 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t ...@@ -453,8 +445,8 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
} }
if (retry_count) if (retry_count)
pr_info(MPT3SAS_FMT "%s: retry (%d) completed!!\n", \ ioc_info(ioc, "%s: retry (%d) completed!!\n",
ioc->name, __func__, retry_count); __func__, retry_count);
if ((ioc_status == MPI2_IOCSTATUS_SUCCESS) && if ((ioc_status == MPI2_IOCSTATUS_SUCCESS) &&
config_page && mpi_request->Action == config_page && mpi_request->Action ==
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -72,8 +72,7 @@ _mpt3sas_raise_sigio(struct MPT3SAS_ADAPTER *ioc, ...@@ -72,8 +72,7 @@ _mpt3sas_raise_sigio(struct MPT3SAS_ADAPTER *ioc,
u16 sz, event_data_sz; u16 sz, event_data_sz;
unsigned long flags; unsigned long flags;
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: enter\n", dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: enter\n", __func__));
ioc->name, __func__));
sz = offsetof(Mpi2EventNotificationReply_t, EventData) + sz = offsetof(Mpi2EventNotificationReply_t, EventData) +
sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T) + 4; sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T) + 4;
...@@ -85,22 +84,22 @@ _mpt3sas_raise_sigio(struct MPT3SAS_ADAPTER *ioc, ...@@ -85,22 +84,22 @@ _mpt3sas_raise_sigio(struct MPT3SAS_ADAPTER *ioc,
mpi_reply->EventDataLength = cpu_to_le16(event_data_sz); mpi_reply->EventDataLength = cpu_to_le16(event_data_sz);
memcpy(&mpi_reply->EventData, event_data, memcpy(&mpi_reply->EventData, event_data,
sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T)); sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T));
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: add to driver event log\n", ioc_info(ioc, "%s: add to driver event log\n",
ioc->name, __func__)); __func__));
mpt3sas_ctl_add_to_event_log(ioc, mpi_reply); mpt3sas_ctl_add_to_event_log(ioc, mpi_reply);
kfree(mpi_reply); kfree(mpi_reply);
out: out:
/* clearing the diag_trigger_active flag */ /* clearing the diag_trigger_active flag */
spin_lock_irqsave(&ioc->diag_trigger_lock, flags); spin_lock_irqsave(&ioc->diag_trigger_lock, flags);
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: clearing diag_trigger_active flag\n", ioc_info(ioc, "%s: clearing diag_trigger_active flag\n",
ioc->name, __func__)); __func__));
ioc->diag_trigger_active = 0; ioc->diag_trigger_active = 0;
spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags); spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags);
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: exit\n", ioc->name, dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: exit\n",
__func__)); __func__));
} }
...@@ -115,21 +114,21 @@ mpt3sas_process_trigger_data(struct MPT3SAS_ADAPTER *ioc, ...@@ -115,21 +114,21 @@ mpt3sas_process_trigger_data(struct MPT3SAS_ADAPTER *ioc,
{ {
u8 issue_reset = 0; u8 issue_reset = 0;
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: enter\n", dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: enter\n", __func__));
ioc->name, __func__));
/* release the diag buffer trace */ /* release the diag buffer trace */
if ((ioc->diag_buffer_status[MPI2_DIAG_BUF_TYPE_TRACE] & if ((ioc->diag_buffer_status[MPI2_DIAG_BUF_TYPE_TRACE] &
MPT3_DIAG_BUFFER_IS_RELEASED) == 0) { MPT3_DIAG_BUFFER_IS_RELEASED) == 0) {
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: release trace diag buffer\n", ioc->name, __func__)); ioc_info(ioc, "%s: release trace diag buffer\n",
__func__));
mpt3sas_send_diag_release(ioc, MPI2_DIAG_BUF_TYPE_TRACE, mpt3sas_send_diag_release(ioc, MPI2_DIAG_BUF_TYPE_TRACE,
&issue_reset); &issue_reset);
} }
_mpt3sas_raise_sigio(ioc, event_data); _mpt3sas_raise_sigio(ioc, event_data);
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: exit\n", ioc->name, dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: exit\n",
__func__)); __func__));
} }
...@@ -168,9 +167,9 @@ mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc, u32 trigger_bitmask) ...@@ -168,9 +167,9 @@ mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc, u32 trigger_bitmask)
by_pass_checks: by_pass_checks:
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: enter - trigger_bitmask = 0x%08x\n", ioc_info(ioc, "%s: enter - trigger_bitmask = 0x%08x\n",
ioc->name, __func__, trigger_bitmask)); __func__, trigger_bitmask));
/* don't send trigger if an trigger is currently active */ /* don't send trigger if an trigger is currently active */
if (ioc->diag_trigger_active) { if (ioc->diag_trigger_active) {
...@@ -182,9 +181,9 @@ mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc, u32 trigger_bitmask) ...@@ -182,9 +181,9 @@ mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc, u32 trigger_bitmask)
if (ioc->diag_trigger_master.MasterData & trigger_bitmask) { if (ioc->diag_trigger_master.MasterData & trigger_bitmask) {
found_match = 1; found_match = 1;
ioc->diag_trigger_active = 1; ioc->diag_trigger_active = 1;
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: setting diag_trigger_active flag\n", ioc_info(ioc, "%s: setting diag_trigger_active flag\n",
ioc->name, __func__)); __func__));
} }
spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags); spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags);
...@@ -202,7 +201,7 @@ mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc, u32 trigger_bitmask) ...@@ -202,7 +201,7 @@ mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc, u32 trigger_bitmask)
mpt3sas_send_trigger_data_event(ioc, &event_data); mpt3sas_send_trigger_data_event(ioc, &event_data);
out: out:
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: exit\n", ioc->name, dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: exit\n",
__func__)); __func__));
} }
...@@ -239,9 +238,9 @@ mpt3sas_trigger_event(struct MPT3SAS_ADAPTER *ioc, u16 event, ...@@ -239,9 +238,9 @@ mpt3sas_trigger_event(struct MPT3SAS_ADAPTER *ioc, u16 event,
return; return;
} }
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: enter - event = 0x%04x, log_entry_qualifier = 0x%04x\n", ioc_info(ioc, "%s: enter - event = 0x%04x, log_entry_qualifier = 0x%04x\n",
ioc->name, __func__, event, log_entry_qualifier)); __func__, event, log_entry_qualifier));
/* don't send trigger if an trigger is currently active */ /* don't send trigger if an trigger is currently active */
if (ioc->diag_trigger_active) { if (ioc->diag_trigger_active) {
...@@ -263,25 +262,25 @@ mpt3sas_trigger_event(struct MPT3SAS_ADAPTER *ioc, u16 event, ...@@ -263,25 +262,25 @@ mpt3sas_trigger_event(struct MPT3SAS_ADAPTER *ioc, u16 event,
} }
found_match = 1; found_match = 1;
ioc->diag_trigger_active = 1; ioc->diag_trigger_active = 1;
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: setting diag_trigger_active flag\n", ioc_info(ioc, "%s: setting diag_trigger_active flag\n",
ioc->name, __func__)); __func__));
} }
spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags); spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags);
if (!found_match) if (!found_match)
goto out; goto out;
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: setting diag_trigger_active flag\n", ioc_info(ioc, "%s: setting diag_trigger_active flag\n",
ioc->name, __func__)); __func__));
memset(&event_data, 0, sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T)); memset(&event_data, 0, sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T));
event_data.trigger_type = MPT3SAS_TRIGGER_EVENT; event_data.trigger_type = MPT3SAS_TRIGGER_EVENT;
event_data.u.event.EventValue = event; event_data.u.event.EventValue = event;
event_data.u.event.LogEntryQualifier = log_entry_qualifier; event_data.u.event.LogEntryQualifier = log_entry_qualifier;
mpt3sas_send_trigger_data_event(ioc, &event_data); mpt3sas_send_trigger_data_event(ioc, &event_data);
out: out:
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: exit\n", ioc->name, dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: exit\n",
__func__)); __func__));
} }
...@@ -319,9 +318,9 @@ mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key, u8 asc, ...@@ -319,9 +318,9 @@ mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key, u8 asc,
return; return;
} }
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: enter - sense_key = 0x%02x, asc = 0x%02x, ascq = 0x%02x\n", ioc_info(ioc, "%s: enter - sense_key = 0x%02x, asc = 0x%02x, ascq = 0x%02x\n",
ioc->name, __func__, sense_key, asc, ascq)); __func__, sense_key, asc, ascq));
/* don't send trigger if an trigger is currently active */ /* don't send trigger if an trigger is currently active */
if (ioc->diag_trigger_active) { if (ioc->diag_trigger_active) {
...@@ -347,9 +346,9 @@ mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key, u8 asc, ...@@ -347,9 +346,9 @@ mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key, u8 asc,
if (!found_match) if (!found_match)
goto out; goto out;
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: setting diag_trigger_active flag\n", ioc_info(ioc, "%s: setting diag_trigger_active flag\n",
ioc->name, __func__)); __func__));
memset(&event_data, 0, sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T)); memset(&event_data, 0, sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T));
event_data.trigger_type = MPT3SAS_TRIGGER_SCSI; event_data.trigger_type = MPT3SAS_TRIGGER_SCSI;
event_data.u.scsi.SenseKey = sense_key; event_data.u.scsi.SenseKey = sense_key;
...@@ -357,7 +356,7 @@ mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key, u8 asc, ...@@ -357,7 +356,7 @@ mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key, u8 asc,
event_data.u.scsi.ASCQ = ascq; event_data.u.scsi.ASCQ = ascq;
mpt3sas_send_trigger_data_event(ioc, &event_data); mpt3sas_send_trigger_data_event(ioc, &event_data);
out: out:
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: exit\n", ioc->name, dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: exit\n",
__func__)); __func__));
} }
...@@ -393,9 +392,9 @@ mpt3sas_trigger_mpi(struct MPT3SAS_ADAPTER *ioc, u16 ioc_status, u32 loginfo) ...@@ -393,9 +392,9 @@ mpt3sas_trigger_mpi(struct MPT3SAS_ADAPTER *ioc, u16 ioc_status, u32 loginfo)
return; return;
} }
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: enter - ioc_status = 0x%04x, loginfo = 0x%08x\n", ioc_info(ioc, "%s: enter - ioc_status = 0x%04x, loginfo = 0x%08x\n",
ioc->name, __func__, ioc_status, loginfo)); __func__, ioc_status, loginfo));
/* don't send trigger if an trigger is currently active */ /* don't send trigger if an trigger is currently active */
if (ioc->diag_trigger_active) { if (ioc->diag_trigger_active) {
...@@ -420,15 +419,15 @@ mpt3sas_trigger_mpi(struct MPT3SAS_ADAPTER *ioc, u16 ioc_status, u32 loginfo) ...@@ -420,15 +419,15 @@ mpt3sas_trigger_mpi(struct MPT3SAS_ADAPTER *ioc, u16 ioc_status, u32 loginfo)
if (!found_match) if (!found_match)
goto out; goto out;
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT dTriggerDiagPrintk(ioc,
"%s: setting diag_trigger_active flag\n", ioc_info(ioc, "%s: setting diag_trigger_active flag\n",
ioc->name, __func__)); __func__));
memset(&event_data, 0, sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T)); memset(&event_data, 0, sizeof(struct SL_WH_TRIGGERS_EVENT_DATA_T));
event_data.trigger_type = MPT3SAS_TRIGGER_MPI; event_data.trigger_type = MPT3SAS_TRIGGER_MPI;
event_data.u.mpi.IOCStatus = ioc_status; event_data.u.mpi.IOCStatus = ioc_status;
event_data.u.mpi.IocLogInfo = loginfo; event_data.u.mpi.IocLogInfo = loginfo;
mpt3sas_send_trigger_data_event(ioc, &event_data); mpt3sas_send_trigger_data_event(ioc, &event_data);
out: out:
dTriggerDiagPrintk(ioc, pr_info(MPT3SAS_FMT "%s: exit\n", ioc->name, dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: exit\n",
__func__)); __func__));
} }
...@@ -127,20 +127,17 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc, ...@@ -127,20 +127,17 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc,
return; return;
if (ioc->mfg_pg10_hide_flag == MFG_PAGE10_EXPOSE_ALL_DISKS) { if (ioc->mfg_pg10_hide_flag == MFG_PAGE10_EXPOSE_ALL_DISKS) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled globally as drives are exposed\n");
"globally as drives are exposed\n", ioc->name);
return; return;
} }
if (mpt3sas_get_num_volumes(ioc) > 1) { if (mpt3sas_get_num_volumes(ioc) > 1) {
_warpdrive_disable_ddio(ioc); _warpdrive_disable_ddio(ioc);
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled globally as number of drives > 1\n");
"globally as number of drives > 1\n", ioc->name);
return; return;
} }
if ((mpt3sas_config_get_number_pds(ioc, raid_device->handle, if ((mpt3sas_config_get_number_pds(ioc, raid_device->handle,
&num_pds)) || !num_pds) { &num_pds)) || !num_pds) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled Failure in computing number of drives\n");
"Failure in computing number of drives\n", ioc->name);
return; return;
} }
...@@ -148,15 +145,13 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc, ...@@ -148,15 +145,13 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc,
sizeof(Mpi2RaidVol0PhysDisk_t)); sizeof(Mpi2RaidVol0PhysDisk_t));
vol_pg0 = kzalloc(sz, GFP_KERNEL); vol_pg0 = kzalloc(sz, GFP_KERNEL);
if (!vol_pg0) { if (!vol_pg0) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled Memory allocation failure for RVPG0\n");
"Memory allocation failure for RVPG0\n", ioc->name);
return; return;
} }
if ((mpt3sas_config_get_raid_volume_pg0(ioc, &mpi_reply, vol_pg0, if ((mpt3sas_config_get_raid_volume_pg0(ioc, &mpi_reply, vol_pg0,
MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) { MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled Failure in retrieving RVPG0\n");
"Failure in retrieving RVPG0\n", ioc->name);
kfree(vol_pg0); kfree(vol_pg0);
return; return;
} }
...@@ -166,10 +161,8 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc, ...@@ -166,10 +161,8 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc,
* assumed for WARPDRIVE, disable direct I/O * assumed for WARPDRIVE, disable direct I/O
*/ */
if (num_pds > MPT_MAX_WARPDRIVE_PDS) { if (num_pds > MPT_MAX_WARPDRIVE_PDS) {
pr_warn(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_warn(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x): num_mem=%d, max_mem_allowed=%d\n",
"for the drive with handle(0x%04x): num_mem=%d, " raid_device->handle, num_pds, MPT_MAX_WARPDRIVE_PDS);
"max_mem_allowed=%d\n", ioc->name, raid_device->handle,
num_pds, MPT_MAX_WARPDRIVE_PDS);
kfree(vol_pg0); kfree(vol_pg0);
return; return;
} }
...@@ -179,22 +172,18 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc, ...@@ -179,22 +172,18 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc,
vol_pg0->PhysDisk[count].PhysDiskNum) || vol_pg0->PhysDisk[count].PhysDiskNum) ||
le16_to_cpu(pd_pg0.DevHandle) == le16_to_cpu(pd_pg0.DevHandle) ==
MPT3SAS_INVALID_DEVICE_HANDLE) { MPT3SAS_INVALID_DEVICE_HANDLE) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is " ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) member handle retrieval failed for member number=%d\n",
"disabled for the drive with handle(0x%04x) member" raid_device->handle,
"handle retrieval failed for member number=%d\n",
ioc->name, raid_device->handle,
vol_pg0->PhysDisk[count].PhysDiskNum); vol_pg0->PhysDisk[count].PhysDiskNum);
goto out_error; goto out_error;
} }
/* Disable direct I/O if member drive lba exceeds 4 bytes */ /* Disable direct I/O if member drive lba exceeds 4 bytes */
dev_max_lba = le64_to_cpu(pd_pg0.DeviceMaxLBA); dev_max_lba = le64_to_cpu(pd_pg0.DeviceMaxLBA);
if (dev_max_lba >> 32) { if (dev_max_lba >> 32) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is " ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) member handle (0x%04x) unsupported max lba 0x%016llx\n",
"disabled for the drive with handle(0x%04x) member" raid_device->handle,
" handle (0x%04x) unsupported max lba 0x%016llx\n",
ioc->name, raid_device->handle,
le16_to_cpu(pd_pg0.DevHandle), le16_to_cpu(pd_pg0.DevHandle),
(unsigned long long)dev_max_lba); (u64)dev_max_lba);
goto out_error; goto out_error;
} }
...@@ -206,9 +195,7 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc, ...@@ -206,9 +195,7 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc,
* not RAID0 * not RAID0
*/ */
if (raid_device->volume_type != MPI2_RAID_VOL_TYPE_RAID0) { if (raid_device->volume_type != MPI2_RAID_VOL_TYPE_RAID0) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x): type=%d, s_sz=%uK, blk_size=%u\n",
"for the drive with handle(0x%04x): type=%d, "
"s_sz=%uK, blk_size=%u\n", ioc->name,
raid_device->handle, raid_device->volume_type, raid_device->handle, raid_device->volume_type,
(le32_to_cpu(vol_pg0->StripeSize) * (le32_to_cpu(vol_pg0->StripeSize) *
le16_to_cpu(vol_pg0->BlockSize)) / 1024, le16_to_cpu(vol_pg0->BlockSize)) / 1024,
...@@ -219,9 +206,8 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc, ...@@ -219,9 +206,8 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc,
stripe_sz = le32_to_cpu(vol_pg0->StripeSize); stripe_sz = le32_to_cpu(vol_pg0->StripeSize);
stripe_exp = find_first_bit(&stripe_sz, 32); stripe_exp = find_first_bit(&stripe_sz, 32);
if (stripe_exp == 32) { if (stripe_exp == 32) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) invalid stripe sz %uK\n",
"for the drive with handle(0x%04x) invalid stripe sz %uK\n", raid_device->handle,
ioc->name, raid_device->handle,
(le32_to_cpu(vol_pg0->StripeSize) * (le32_to_cpu(vol_pg0->StripeSize) *
le16_to_cpu(vol_pg0->BlockSize)) / 1024); le16_to_cpu(vol_pg0->BlockSize)) / 1024);
goto out_error; goto out_error;
...@@ -230,17 +216,15 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc, ...@@ -230,17 +216,15 @@ mpt3sas_init_warpdrive_properties(struct MPT3SAS_ADAPTER *ioc,
block_sz = le16_to_cpu(vol_pg0->BlockSize); block_sz = le16_to_cpu(vol_pg0->BlockSize);
block_exp = find_first_bit(&block_sz, 16); block_exp = find_first_bit(&block_sz, 16);
if (block_exp == 16) { if (block_exp == 16) {
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled " ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) invalid block sz %u\n",
"for the drive with handle(0x%04x) invalid block sz %u\n", raid_device->handle, le16_to_cpu(vol_pg0->BlockSize));
ioc->name, raid_device->handle,
le16_to_cpu(vol_pg0->BlockSize));
goto out_error; goto out_error;
} }
raid_device->block_exponent = block_exp; raid_device->block_exponent = block_exp;
raid_device->direct_io_enabled = 1; raid_device->direct_io_enabled = 1;
pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is Enabled for the drive" ioc_info(ioc, "WarpDrive : Direct IO is Enabled for the drive with handle(0x%04x)\n",
" with handle(0x%04x)\n", ioc->name, raid_device->handle); raid_device->handle);
/* /*
* WARPDRIVE: Though the following fields are not used for direct IO, * WARPDRIVE: Though the following fields are not used for direct IO,
* stored for future purpose: * stored for future purpose:
......
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