Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Feb 2013 23:46:20 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r247362 - in user/attilio/vmc-playground: sbin/reboot sys/dev/cxgbe/common sys/dev/isp sys/vm
Message-ID:  <201302262346.r1QNkKOA012414@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Tue Feb 26 23:46:19 2013
New Revision: 247362
URL: http://svnweb.freebsd.org/changeset/base/247362

Log:
  Merge from vmcontention

Modified:
  user/attilio/vmc-playground/sbin/reboot/boot_i386.8
  user/attilio/vmc-playground/sys/dev/cxgbe/common/t4_hw.c
  user/attilio/vmc-playground/sys/dev/isp/isp_freebsd.c
  user/attilio/vmc-playground/sys/vm/uma_int.h
Directory Properties:
  user/attilio/vmc-playground/   (props changed)
  user/attilio/vmc-playground/sbin/   (props changed)
  user/attilio/vmc-playground/sys/   (props changed)

Modified: user/attilio/vmc-playground/sbin/reboot/boot_i386.8
==============================================================================
--- user/attilio/vmc-playground/sbin/reboot/boot_i386.8	Tue Feb 26 23:43:28 2013	(r247361)
+++ user/attilio/vmc-playground/sbin/reboot/boot_i386.8	Tue Feb 26 23:46:19 2013	(r247362)
@@ -220,15 +220,14 @@ you can use the
 option to force the kernel to use the serial port as its
 console device.
 The serial port driver
-.Xr uart 4
+.Xr sio 4
+(but not
+.Xr uart 4 )
 has a flag (0x20) to override this option.
 If that flag is set, the serial port will always be used as the console,
 regardless of the
 .Fl h
 option described here.
-See the man page for
-.Xr uart 4
-for more details.
 .It Fl m
 mute the console to suppress all console input and output during the
 boot.

Modified: user/attilio/vmc-playground/sys/dev/cxgbe/common/t4_hw.c
==============================================================================
--- user/attilio/vmc-playground/sys/dev/cxgbe/common/t4_hw.c	Tue Feb 26 23:43:28 2013	(r247361)
+++ user/attilio/vmc-playground/sys/dev/cxgbe/common/t4_hw.c	Tue Feb 26 23:46:19 2013	(r247362)
@@ -154,6 +154,36 @@ u32 t4_hw_pci_read_cfg4(adapter_t *adap,
 }
 
 /*
+ *	t4_report_fw_error - report firmware error
+ *	@adap: the adapter
+ *
+ *	The adapter firmware can indicate error conditions to the host.
+ *	This routine prints out the reason for the firmware error (as
+ *	reported by the firmware).
+ */
+static void t4_report_fw_error(struct adapter *adap)
+{
+	static const char *reason[] = {
+		"Crash",			/* PCIE_FW_EVAL_CRASH */
+		"During Device Preparation",	/* PCIE_FW_EVAL_PREP */
+		"During Device Configuration",	/* PCIE_FW_EVAL_CONF */
+		"During Device Initialization",	/* PCIE_FW_EVAL_INIT */
+		"Unexpected Event",		/* PCIE_FW_EVAL_UNEXPECTEDEVENT */
+		"Insufficient Airflow",		/* PCIE_FW_EVAL_OVERHEAT */
+		"Device Shutdown",		/* PCIE_FW_EVAL_DEVICESHUTDOWN */
+		"Reserved",			/* reserved */
+	};
+	u32 pcie_fw;
+
+	pcie_fw = t4_read_reg(adap, A_PCIE_FW);
+	if (!(pcie_fw & F_PCIE_FW_ERR))
+		CH_ERR(adap, "Firmware error report called with no error\n");
+	else
+		CH_ERR(adap, "Firmware reports adapter error: %s\n",
+		       reason[G_PCIE_FW_EVAL(pcie_fw)]);
+}
+
+/*
  * Get the reply to a mailbox command and store it in @rpl in big-endian order.
  */
 static void get_mbox_rpl(struct adapter *adap, __be64 *rpl, int nflit,
@@ -267,8 +297,15 @@ int t4_wr_mbox_meat(struct adapter *adap
 		}
 	}
 
+	/*
+	 * We timed out waiting for a reply to our mailbox command.  Report
+	 * the error and also check to see if the firmware reported any
+	 * errors ...
+	 */
 	CH_ERR(adap, "command %#x in mailbox %d timed out\n",
 	       *(const u8 *)cmd, mbox);
+	if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
+		t4_report_fw_error(adap);
 	return -ETIMEDOUT;
 }
 
@@ -2033,9 +2070,11 @@ static void cim_intr_handler(struct adap
 		{ F_TIMEOUTMAINT , "CIM PIF MA timeout", -1, 1 },
 		{ 0 }
 	};
-
 	int fat;
 
+	if (t4_read_reg(adapter, A_PCIE_FW) & F_PCIE_FW_ERR)
+		t4_report_fw_error(adapter);
+
 	fat = t4_handle_intr_status(adapter, A_CIM_HOST_INT_CAUSE,
 				    cim_intr_info) +
 	      t4_handle_intr_status(adapter, A_CIM_HOST_UPACC_INT_CAUSE,
@@ -4103,12 +4142,16 @@ retry:
 	/*
 	 * Issue the HELLO command to the firmware.  If it's not successful
 	 * but indicates that we got a "busy" or "timeout" condition, retry
-	 * the HELLO until we exhaust our retry limit.
+	 * the HELLO until we exhaust our retry limit.  If we do exceed our
+	 * retry limit, check to see if the firmware left us any error
+	 * information and report that if so ...
 	 */
 	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
 	if (ret != FW_SUCCESS) {
 		if ((ret == -EBUSY || ret == -ETIMEDOUT) && retries-- > 0)
 			goto retry;
+		if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR)
+			t4_report_fw_error(adap);
 		return ret;
 	}
 

Modified: user/attilio/vmc-playground/sys/dev/isp/isp_freebsd.c
==============================================================================
--- user/attilio/vmc-playground/sys/dev/isp/isp_freebsd.c	Tue Feb 26 23:43:28 2013	(r247361)
+++ user/attilio/vmc-playground/sys/dev/isp/isp_freebsd.c	Tue Feb 26 23:46:19 2013	(r247362)
@@ -4140,8 +4140,6 @@ isp_target_thread(ispsoftc_t *isp, int c
 		return;
 	}
 
-	ccb = xpt_alloc_ccb();
-
 	ISP_LOCK(isp);
 	status = cam_periph_alloc(isptargctor, NULL, isptargdtor, isptargstart, "isptarg", CAM_PERIPH_BIO, wpath, NULL, 0, softc);
 	if (status != CAM_REQ_CMP) {

Modified: user/attilio/vmc-playground/sys/vm/uma_int.h
==============================================================================
--- user/attilio/vmc-playground/sys/vm/uma_int.h	Tue Feb 26 23:43:28 2013	(r247361)
+++ user/attilio/vmc-playground/sys/vm/uma_int.h	Tue Feb 26 23:46:19 2013	(r247362)
@@ -221,8 +221,8 @@ struct uma_keg {
 	uma_alloc	uk_allocf;	/* Allocation function */
 	uma_free	uk_freef;	/* Free routine */
 
-	u_long		uk_offset;	/* Zone specific next page index */
-	vm_offset_t	uk_kva;		/* Zone base kva */
+	u_long		uk_offset;	/* Next free offset from base KVA */
+	vm_offset_t	uk_kva;		/* Zone base KVA */
 	uma_zone_t	uk_slabzone;	/* Slab zone backing us, if OFFPAGE */
 
 	u_int16_t	uk_pgoff;	/* Offset to uma_slab struct */



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