From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58C34C04AAF for ; Tue, 21 May 2019 16:04:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D3A32173E for ; Tue, 21 May 2019 16:04:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n8itc6Kp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728221AbfEUQE2 (ORCPT ); Tue, 21 May 2019 12:04:28 -0400 Received: from mail-pl1-f181.google.com ([209.85.214.181]:41967 "EHLO mail-pl1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbfEUQE2 (ORCPT ); Tue, 21 May 2019 12:04:28 -0400 Received: by mail-pl1-f181.google.com with SMTP id f12so8652691plt.8 for ; Tue, 21 May 2019 09:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nk+/ciJTmIcBRGNtwKGKAlhXjyIqj/WCax4ZAyWNJvI=; b=n8itc6KpW9b62d7kZTafU9Be8Rh6F3YYh0MblP5v2Rd3atB0SxQyAo+DvmdmP+IL0R Ti0i4Ry9D7v/OBhYDoRsK6Zs8SnwsSMrz8XebxeNVkjS1CV0YwkyjX13IlgXGUOw3B6V nVL7MAFl0h/IGpEO72nqYRMyhRLiUo1DAxWluV6a8BPXmpHArCgujY7t/5xCJdgj3CBP EjtSZWYrcWw/AxoepLPYIFWeeLk1gY+Kj1C5bG+f7d8yAgbS3zoVVd1ua8RcV5bM6CTf sEvp7jpYUF3HV8J5wPHuL+khaX2bVmtd+9JJ8ddmZl/TlXVI24O76xeFZ8ERRHZrQwGF n4cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nk+/ciJTmIcBRGNtwKGKAlhXjyIqj/WCax4ZAyWNJvI=; b=m55atzbmr5To3kLw88CmcMK8cxw+H3YwK1O5Wfwcjh+1X/S0mLIYUsaqDnVAN9KRB7 2k7k4Fcro73v23w+RKJKmJwWWR7DeHwe3HSoqwUmv6SIBMyOn6yIciris88XQg72xaU8 wgUZJLkD/FQ3Z/qUcN3IOhjPZIXTREL3v3GvhyUEsU3RCtHb4h5c0oophXNjwhwCCA7D Xzd35gXYXCEuIsWC+a4wUlxHTKWwcR1BYKJILfaBGzllvsF5DcT/tIE4XblWgWosuIKs CFgFcdECiGmBVggFSIX6du5gRvXSKit9rqY7IkBEAqcH1jeoxaTN/rHEr4Ebe+L1dXjK kTOg== X-Gm-Message-State: APjAAAXCN4u7mmt8+l0X0L9RlPeuNpiJxZ189y/Ax99MPo8ZF4W1fQhV gN29XihHJwQYsvhL8e6Z9NE= X-Google-Smtp-Source: APXvYqxRakC6491Var96axSgPs7513lbbFuXi1FP2lOh833bGTyI8P9IlnxdSUuvQR3n5FsuxgeA6A== X-Received: by 2002:a17:902:1021:: with SMTP id b30mr45020517pla.324.1558454667844; Tue, 21 May 2019 09:04:27 -0700 (PDT) Received: from mita-MS-7A45.lan ([240f:34:212d:1:9cd0:73e8:b74a:624e]) by smtp.gmail.com with ESMTPSA id j5sm28954786pfa.15.2019.05.21.09.04.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 May 2019 09:04:27 -0700 (PDT) From: Akinobu Mita To: linux-nvme@lists.infradead.org, linux-pm@vger.kernel.org Cc: Akinobu Mita , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Minwoo Im , Kenneth Heitke , Chaitanya Kulkarni Subject: [PATCH v2 0/4] nvme: add thermal zone devices Date: Wed, 22 May 2019 01:04:05 +0900 Message-Id: <1558454649-28783-1-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The NVMe controller reports up to nine temperature values in the SMART / Health log page (the composite temperature and temperature sensor 1 through temperature sensor 8). The temperature threshold feature (Feature Identifier 04h) configures the asynchronous event request command to complete when the temperature is crossed its corresponding temperature threshold. This provide these temperatures and thresholds via thermal zone devices. * v2 - s/correspoinding/corresponding/ typo in commit log - Borrowed nvme_get_features() from Keith's patch - Temperature threshold notification is splitted into another patch - Change the data type of 'sensor' to unsigned - Add BUILD_BUG_ON for the array size of tzdev member in nvme_ctrl - Add WARN_ON_ONCE for paranoid checks - Fix off-by-one error in nvme_get_temp - Validate 'sensor' where the value is actually used - Define and utilize two enums related to the temperature threshold feature - Remove hysteresis value for this trip point and don't utilize the under temperature threshold - Print error message for thermal_zone_device_register() failure - Add function comments for nvme_thermal_zones_{,un}register - Suppress non-fatal errors from nvme_thermal_zones_register() - Add comment about implemented temperature sensors - Instead of creating a new 'thermal_work', append async smart event's action to the existing async_event_work - Add comment for tzdev member in nvme_ctrl - Call nvme_thermal_zones_unregister() earlier than the last reference release Akinobu Mita (3): nvme: add thermal zone infrastructure nvme: notify thermal framework when temperature threshold events occur nvme-pci: support thermal zone Keith Busch (1): nvme: Export get and set features drivers/nvme/host/core.c | 317 ++++++++++++++++++++++++++++++++++++++++++++++- drivers/nvme/host/nvme.h | 31 +++++ drivers/nvme/host/pci.c | 5 + include/linux/nvme.h | 12 ++ 4 files changed, 362 insertions(+), 3 deletions(-) Cc: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Keith Busch Cc: Jens Axboe Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Minwoo Im Cc: Kenneth Heitke Cc: Chaitanya Kulkarni -- 2.7.4