From owner-svn-src-head@FreeBSD.ORG Tue Oct 8 15:49:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 89142D13; Tue, 8 Oct 2013 15:49:15 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 767412C1F; Tue, 8 Oct 2013 15:49:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r98FnFYY098301; Tue, 8 Oct 2013 15:49:15 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r98FnFkg098300; Tue, 8 Oct 2013 15:49:15 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201310081549.r98FnFkg098300@svn.freebsd.org> From: Jim Harris Date: Tue, 8 Oct 2013 15:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256153 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Oct 2013 15:49:15 -0000 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. */