Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2013 15:49:15 +0000 (UTC)
From:      Jim Harris <jimharris@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256153 - head/sys/dev/nvme
Message-ID:  <201310081549.r98FnFkg098300@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jimharris
Date: Tue Oct  8 15:49:14 2013
New Revision: 256153
URL: http://svnweb.freebsd.org/changeset/base/256153

Log:
  Do not enable temperature threshold as an asynchronous event notification
  on NVMe controllers that do not support it.
  
  Sponsored by:	Intel
  Reviewed by:	carl
  Approved by:	re (hrs)
  MFC after:	1 week

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c	Tue Oct  8 15:47:22 2013	(r256152)
+++ head/sys/dev/nvme/nvme_ctrlr.c	Tue Oct  8 15:49:14 2013	(r256153)
@@ -708,12 +708,26 @@ nvme_ctrlr_construct_and_submit_aer(stru
 static void
 nvme_ctrlr_configure_aer(struct nvme_controller *ctrlr)
 {
+	struct nvme_completion_poll_status	status;
 	union nvme_critical_warning_state	state;
 	struct nvme_async_event_request		*aer;
 	uint32_t				i;
 
 	state.raw = 0xFF;
 	state.bits.reserved = 0;
+
+	status.done = FALSE;
+	nvme_ctrlr_cmd_get_feature(ctrlr, NVME_FEAT_TEMPERATURE_THRESHOLD,
+	    0, NULL, 0, nvme_completion_poll_cb, &status);
+	while (status.done == FALSE)
+		pause("nvme", 1);
+	if (nvme_completion_is_error(&status.cpl) ||
+	    (status.cpl.cdw0 & 0xFFFF) == 0xFFFF ||
+	    (status.cpl.cdw0 & 0xFFFF) == 0x0000) {
+		nvme_printf(ctrlr, "temperature threshold not supported\n");
+		state.bits.temperature = 0;
+	}
+
 	nvme_ctrlr_cmd_set_async_event_config(ctrlr, state, NULL, NULL);
 
 	/* aerl is a zero-based value, so we need to add 1 here. */



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