Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7c255b2 authored by James Smart's avatar James Smart Committed by James Bottomley
Browse files

[SCSI] lpfc 8.2.8 : Miscellaneous Bug Fixes



Miscellaneous Fixes:
- Fix the wrong variable name used for checking node active usage status
- Fix numerous duplicate log message numbers
- Fix change KERN_WARNING messages to KERN_INFO.
- Stop sending erroneous LOGO to fabric after vport is already terminated
- Fix HBQ allocates that were kalloc'ing w/ GFP_KERNEL while holding a lock.
- Fix gcc 4.3.2 compiler warnings and a sparse warning
- Fix bugs in handling unsolicited ct event queue
- Reorder some of the initial link up checks, to remove odd VPI states.
- Correct poor VPI handling
- Add debug messages
- Expand Update_CFG mailbox definition
- Fix handling of VPD data offsets
- Reorder loopback flags
- convert to use offsetof()

Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 34b02dcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ struct lpfc_hba {

	wait_queue_head_t    work_waitq;
	struct task_struct   *worker_thread;
	long data_flags;
	unsigned long data_flags;

	uint32_t hbq_in_use;		/* HBQs in use flag */
	struct list_head hbqbuf_in_list;  /* in-fly hbq buffer list */
+15 −17
Original line number Diff line number Diff line
@@ -1302,7 +1302,7 @@ lpfc_##attr##_init(struct lpfc_vport *vport, int val) \
		return 0;\
	}\
	lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, \
			 "0449 lpfc_"#attr" attribute cannot be set to %d, "\
			 "0423 lpfc_"#attr" attribute cannot be set to %d, "\
			 "allowed range is ["#minval", "#maxval"]\n", val); \
	vport->cfg_##attr = default;\
	return -EINVAL;\
@@ -1334,7 +1334,7 @@ lpfc_##attr##_set(struct lpfc_vport *vport, int val) \
		return 0;\
	}\
	lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, \
			 "0450 lpfc_"#attr" attribute cannot be set to %d, "\
			 "0424 lpfc_"#attr" attribute cannot be set to %d, "\
			 "allowed range is ["#minval", "#maxval"]\n", val); \
	return -EINVAL;\
}
@@ -1803,7 +1803,7 @@ lpfc_nodev_tmo_init(struct lpfc_vport *vport, int val)
		vport->cfg_nodev_tmo = vport->cfg_devloss_tmo;
		if (val != LPFC_DEF_DEVLOSS_TMO)
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
					 "0402 Ignoring nodev_tmo module "
					 "0407 Ignoring nodev_tmo module "
					 "parameter because devloss_tmo is "
					 "set.\n");
		return 0;
@@ -2030,7 +2030,7 @@ lpfc_restrict_login_init(struct lpfc_vport *vport, int val)
{
	if (val < 0 || val > 1) {
		lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				 "0449 lpfc_restrict_login attribute cannot "
				 "0422 lpfc_restrict_login attribute cannot "
				 "be set to %d, allowed range is [0, 1]\n",
				 val);
		vport->cfg_restrict_login = 1;
@@ -2065,7 +2065,7 @@ lpfc_restrict_login_set(struct lpfc_vport *vport, int val)
{
	if (val < 0 || val > 1) {
		lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				 "0450 lpfc_restrict_login attribute cannot "
				 "0425 lpfc_restrict_login attribute cannot "
				 "be set to %d, allowed range is [0, 1]\n",
				 val);
		vport->cfg_restrict_login = 1;
@@ -2249,7 +2249,7 @@ lpfc_link_speed_init(struct lpfc_hba *phba, int val)
		return 0;
	}
	lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
			"0454 lpfc_link_speed attribute cannot "
			"0405 lpfc_link_speed attribute cannot "
			"be set to %d, allowed values are "
			"["LPFC_LINK_SPEED_STRING"]\n", val);
	phba->cfg_link_speed = 0;
@@ -2787,17 +2787,15 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
		/* If HBA encountered an error attention, allow only DUMP
		 * or RESTART mailbox commands until the HBA is restarted.
		 */
		if ((phba->pport->stopped) &&
			(phba->sysfs_mbox.mbox->mb.mbxCommand !=
				MBX_DUMP_MEMORY &&
			 phba->sysfs_mbox.mbox->mb.mbxCommand !=
				MBX_RESTART &&
			 phba->sysfs_mbox.mbox->mb.mbxCommand !=
				MBX_WRITE_VPARMS)) {
			sysfs_mbox_idle(phba);
			spin_unlock_irq(&phba->hbalock);
			return -EPERM;
		}
		if (phba->pport->stopped &&
		    phba->sysfs_mbox.mbox->mb.mbxCommand != MBX_DUMP_MEMORY &&
		    phba->sysfs_mbox.mbox->mb.mbxCommand != MBX_RESTART &&
		    phba->sysfs_mbox.mbox->mb.mbxCommand != MBX_WRITE_VPARMS &&
		    phba->sysfs_mbox.mbox->mb.mbxCommand != MBX_WRITE_WWN)
			lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
					"1259 mbox: Issued mailbox cmd "
					"0x%x while in stopped state.\n",
					phba->sysfs_mbox.mbox->mb.mbxCommand);

		phba->sysfs_mbox.mbox->vport = vport;

+1 −1
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ void lpfc_dev_loss_tmo_callbk(struct fc_rport *rport);

struct lpfc_vport *lpfc_create_port(struct lpfc_hba *, int, struct device *);
int  lpfc_vport_disable(struct fc_vport *fc_vport, bool disable);
void lpfc_mbx_unreg_vpi(struct lpfc_vport *);
int lpfc_mbx_unreg_vpi(struct lpfc_vport *);
void destroy_port(struct lpfc_vport *);
int lpfc_get_instance(void);
void lpfc_host_attrib_init(struct Scsi_Host *);
+7 −8
Original line number Diff line number Diff line
@@ -134,25 +134,24 @@ lpfc_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
		}
		list_del(&head);
	} else {
		struct lpfc_iocbq  *next;

		list_for_each_entry_safe(iocbq, next, &piocbq->list, list) {
		INIT_LIST_HEAD(&head);
		list_add_tail(&head, &piocbq->list);
		list_for_each_entry(iocbq, &head, list) {
			icmd = &iocbq->iocb;
			if (icmd->ulpBdeCount == 0)
				lpfc_ct_unsol_buffer(phba, piocbq, NULL, 0);
				lpfc_ct_unsol_buffer(phba, iocbq, NULL, 0);
			for (i = 0; i < icmd->ulpBdeCount; i++) {
				paddr = getPaddr(icmd->un.cont64[i].addrHigh,
						 icmd->un.cont64[i].addrLow);
				mp = lpfc_sli_ringpostbuf_get(phba, pring,
							      paddr);
				size = icmd->un.cont64[i].tus.f.bdeSize;
				lpfc_ct_unsol_buffer(phba, piocbq, mp, size);
				lpfc_ct_unsol_buffer(phba, iocbq, mp, size);
				lpfc_in_buf_free(phba, mp);
			}
			list_del(&iocbq->list);
			lpfc_sli_release_iocbq(phba, iocbq);
			lpfc_post_buffer(phba, pring, i);
		}
		list_del(&head);
	}
}

@@ -861,7 +860,7 @@ lpfc_cmpl_ct(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,

		retry++;
		lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
				 "0216 Retrying NS cmd %x\n", cmdcode);
				 "0250 Retrying NS cmd %x\n", cmdcode);
		rc = lpfc_ns_cmd(vport, cmdcode, retry, 0);
		if (rc == 0)
			goto out;
+10 −10
Original line number Diff line number Diff line
@@ -1119,7 +1119,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
		atomic_set(&lpfc_debugfs_hba_count, 0);
		if (!lpfc_debugfs_root) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
					 "0409 Cannot create debugfs root\n");
					 "0408 Cannot create debugfs root\n");
			goto debug_failed;
		}
	}
@@ -1133,7 +1133,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
			debugfs_create_dir(name, lpfc_debugfs_root);
		if (!phba->hba_debugfs_root) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
					 "0409 Cannot create debugfs hba\n");
					 "0412 Cannot create debugfs hba\n");
			goto debug_failed;
		}
		atomic_inc(&lpfc_debugfs_hba_count);
@@ -1147,7 +1147,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
				 phba, &lpfc_debugfs_op_hbqinfo);
		if (!phba->debug_hbqinfo) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				"0409 Cannot create debugfs hbqinfo\n");
				"0411 Cannot create debugfs hbqinfo\n");
			goto debug_failed;
		}

@@ -1159,7 +1159,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
				 phba, &lpfc_debugfs_op_dumpHBASlim);
		if (!phba->debug_dumpHBASlim) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				"0409 Cannot create debugfs dumpHBASlim\n");
				"0413 Cannot create debugfs dumpHBASlim\n");
			goto debug_failed;
		}

@@ -1171,7 +1171,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
				 phba, &lpfc_debugfs_op_dumpHostSlim);
		if (!phba->debug_dumpHostSlim) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				"0409 Cannot create debugfs dumpHostSlim\n");
				"0414 Cannot create debugfs dumpHostSlim\n");
			goto debug_failed;
		}

@@ -1201,7 +1201,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
				 phba, &lpfc_debugfs_op_slow_ring_trc);
		if (!phba->debug_slow_ring_trc) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
					 "0409 Cannot create debugfs "
					 "0415 Cannot create debugfs "
					 "slow_ring_trace\n");
			goto debug_failed;
		}
@@ -1212,7 +1212,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
				GFP_KERNEL);
			if (!phba->slow_ring_trc) {
				lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
						 "0409 Cannot create debugfs "
						 "0416 Cannot create debugfs "
						 "slow_ring buffer\n");
				goto debug_failed;
			}
@@ -1229,7 +1229,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
			debugfs_create_dir(name, phba->hba_debugfs_root);
		if (!vport->vport_debugfs_root) {
			lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
					 "0409 Cant create debugfs");
					 "0417 Cant create debugfs");
			goto debug_failed;
		}
		atomic_inc(&phba->debugfs_vport_count);
@@ -1258,7 +1258,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)

	if (!vport->disc_trc) {
		lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				 "0409 Cannot create debugfs disc trace "
				 "0418 Cannot create debugfs disc trace "
				 "buffer\n");
		goto debug_failed;
	}
@@ -1271,7 +1271,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
				 vport, &lpfc_debugfs_op_disc_trc);
	if (!vport->debug_disc_trc) {
		lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
				 "0409 Cannot create debugfs "
				 "0419 Cannot create debugfs "
				 "discovery_trace\n");
		goto debug_failed;
	}
Loading