Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp419102pxb; Mon, 13 Sep 2021 23:55:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZYxGYimQHd6MZUQMPDxUjzeBumoIgh6yjyVbg/BMj9fCTksp7C20ws+VkGFKeRQkvshnS X-Received: by 2002:a17:906:5acb:: with SMTP id x11mr16832246ejs.514.1631602531254; Mon, 13 Sep 2021 23:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631602531; cv=none; d=google.com; s=arc-20160816; b=u9NvB3d7YU6KxaJ7QIpmgFDfSclxblPrVZrBPvGF3bXa1PjK3AfMhjnCIFSaWTsF23 eWbeWZSHgYf16Y5b+8Y0AwQ5C3/9tzIrGkhRH3RA1zDCi7/Vle1HC04vQ7mAA5ra3GZh aFT1tERLZkJ0NWSFhqN64ZvWNLVffrdetwlBfZ4b6/fRsepCmJzSn6KXZpo0dMAFIHvt RvAXI37+/QTXh8fWf06Gi6wTdFGfXYy26t5wLumfcL9oyp3gRJcl81k1ILZVTIZZd3yM dseAirOS7yw1IqZ4nvwiWvzT5reRiyhd0OloY3BEGO4bqQh55xLba76/FtpuVlNbc0fZ NZww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:wdcironportexception :ironport-sdr:ironport-sdr:dkim-signature; bh=jSvq32tpEWIdbUVKqQUZHRITNMgO3EAFW9558AghyLA=; b=huxBpuqmsmNzGbwH6/hsClD7VVwQxFCQZJX9bacEVmrDP0vQ75LLWrTuhDeuBTOpWa 73A/Fqz6jz9YWdbzmsqlTGKp6GQBcLYGoU0TxUI6syz1EVPJCRarLOgUhd+w/y3IydoJ lrg0q2ElOIlum0mD3PdpVfgrvpUgpZcV2JOB/szyX1hO9hdjNGYJ7iSe7kmDPNYaKDOr vccFJ/qMrBdUHXO9jjiWdx90NEekU9+Bo+QRNvaFhKiADQ2UFIJ51meKz4MsfxRAiNW7 e4ns0G1nPHDrJ4sebQ6FZlUZVtLjd4npmG4ocg5OcEe2Z1OtQthY4JL+7HGvNKoEe7DE qH6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=aZk6J6TU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si9505477edh.510.2021.09.13.23.55.08; Mon, 13 Sep 2021 23:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=aZk6J6TU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240350AbhINGzA (ORCPT + 99 others); Tue, 14 Sep 2021 02:55:00 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:42280 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240302AbhINGyt (ORCPT ); Tue, 14 Sep 2021 02:54:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1631602412; x=1663138412; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=SGJX1LrjKYTDbjRR737j360XKyT3Ftxf17YTpt7/n1I=; b=aZk6J6TUnTktMnn3uYTwPiE8G9zNbVm0wBRiLw88I1M/z3MXYS6Rl9rU cA/UgKljkTisyQxJ9qVIQ0CXabHOgVOzvcP1h6hhnRGtUEVNMOurHo7gv ztTPByTUURj9P/pJDOlkwOOeXeRgem179hMy+orYfcfqqz++giEf+cWK0 7RUPQygxJ8HTdZl0MB1WSJUM6yBrTMW6JHCiODhZiji1+px24EIaw6d/K XczYGz8uxZNDEVFRcXae0z0U1Z+WGbSeqQR5lxlHqxlXRFl6qMsy0f2k5 MCcvzxlidyYYIYWatfJ0cWEW4JNllUgAT6LMDHYGVI/m3lyD1AyOH5ezt Q==; X-IronPort-AV: E=Sophos;i="5.85,292,1624291200"; d="scan'208";a="291560750" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 14 Sep 2021 14:53:29 +0800 IronPort-SDR: 53IDxdrOlpTyyWNmB1RF4m9ABjvQmqCtesExDxgyRMzrfC/MGuuD8gR4t+1Z9r58/9Qhl0FDvB YEN/rcbhhf25Yb9XRZaNFT9ChdcqthtLxRQlqMLWcUzg3VvxFHplCby2hv7EnNe+zh7nwqIvCx t9L7VRrNOMTWnj9VhAFpOUBnSwzQIcMIui4yPfkq+76XV24iY1WUWvGfNBavOTPKmXZNGMVjcU 1yi0DG75Hyl/4/CS5VUa6SJCbPnrQwqvBRPsXlHMy7kzmX7XXezcI/VFa4aI4ZGPGOHhPnga5m iBr498Dv3s1ybDPQV0MZCfvV Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 23:29:53 -0700 IronPort-SDR: TqNljYPp4YvDcILfpJQtE0hi3he4Q4VBGnARkZPkRlOqpEvR5NFDRl212rdtb1qvW9TQwXqePV XL9bra7zl6wtzd8Ap7FMD8ROP0gk9Qw1VLPOd+5sy1a5fhHbqHFpwXjW43Qur1By5SiT4Ai4jE yYfaGVW6yFKdF2rKGXN6JsIFhl+oM/ZmOpWc4gPvZfQn5v0lnZ7v9BnUhvJv8G8Oor3UYfZ+X7 wSrKFv7Mgo4F1ID6YzTJ5VaBtsV8zmx83VcQFk0I0b+j35Sp99Rg3mvKffyWpUDGzPMspN+z1w hx4= WDCIronportException: Internal Received: from bxygm33.sdcorp.global.sandisk.com (HELO BXYGM33.ad.shared) ([10.0.231.247]) by uls-op-cesaip02.wdc.com with ESMTP; 13 Sep 2021 23:53:26 -0700 From: Avri Altman To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bart Van Assche , Adrian Hunter , Bean Huo , Guenter Roeck , Avri Altman Subject: [PATCH v5 0/2] Add temperature notification support Date: Tue, 14 Sep 2021 09:53:18 +0300 Message-Id: <20210914065320.8554-1-avri.altman@wdc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v4 - > v5: - Fix improper return error values v3 -> v4: - Attend Guenter's comments v2 -> v3: - Attend Bart's & Guenter's comments v1 -> v2: - Add a hw monitor device if both the platform & the device support it - Remove the sysfs patch: no need to duplicate /sys/class/hwmon UFS3.0 allows using the ufs device as a temperature sensor. The purpose of this optional feature is to provide notification to the host of the UFS device case temperature. It allows reading of a rough estimate (+-10 degrees centigrade) of the current case temperature, and setting a lower and upper temperature bounds, in which the device will trigger an applicable exception event. A previous attempt [1] tried a comprehensive approach. Still, it was unsuccessful. Here is a more modest approach that introduces just the bare minimum to support temperature notification. Thanks, Avri Avri Altman (2): scsi: ufs: Probe for temperature notification support scsi: ufs: Add temperature notification exception handling drivers/scsi/ufs/Kconfig | 9 ++ drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-hwmon.c | 213 +++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufs.h | 7 ++ drivers/scsi/ufs/ufshcd.c | 47 ++++++++ drivers/scsi/ufs/ufshcd.h | 20 ++++ 6 files changed, 297 insertions(+) create mode 100644 drivers/scsi/ufs/ufs-hwmon.c -- 2.17.1