Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1044293pxb; Sun, 12 Sep 2021 06:20:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwysVLvBZEX8hvmOi6rZCTcxF/snUaC/cRfh78rQhVOfB3bOiHIbi7rYRCvno71AewWoAk/ X-Received: by 2002:a05:6e02:154f:: with SMTP id j15mr4415513ilu.70.1631452827023; Sun, 12 Sep 2021 06:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631452827; cv=none; d=google.com; s=arc-20160816; b=dpQfVeCrGT0yaKvFkYc21zuuXuIRa9S/iJ4NDUNp22Ky41ezug0VbHb9N5qfbf+fU+ T0YxY6fifOEsuB2b4jn+HzFzoUDuRfZul+vYZQTiUPZaHsD3RChK/SSjhYobm1NBZU2n oszORsiM2J2T8s/vqMGVToTiGKgoVhU3pllhDcvceAoRA7m9CjMcRM27MU8CFRbsZLim aIQ6CDyUMnmBLcH+DAI1fFULrgNQmAIDJm/VRccKHQzYhkx6YMKUbbH7DOG4NzjgByTw Xy4ntzFPFOlPyL4Tm3Adh3k6fLeCqh9VpBpQ4mXGZ2wLrDaEr744Fu6GnFwvGkRRlOsu 0eoQ== 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=KOeGdoCiD0HGDhIHiInDHItKky87jGG9n4VKuPCtm0w=; b=isAgDpHa1qbj0FoL/wlfvlWJYp0+s0fOHiwjRTHy9Nqe5oxgiNKNY1bzJiXxa8/MJx +GB0AlWtSDmcgGlHIhnzirVItsDFvnBufT3Ankd+BafkiXRVxYCppHw9qdeg545i0qWn 1CRIuTwMvAmDb/4rsslYqa/igOxV7NYKtPWuHfGuWlKZlNKskZ1fB3UkVK3fIUAYMidg nltFVfYg2EHLXcqoTFgkvFVAjB6kteFtLO7AdUtwfxWlAZ9gXq35VB2Kor3EIxyqCGE7 bMBzyGTWaTAw1ZoVVNb6kzdWlhi425w1CTjNwYmrZqyybvePhj/0BPjCP2ZMFAkLAa7m ZlUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=OfGXSdQf; 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 t42si4803761jal.13.2021.09.12.06.20.15; Sun, 12 Sep 2021 06:20:27 -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=OfGXSdQf; 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 S235374AbhILNUk (ORCPT + 99 others); Sun, 12 Sep 2021 09:20:40 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:34412 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235178AbhILNUk (ORCPT ); Sun, 12 Sep 2021 09:20:40 -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=1631452766; x=1662988766; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YQZ+zwPEYQ1QV+zKMg1yg3Va8gHNfILejX5ulgRBH3E=; b=OfGXSdQfLzRQWJMdoCLsXChqLOKzjTj/jSXsREKKVBXY9AeZoZsPkJqA IVMKHW2OesM5q6xQhlbBEHFGZWU6qiydttNd+w/vSjvqoFzTusx3w0Vj4 uV9VtifYrVlJqXvXrFML8ukLEBHvNOpnRukw28/SIW7+6/8hfNQHaEMDs fXNlsVGAM+hl8ltraTbnTbcp/x5sVp54NWMs2YephcIhfq9lsHa4aVWgB pfZJzXxwjbT/F9ER1HGLz+X+rxVBKC1TUUyMRw+gJ+tY9n4LBtDYigN7+ QL0l/EcdewX5QyuDnY0K2lZnbyWa3Ecvv+Rao3d5wIi30I85+4Zo6AWdQ A==; X-IronPort-AV: E=Sophos;i="5.85,287,1624291200"; d="scan'208";a="283580305" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 12 Sep 2021 21:19:25 +0800 IronPort-SDR: E3ixQDXeHbVMl9yYxdOxQ6zd4fI2SyWxBZ68atuIDgQu8/F5EtKUO6UNFC/AYgWrxuGw5tcCdk 9JCBZdvoAYPMdRbPjI9eH7tS9zh4RiTA+oVu1aSvm7XyGR+487tc799Vo4ZSGLQzy0u8OeKzMX RT6DUHKEnrTPHLTU00YoHqSJkgab2uodV6ilw5/IJ0l10dsDZsU8Q+S+x6+aba7U9CyOMkrC8W 3dIORvIbKKdpKKmyHKme8lAc8p/1of0WAC7ubCJ1QnkyFO2c10gEYwXWcJVre1QklUed7aDv5D DaawzFNONiRFH8MwbW29f57H Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2021 05:54:18 -0700 IronPort-SDR: 41ZbyaYrvyu1mrYcLg9HCBAjUUotaNvOcaQZNfxSXzs3W4gkqp+O2nbdrxDW7jPmb7LSqGxgfR 4Lj6PaP/iJdbAzbllOyQCdc9VbxaDVu3mEjGdfQzruckCeHQGaA5tHnXgNaolrpC2gsF3I5Qhd jZbJoOB1DuCFsHU8sqRCdrGcVXe1CLAA4EBbpV6SyjKUIoXj6q/Efppln48Ak7DXWIKGqC5D5H Np94bBwCC2Ya7ph6vMXgHZdaz4bZmra1xfl3fHMGa0NfjJyRV3/MIO6IlpXUq2D5iFVYJQfjq6 yqI= WDCIronportException: Internal Received: from bxygm33.ad.shared ([10.225.32.116]) by uls-op-cesaip01.wdc.com with ESMTP; 12 Sep 2021 06:19:23 -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 v3 0/2] Add temperature notification support Date: Sun, 12 Sep 2021 16:19:17 +0300 Message-Id: <20210912131919.12962-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 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 [1] https://lore.kernel.org/lkml/1582450522-13256-1-git-send-email-avi.shchislowski@wdc.com/ Avri Altman (2): scsi: ufs: Probe for temperature notification support scsi: ufs: Add temperature notification exception handling drivers/scsi/ufs/Kconfig | 10 ++ drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-hwmon.c | 193 +++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufs.h | 8 ++ drivers/scsi/ufs/ufshcd.c | 49 +++++++++ drivers/scsi/ufs/ufshcd.h | 20 ++++ 6 files changed, 281 insertions(+) create mode 100644 drivers/scsi/ufs/ufs-hwmon.c -- 2.17.1