Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jul 2006 04:45:28 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 101430 for review
Message-ID:  <200607130445.k6D4jSQ3046582@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101430

Change 101430 by jb@jb_freebsd2 on 2006/07/13 04:44:53

	Debuging work-in-progress.

Affected files ...

.. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.c#8 edit
.. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.h#9 edit
.. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt_cam.c#4 edit
.. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt_pci.c#6 edit

Differences ...

==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.c#8 (text+ko) ====

@@ -520,7 +520,7 @@
 			handled += pers->event(mpt, req, msg);
 
 		if (handled == 0 && mpt->mpt_pers_mask == 0) {
-			mpt_lprt(mpt, MPT_PRT_INFO,
+		mpt_lprt(mpt, MPT_PRT_INFO,
 				"No Handlers For Any Event Notify Frames. "
 				"Event %#x (ACK %sequired).\n",
 				msg->Event, msg->AckRequired? "r" : "not r");
@@ -668,7 +668,9 @@
 	int ntrips = 0;
 
 	mpt = (struct mpt_softc *)arg;
+#ifdef DOODAD
 	mpt_lprt(mpt, MPT_PRT_DEBUG2, "enter mpt_intr\n");
+#endif
 	while ((reply_desc = mpt_pop_reply_queue(mpt)) != MPT_REPLY_EMPTY) {
 		request_t	  *req;
 		MSG_DEFAULT_REPLY *reply_frame;
@@ -784,7 +786,9 @@
 			break;
 		}
 	}
+#ifdef DOODAD
 	mpt_lprt(mpt, MPT_PRT_DEBUG2, "exit mpt_intr\n");
+#endif
 }
 
 /******************************* Error Recovery *******************************/
@@ -1984,6 +1988,7 @@
 			}
 		}
 	}
+mpt_prt(mpt, "attach was successful!\n");
 	return (0);
 }
 
@@ -2431,7 +2436,7 @@
 			 pfp.MaxDevices);
 
 		mpt->mpt_port_type = pfp.PortType;
-		mpt->mpt_proto_flags = pfp.ProtocolFlags;
+		mpt->mpt_proto_flags = le16toh(pfp.ProtocolFlags);
 		if (pfp.PortType != MPI_PORTFACTS_PORTTYPE_SCSI &&
 		    pfp.PortType != MPI_PORTFACTS_PORTTYPE_SAS &&
 		    pfp.PortType != MPI_PORTFACTS_PORTTYPE_FC) {
@@ -2462,10 +2467,10 @@
 		 */
 
 		mpt->role = MPT_ROLE_NONE;
-		if (pfp.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
+		if (mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_INITIATOR) {
 			mpt->role |= MPT_ROLE_INITIATOR;
 		}
-		if (pfp.ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) {
+		if (mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_TARGET) {
 			mpt->role |= MPT_ROLE_TARGET;
 		}
 		if (mpt->role == MPT_ROLE_NONE) {

==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.h#9 (text+ko) ====


==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt_cam.c#4 (text+ko) ====

@@ -188,6 +188,7 @@
 	if ((mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_INITIATOR) != 0
 	 || (mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_TARGET) != 0
 	 || (mpt->ioc_page2 != NULL && mpt->ioc_page2->MaxPhysDisks != 0)) {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 		return (0);
 	}
 	return (ENODEV);
@@ -201,10 +202,12 @@
 	int		 maxq;
 	int		 error;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	TAILQ_INIT(&mpt->request_timeout_list);
 	maxq = (mpt->mpt_global_credits < MPT_MAX_REQUESTS(mpt))?
 	    mpt->mpt_global_credits : MPT_MAX_REQUESTS(mpt);
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	handler.reply_handler = mpt_scsi_reply_handler;
 	error = mpt_register_handler(mpt, MPT_HANDLER_REPLY, handler,
 				     &scsi_io_handler_id);
@@ -212,6 +215,7 @@
 		goto cleanup0;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	handler.reply_handler = mpt_scsi_tmf_reply_handler;
 	error = mpt_register_handler(mpt, MPT_HANDLER_REPLY, handler,
 				     &scsi_tmf_handler_id);
@@ -219,6 +223,7 @@
 		goto cleanup0;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * If we're fibre channel and could support target mode, we register
 	 * an ELS reply handler and give it resources.
@@ -237,6 +242,7 @@
 		maxq -= mpt->els_cmds_allocated;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * If we support target mode, we register a reply handler for it,
 	 * but don't add resources until we actually enable target mode.
@@ -250,6 +256,7 @@
 		}
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * We keep one request reserved for timeout TMF requests.
 	 */
@@ -260,6 +267,7 @@
 		goto cleanup0;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * Mark the request as free even though not on the free list.
 	 * There is only one TMF request allowed to be outstanding at
@@ -275,6 +283,7 @@
 		goto cleanup0;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * The rest of this is CAM foo, for which we need to drop our lock
 	 */
@@ -290,6 +299,7 @@
 		goto cleanup;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * Construct our SIM entry.
 	 */
@@ -302,6 +312,7 @@
 		goto cleanup;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * Register exactly this bus.
 	 */
@@ -311,6 +322,7 @@
 		goto cleanup;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (xpt_create_path(&mpt->path, NULL, cam_sim_path(mpt->sim),
 	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		mpt_prt(mpt, "Unable to allocate Path!\n");
@@ -318,15 +330,18 @@
 		goto cleanup;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * Only register a second bus for RAID physical
 	 * devices if the controller supports RAID.
 	 */
 	if (mpt->ioc_page2 == NULL || mpt->ioc_page2->MaxPhysDisks == 0) {
 		CAMLOCK_2_MPTLOCK(mpt);
+mpt_prt(mpt, "%s(%d): success\n",__FUNCTION__,__LINE__);
 		return (0);
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * Create a "bus" to export all hidden disks to CAM.
 	 */
@@ -338,6 +353,7 @@
 		goto cleanup;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * Register this bus.
 	 */
@@ -347,6 +363,7 @@
 		goto cleanup;
 	}
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (xpt_create_path(&mpt->phydisk_path, NULL,
 	    cam_sim_path(mpt->phydisk_sim),
 	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
@@ -355,6 +372,7 @@
 		goto cleanup;
 	}
 	CAMLOCK_2_MPTLOCK(mpt);
+mpt_prt(mpt, "%s(%d): success\n",__FUNCTION__,__LINE__);
 	return (0);
 
 cleanup:
@@ -436,6 +454,7 @@
 static int
 mpt_set_initial_config_fc(struct mpt_softc *mpt)
 {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 #if	0
 	CONFIG_PAGE_FC_PORT_1 fc;
 	U32 fl;
@@ -488,6 +507,7 @@
 static int
 mpt_read_config_info_sas(struct mpt_softc *mpt)
 {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	return (0);
 }
 
@@ -497,6 +517,7 @@
 static int
 mpt_set_initial_config_sas(struct mpt_softc *mpt)
 {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	return (0);
 }
 
@@ -508,6 +529,7 @@
 {
 	int rv, i;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_SCSI_PORT, 0, 0,
 	    &mpt->mpt_port_page0.Header, FALSE, 5000);
 	if (rv) {
@@ -654,6 +676,7 @@
 	int i, j, pp1val = ((1 << mpt->mpt_ini_id) << 16) | mpt->mpt_ini_id;
 	int error;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	mpt->mpt_disc_enable = 0xff;
 	mpt->mpt_tag_enable = 0;
 
@@ -711,6 +734,7 @@
 int
 mpt_cam_enable(struct mpt_softc *mpt)
 {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (mpt->is_fc) {
 		if (mpt_read_config_info_fc(mpt)) {
 			return (EIO);
@@ -733,6 +757,7 @@
 			return (EIO);
 		}
 	}
+mpt_prt(mpt, "%s(%d): succeeded\n",__FUNCTION__,__LINE__);
 	return (0);
 }
 
@@ -741,6 +766,7 @@
 {
 	mpt_handler_t handler;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	mpt_terminate_recovery_thread(mpt); 
 
 	handler.reply_handler = mpt_scsi_reply_handler;
@@ -1855,6 +1881,7 @@
 	uint16_t status;
 	uint8_t response;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	error = mpt_scsi_send_tmf(mpt,
 	    (tgt != CAM_TARGET_WILDCARD || lun != CAM_LUN_WILDCARD) ?
 	    MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET :
@@ -1914,6 +1941,7 @@
 	request_t *req;
 	PTR_MSG_FC_PRIMITIVE_SEND_REQUEST fc;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
  	req = mpt_get_request(mpt, FALSE);
 	if (req == NULL) {
 		return (ENOMEM);
@@ -1938,7 +1966,8 @@
 mpt_cam_event(struct mpt_softc *mpt, request_t *req,
 	      MSG_EVENT_NOTIFY_REPLY *msg)
 {
-	switch(msg->Event & 0xFF) {
+printf("%s(%d): msg->Event 0x%x\n",__FUNCTION__,__LINE__,le32toh(msg->Event));
+	switch(le32toh(msg->Event) & 0xFF) {
 	case MPI_EVENT_UNIT_ATTENTION:
 		mpt_prt(mpt, "Bus: 0x%02x TargetID: 0x%02x\n",
 		    (msg->Data[0] >> 8) & 0xff, msg->Data[0] & 0xff);
@@ -2054,7 +2083,7 @@
 		break;
 	default:
 		mpt_lprt(mpt, MPT_PRT_WARN, "mpt_cam_event: 0x%x\n",
-		    msg->Event & 0xFF);
+		    le32toh(msg->Event) & 0xFF);
 		return (0);
 	}
 	return (1);
@@ -2166,6 +2195,7 @@
 	MSG_SCSI_TASK_MGMT_REPLY *tmf_reply;
 
 	KASSERT(req == mpt->tmf_req, ("TMF Reply not using mpt->tmf_req"));
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 #ifdef	INVARIANTS
 	mpt_req_not_spcl(mpt, req, "mpt_scsi_tmf_reply_handler", __LINE__);
 #endif
@@ -2212,6 +2242,7 @@
 	PTR_MSG_LINK_SERVICE_RSP_REQUEST rsp;
 	uint32_t fl;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * We are going to reuse the ELS request to send this response back.
 	 */
@@ -2281,6 +2312,7 @@
 	int ioindex;
 	int do_refresh = TRUE;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 #ifdef	INVARIANTS
 	KASSERT(mpt_req_on_free_list(mpt, req) == 0,
 	    ("fc_els_reply_handler: req %p:%u for function %x on freelist!",
@@ -2520,6 +2552,7 @@
 static void
 mpt_cam_ioc_reset(struct mpt_softc *mpt, int type)
 {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * The pending list is already run down by
 	 * the generic handler.  Perform the same
@@ -3171,6 +3204,7 @@
 	uint8_t dval, pval, oval;
 	int rv;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (xpt_path_sim(cts->ccb_h.path) == mpt->phydisk_sim) {
 		if (mpt_map_physdisk(mpt, (union ccb *)cts, &tgt)) {
 			return (-1);
@@ -3282,6 +3316,7 @@
 {
 	PTR_CONFIG_PAGE_SCSI_DEVICE_1 ptr;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	ptr = &mpt->mpt_dev_page1[tgt];
 	if (onoff) {
 		ptr->RequestedParameters |= MPI_SCSIDEVPAGE1_RP_WIDE;
@@ -3295,6 +3330,7 @@
 {
 	PTR_CONFIG_PAGE_SCSI_DEVICE_1 ptr;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	ptr = &mpt->mpt_dev_page1[tgt];
 	ptr->RequestedParameters &= ~MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK;
 	ptr->RequestedParameters &= ~MPI_SCSIDEVPAGE1_RP_MAX_SYNC_OFFSET_MASK;
@@ -3363,6 +3399,7 @@
 {
 	int error;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	error = mpt_kthread_create(mpt_recovery_thread, mpt,
 	    &mpt->recovery_thread, /*flags*/0,
 	    /*altstack*/0, "mpt_recovery%d", mpt->unit);
@@ -3372,6 +3409,7 @@
 static void
 mpt_terminate_recovery_thread(struct mpt_softc *mpt)
 {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (mpt->recovery_thread == NULL) {
 		return;
 	}
@@ -3421,6 +3459,7 @@
 	MSG_SCSI_TASK_MGMT *tmf_req;
 	int		    error;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * Wait for any current TMF request to complete.
 	 * We're only allowed to issue one TMF at a time.
@@ -3489,6 +3528,7 @@
 	union ccb	   *ccb;
 	int		    error;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (TAILQ_EMPTY(&mpt->request_timeout_list) != 0) {
 		/*
 		 * No work to do- leave.
@@ -3618,6 +3658,7 @@
 	bus_addr_t paddr;
 	uint32_t fl;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	paddr = req->req_pbuf;
 	paddr += MPT_RQSL(mpt);
 
@@ -3666,6 +3707,7 @@
 	PTR_CMD_BUFFER_DESCRIPTOR cb;
 	bus_addr_t paddr;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	paddr = req->req_pbuf;
 	paddr += MPT_RQSL(mpt);
 	memset(req->req_vbuf, 0, MPT_REQUEST_AREA);
@@ -3689,6 +3731,7 @@
 {
 	int i;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (mpt->is_fc == 0) {
 		return (TRUE);
 	}
@@ -3736,6 +3779,7 @@
 {
 	int i, max;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (mpt->tgt_cmd_ptrs) {
 		return (TRUE);
 	}
@@ -3797,6 +3841,7 @@
 static int
 mpt_enable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun)
 {
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) {
 		mpt->twildcard = 1;
 	} else if (lun >= MPT_MAX_LUNS) {
@@ -3829,6 +3874,7 @@
 mpt_disable_lun(struct mpt_softc *mpt, target_id_t tgt, lun_id_t lun)
 {
 	int i;
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (tgt == CAM_TARGET_WILDCARD && lun == CAM_LUN_WILDCARD) {
 		mpt->twildcard = 0;
 	} else if (lun >= MPT_MAX_LUNS) {
@@ -3867,6 +3913,7 @@
 	request_t *cmd_req = MPT_TAG_2_REQ(mpt, csio->tag_id);
 	mpt_tgt_state_t *tgt = MPT_TGT_STATE(mpt, cmd_req);
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	switch (tgt->state) {
 	case TGT_STATE_IN_CAM:
 		break;
@@ -4107,6 +4154,7 @@
 	request_t *req;
 	PTR_MSG_TARGET_MODE_ABORT abtp;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	req = mpt_get_request(mpt, FALSE);
 	if (req == NULL) {
 		return (-1);
@@ -4151,6 +4199,7 @@
 	uint32_t fl;
 	int resplen = 0;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	cmd_vbuf = cmd_req->req_vbuf;
 	cmd_vbuf += MPT_RQSL(mpt);
 	tgt = MPT_TGT_STATE(mpt, cmd_req);
@@ -4299,6 +4348,7 @@
 	struct ccb_immed_notify *inot;
 	mpt_tgt_state_t *tgt;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	tgt = MPT_TGT_STATE(mpt, req);
 	inot = (struct ccb_immed_notify *) STAILQ_FIRST(&trtp->inots);
 	if (inot == NULL) {
@@ -4361,6 +4411,7 @@
 	mpt_task_mgmt_t fct = MPT_NIL_TMT_VALUE;
 	uint8_t *cdbp;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	/*
 	 * First, DMA sync the received command- which is in the *request*
 	 * phys area.
@@ -4585,6 +4636,7 @@
 	union ccb *ccb;
 	U16 status;
 
+mpt_prt(mpt, "%s(%d):\n",__FUNCTION__,__LINE__);
 	if (reply_frame == NULL) {
 		/*
 		 * Figure out what the state of the command is.

==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt_pci.c#6 (text+ko) ====

@@ -243,14 +243,28 @@
 		desc = "LSILogic 1030 Ultra4 Adapter";
 		break;
 	case PCI_PRODUCT_LSI_SAS1064:
+		desc = "LSILogic SAS1064 Adapter";
+		break;
 	case PCI_PRODUCT_LSI_SAS1064A:
+		desc = "LSILogic SAS1064A Adapter";
+		break;
 	case PCI_PRODUCT_LSI_SAS1064E:
+		desc = "LSILogic SAS1064E Adapter";
+		break;
 	case PCI_PRODUCT_LSI_SAS1066:
+		desc = "LSILogic SAS1066 Adapter";
+		break;
 	case PCI_PRODUCT_LSI_SAS1066E:
+		desc = "LSILogic SAS1066E Adapter";
+		break;
 	case PCI_PRODUCT_LSI_SAS1068:
+		desc = "LSILogic SAS1068 Adapter";
+		break;
 	case PCI_PRODUCT_LSI_SAS1068E:
+		desc = "LSILogic SAS1068E Adapter";
+		break;
 	case PCI_PRODUCT_LSI_SAS1078:
-		desc = "LSILogic SAS Adapter";
+		desc = "LSILogic SAS1078 Adapter";
 		break;
 	default:
 		return (ENXIO);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607130445.k6D4jSQ3046582>