Commit 7c3df132 authored by Saurav Kashyap's avatar Saurav Kashyap Committed by James Bottomley

[SCSI] qla2xxx: Code changes to support new dynamic logging infrastructure.

The code is changed to support the new dynamic logging infrastructure.
Following are the levels added.
Default is 0 - no logging.  0x40000000 - Module Init & Probe.
0x20000000 - Mailbox Cmnds. 0x10000000 - Device Discovery.
0x08000000 - IO tracing.    0x04000000 - DPC Thread.
0x02000000 - Async events.  0x01000000 - Timer routines.
0x00800000 - User space.    0x00400000 - Task Management.
0x00200000 - AER/EEH.       0x00100000 - Multi Q.
0x00080000 - P3P Specific.  0x00040000 - Virtual Port.
0x00020000 - Buffer Dump.   0x00010000 - Misc.
0x7fffffff - For enabling all logs, can be too many logs.

Setting ql2xextended_error_logging module parameter to any of the above
value, will enable the debug for that particular level.
Do LOGICAL OR of the value to enable more than one level.
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJoe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: default avatarMadhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 3ce8866c
This diff is collapsed.
This diff is collapsed.
...@@ -11,18 +11,18 @@ ...@@ -11,18 +11,18 @@
* ----------------------------------------------------- * -----------------------------------------------------
* | Level | Last Value Used | * | Level | Last Value Used |
* ----------------------------------------------------- * -----------------------------------------------------
* | Module Init and Probe | 0x0109 | * | Module Init and Probe | 0x0116 |
* | Mailbox commands | 0x1120 | * | Mailbox commands | 0x111e |
* | Device Discovery | 0x207d | * | Device Discovery | 0x2083 |
* | Queue Command and IO tracing | 0x304f | * | Queue Command and IO tracing | 0x302e |
* | DPC Thread | 0x401c | * | DPC Thread | 0x401c |
* | Async Events | 0x5058 | * | Async Events | 0x5059 |
* | Timer Routines | 0x600d | * | Timer Routines | 0x600d |
* | User Space Interactions | 0x70a1 | * | User Space Interactions | 0x709c |
* | Task Management | 0x8032 | * | Task Management | 0x8043 |
* | AER/EEH | 0x9010 | * | AER/EEH | 0x900f |
* | Virtual Port | 0xa007 | * | Virtual Port | 0xa007 |
* | ISP82XX Specific | 0xb028 | * | ISP82XX Specific | 0xb027 |
* | MultiQ | 0xc00b | * | MultiQ | 0xc00b |
* | Misc | 0xd00b | * | Misc | 0xd00b |
* ----------------------------------------------------- * -----------------------------------------------------
...@@ -409,11 +409,11 @@ qla2xxx_dump_post_process(scsi_qla_host_t *vha, int rval) ...@@ -409,11 +409,11 @@ qla2xxx_dump_post_process(scsi_qla_host_t *vha, int rval)
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd000,
"Failed to dump firmware (%x)!!!\n", rval); "Failed to dump firmware (%x).\n", rval);
ha->fw_dumped = 0; ha->fw_dumped = 0;
} else { } else {
qla_printk(KERN_INFO, ha, ql_log(ql_log_info, vha, 0xd001,
"Firmware dump saved to temp buffer (%ld/%p).\n", "Firmware dump saved to temp buffer (%ld/%p).\n",
vha->host_no, ha->fw_dump); vha->host_no, ha->fw_dump);
ha->fw_dumped = 1; ha->fw_dumped = 1;
...@@ -445,15 +445,16 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -445,15 +445,16 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
if (!ha->fw_dump) { if (!ha->fw_dump) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd002,
"No buffer available for dump!!!\n"); "No buffer available for dump.\n");
goto qla2300_fw_dump_failed; goto qla2300_fw_dump_failed;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd003,
"Firmware has been previously dumped (%p) -- ignoring " "Firmware has been previously dumped (%p) "
"request...\n", ha->fw_dump); "-- ignoring request.\n",
ha->fw_dump);
goto qla2300_fw_dump_failed; goto qla2300_fw_dump_failed;
} }
fw = &ha->fw_dump->isp.isp23; fw = &ha->fw_dump->isp.isp23;
...@@ -608,15 +609,16 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -608,15 +609,16 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
if (!ha->fw_dump) { if (!ha->fw_dump) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd004,
"No buffer available for dump!!!\n"); "No buffer available for dump.\n");
goto qla2100_fw_dump_failed; goto qla2100_fw_dump_failed;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd005,
"Firmware has been previously dumped (%p) -- ignoring " "Firmware has been previously dumped (%p) "
"request...\n", ha->fw_dump); "-- ignoring request.\n",
ha->fw_dump);
goto qla2100_fw_dump_failed; goto qla2100_fw_dump_failed;
} }
fw = &ha->fw_dump->isp.isp21; fw = &ha->fw_dump->isp.isp21;
...@@ -805,15 +807,16 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -805,15 +807,16 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
if (!ha->fw_dump) { if (!ha->fw_dump) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd006,
"No buffer available for dump!!!\n"); "No buffer available for dump.\n");
goto qla24xx_fw_dump_failed; goto qla24xx_fw_dump_failed;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd007,
"Firmware has been previously dumped (%p) -- ignoring " "Firmware has been previously dumped (%p) "
"request...\n", ha->fw_dump); "-- ignoring request.\n",
ha->fw_dump);
goto qla24xx_fw_dump_failed; goto qla24xx_fw_dump_failed;
} }
fw = &ha->fw_dump->isp.isp24; fw = &ha->fw_dump->isp.isp24;
...@@ -1043,15 +1046,16 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1043,15 +1046,16 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
if (!ha->fw_dump) { if (!ha->fw_dump) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd008,
"No buffer available for dump!!!\n"); "No buffer available for dump.\n");
goto qla25xx_fw_dump_failed; goto qla25xx_fw_dump_failed;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd009,
"Firmware has been previously dumped (%p) -- ignoring " "Firmware has been previously dumped (%p) "
"request...\n", ha->fw_dump); "-- ignoring request.\n",
ha->fw_dump);
goto qla25xx_fw_dump_failed; goto qla25xx_fw_dump_failed;
} }
fw = &ha->fw_dump->isp.isp25; fw = &ha->fw_dump->isp.isp25;
...@@ -1354,15 +1358,16 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) ...@@ -1354,15 +1358,16 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
if (!ha->fw_dump) { if (!ha->fw_dump) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd00a,
"No buffer available for dump!!!\n"); "No buffer available for dump.\n");
goto qla81xx_fw_dump_failed; goto qla81xx_fw_dump_failed;
} }
if (ha->fw_dumped) { if (ha->fw_dumped) {
qla_printk(KERN_WARNING, ha, ql_log(ql_log_warn, vha, 0xd00b,
"Firmware has been previously dumped (%p) -- ignoring " "Firmware has been previously dumped (%p) "
"request...\n", ha->fw_dump); "-- ignoring request.\n",
ha->fw_dump);
goto qla81xx_fw_dump_failed; goto qla81xx_fw_dump_failed;
} }
fw = &ha->fw_dump->isp.isp81; fw = &ha->fw_dump->isp.isp81;
......
...@@ -64,7 +64,7 @@ qla2x00_dfs_fce_open(struct inode *inode, struct file *file) ...@@ -64,7 +64,7 @@ qla2x00_dfs_fce_open(struct inode *inode, struct file *file)
/* Pause tracing to flush FCE buffers. */ /* Pause tracing to flush FCE buffers. */
rval = qla2x00_disable_fce_trace(vha, &ha->fce_wr, &ha->fce_rd); rval = qla2x00_disable_fce_trace(vha, &ha->fce_wr, &ha->fce_rd);
if (rval) if (rval)
qla_printk(KERN_WARNING, ha, ql_dbg(ql_dbg_user, vha, 0x705c,
"DebugFS: Unable to disable FCE (%d).\n", rval); "DebugFS: Unable to disable FCE (%d).\n", rval);
ha->flags.fce_enabled = 0; ha->flags.fce_enabled = 0;
...@@ -92,7 +92,7 @@ qla2x00_dfs_fce_release(struct inode *inode, struct file *file) ...@@ -92,7 +92,7 @@ qla2x00_dfs_fce_release(struct inode *inode, struct file *file)
rval = qla2x00_enable_fce_trace(vha, ha->fce_dma, ha->fce_bufs, rval = qla2x00_enable_fce_trace(vha, ha->fce_dma, ha->fce_bufs,
ha->fce_mb, &ha->fce_bufs); ha->fce_mb, &ha->fce_bufs);
if (rval) { if (rval) {
qla_printk(KERN_WARNING, ha, ql_dbg(ql_dbg_user, vha, 0x700d,
"DebugFS: Unable to reinitialize FCE (%d).\n", rval); "DebugFS: Unable to reinitialize FCE (%d).\n", rval);
ha->flags.fce_enabled = 0; ha->flags.fce_enabled = 0;
} }
...@@ -125,8 +125,8 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha) ...@@ -125,8 +125,8 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)
atomic_set(&qla2x00_dfs_root_count, 0); atomic_set(&qla2x00_dfs_root_count, 0);
qla2x00_dfs_root = debugfs_create_dir(QLA2XXX_DRIVER_NAME, NULL); qla2x00_dfs_root = debugfs_create_dir(QLA2XXX_DRIVER_NAME, NULL);
if (!qla2x00_dfs_root) { if (!qla2x00_dfs_root) {
qla_printk(KERN_NOTICE, ha, ql_log(ql_log_warn, vha, 0x00f7,
"DebugFS: Unable to create root directory.\n"); "Unable to create debugfs root directory.\n");
goto out; goto out;
} }
...@@ -137,8 +137,8 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha) ...@@ -137,8 +137,8 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)
mutex_init(&ha->fce_mutex); mutex_init(&ha->fce_mutex);
ha->dfs_dir = debugfs_create_dir(vha->host_str, qla2x00_dfs_root); ha->dfs_dir = debugfs_create_dir(vha->host_str, qla2x00_dfs_root);
if (!ha->dfs_dir) { if (!ha->dfs_dir) {
qla_printk(KERN_NOTICE, ha, ql_log(ql_log_warn, vha, 0x00f8,
"DebugFS: Unable to create ha directory.\n"); "Unable to create debugfs ha directory.\n");
goto out; goto out;
} }
...@@ -148,8 +148,8 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha) ...@@ -148,8 +148,8 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)
ha->dfs_fce = debugfs_create_file("fce", S_IRUSR, ha->dfs_dir, vha, ha->dfs_fce = debugfs_create_file("fce", S_IRUSR, ha->dfs_dir, vha,
&dfs_fce_ops); &dfs_fce_ops);
if (!ha->dfs_fce) { if (!ha->dfs_fce) {
qla_printk(KERN_NOTICE, ha, ql_log(ql_log_warn, vha, 0x00f9,
"DebugFS: Unable to fce node.\n"); "Unable to create debugfs fce node.\n");
goto out; goto out;
} }
out: out:
......
...@@ -185,7 +185,7 @@ extern int qla24xx_start_scsi(srb_t *sp); ...@@ -185,7 +185,7 @@ extern int qla24xx_start_scsi(srb_t *sp);
int qla2x00_marker(struct scsi_qla_host *, struct req_que *, struct rsp_que *, int qla2x00_marker(struct scsi_qla_host *, struct req_que *, struct rsp_que *,
uint16_t, uint16_t, uint8_t); uint16_t, uint16_t, uint8_t);
extern int qla2x00_start_sp(srb_t *); extern int qla2x00_start_sp(srb_t *);
extern uint16_t qla24xx_calc_iocbs(uint16_t); extern uint16_t qla24xx_calc_iocbs(scsi_qla_host_t *, uint16_t);
extern void qla24xx_build_scsi_iocbs(srb_t *, struct cmd_type_7 *, uint16_t); extern void qla24xx_build_scsi_iocbs(srb_t *, struct cmd_type_7 *, uint16_t);
extern int qla24xx_dif_start_scsi(srb_t *); extern int qla24xx_dif_start_scsi(srb_t *);
...@@ -481,7 +481,8 @@ extern int qla2x00_loopback_test(scsi_qla_host_t *, struct msg_echo_lb *, uint16 ...@@ -481,7 +481,8 @@ extern int qla2x00_loopback_test(scsi_qla_host_t *, struct msg_echo_lb *, uint16
extern int qla2x00_echo_test(scsi_qla_host_t *, extern int qla2x00_echo_test(scsi_qla_host_t *,
struct msg_echo_lb *, uint16_t *); struct msg_echo_lb *, uint16_t *);
extern int qla24xx_update_all_fcp_prio(scsi_qla_host_t *); extern int qla24xx_update_all_fcp_prio(scsi_qla_host_t *);
extern int qla24xx_fcp_prio_cfg_valid(struct qla_fcp_prio_cfg *, uint8_t); extern int qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *,
struct qla_fcp_prio_cfg *, uint8_t);
/* /*
* Global Function Prototypes in qla_dfs.c source file. * Global Function Prototypes in qla_dfs.c source file.
......
This diff is collapsed.
This diff is collapsed.
...@@ -94,11 +94,11 @@ qla2x00_set_fcport_state(fc_port_t *fcport, int state) ...@@ -94,11 +94,11 @@ qla2x00_set_fcport_state(fc_port_t *fcport, int state)
/* Don't print state transitions during initial allocation of fcport */ /* Don't print state transitions during initial allocation of fcport */
if (old_state && old_state != state) { if (old_state && old_state != state) {
DEBUG(qla_printk(KERN_WARNING, fcport->vha->hw, ql_dbg(ql_dbg_disc, fcport->vha, 0x207d,
"scsi(%ld): FCPort state transitioned from %s to %s - " "FCPort state transitioned from %s to %s - "
"portid=%02x%02x%02x.\n", fcport->vha->host_no, "portid=%02x%02x%02x.\n",
port_state_str[old_state], port_state_str[state], port_state_str[old_state], port_state_str[state],
fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.domain, fcport->d_id.b.area,
fcport->d_id.b.al_pa)); fcport->d_id.b.al_pa);
} }
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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