Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp993190pxb; Tue, 14 Sep 2021 13:30:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk4WDUvLlxJcQSRraTqw+yBA9uN6e+c3rIIUUrlgys524erEGA4OHKF7YThR5eRJCNfRwZ X-Received: by 2002:a05:6e02:e13:: with SMTP id a19mr13888650ilk.11.1631651445958; Tue, 14 Sep 2021 13:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631651445; cv=none; d=google.com; s=arc-20160816; b=b/uKG5iqqMTC8ti0XDol2DzRTx43i51m9eRM3mkisPNk0TQ0xgGd/YfaUspUK2jrgJ O9kBTpluVZ5Nq2fmFOygTcqMbxeA0UdKGF4QRphiUIDTKDhgUDbmL9Ag6ExutPjRrTfH ON90zugfcnoAsLtpLKCbUmZfWEWfQJqLnAZweuhcZgHQZZA0TCuvsFrHZYvYfeKNjqQx lg0Qylg5ByyIT22MdZBUFv8VcPtJMAODR6b7a0C8nkDjaRJY02MYJqJGnWUa4zEN/8aP Y9GxzbO51/hSvti4zZBHMgYuLOx8Z1ra6xnqh39km90EFiDV2DoQhBG7grCidaLz1jT+ DTUA== 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=o5IEriQSEr3J6e67VneI4RoUfadgLagbv0LwPaHFx4w=; b=V4jHR6fyANfGvPM/J4S+iTj0id9lD1ZPCI618NVBkvtBI2l0vJEJS7mMiUulO1jTxu uyPkSniHrHXvO4DanI+UV5LP6YCA/K3XxHHv5OlNIhYb38KJfAL1KiZOu+hRMtaCXmIT RWfeMn4oVkijUkD51jll/ZgexOgrjkkJ0Un1gc9zDchDOGHnUEUiiwro43UjZqChtr7r Jm8eXiok/4vV/NKJWx+xbcATI+zuhONdDQ8JtGNlMIKOtySU/OqwkXU2K6jxmlFbP0IG y+J9/g9YY8u7GrHChGuumlaLXXDqesUAmtkqoCYLDk0AL573Im+SvzjWQNvhpTEVvaDE uzdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=jp+1pGwl; 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 h26si11007945ioz.60.2021.09.14.13.30.16; Tue, 14 Sep 2021 13:30:45 -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=jp+1pGwl; 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 S233929AbhINUaL (ORCPT + 99 others); Tue, 14 Sep 2021 16:30:11 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:4036 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234134AbhINU3O (ORCPT ); Tue, 14 Sep 2021 16:29:14 -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=1631651277; x=1663187277; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ny29silVVPKn8NkyWDpQYWLmWqSTs10eyweqNshHG/Y=; b=jp+1pGwlx72jar17KLpfD3A3WAsm9oahFUMdcKyaBsDwdSnh/Hsbc3s0 ZNCgNxWyTNzqQCAV0xrk+EX30ULaeo05P6cscLHGE7SSfYTR5CkYE6I1M Zm3twfYoPw7WDJC1F/pk8R/X4h8be6OUtZRS/q1BiBem4CaqP0u+jx8z5 KNTCJVBqww733bGft5RWmhBue7WY1vJYMew6yXNhdqVEI8uHVZsYWmY3/ mRAiE6pAp8I4ER9FOH1YeLN8TP98JaTPkh/Y4uGjxNT5MTLfrjBEt7O20 o7u1cgHPJpoM8x6b3aPLI0AeDkLKk6xnU9Sm2WUDSouSKMvSzzF5fNG01 A==; X-IronPort-AV: E=Sophos;i="5.85,292,1624291200"; d="scan'208";a="180525214" 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; 15 Sep 2021 04:27:57 +0800 IronPort-SDR: TQKHTDpB4jxP5c/abCac37U3ZeXt6DjnG81JX4AJwzQ+jgSdgB+po7SkV1Hil0V1fA2OE9JD7/ L+n9ifYdt11w/XugeOkmlw4eLMekXmnrM0793BgF7Pi4mlvPCthoSZM/CwMpkCyot1Dz9J/V19 /vkQff+iGWk4ZTUmNO8YK6amD6Xvy7QOpZVt87Tist9/YN1kJh/UAbFLv2/POEENwIR4nashoi 95kM+guwmTySmiNIby8+Xyj5/ohJWP2XunlquMTNx1R3cOpKodrDRxWeVdFuteMhfrVx203a78 SZSe9+Hcdmh1rUyJoluUf1GE 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; 14 Sep 2021 13:02:46 -0700 IronPort-SDR: 45n98BSFdKgMZOQtB0Zc5Ahd8Ur+7tDD+sxvbYqiKtJHPD5CAUjQKjjRyGRnZ3jGnuLHpgKudj IgBy9LyKdWOEKOn2H5EKmUzykxgM0kdOhFLfclhuXrpyVYVwIzkB+Qeotj1F2xpZrXeBDnpLz7 /pF0FnKS5ztIh461JxZiDUwNu9RLrOuvP4Wfs4tuZK4Qi6crwlQFKKE4TYHEjVZ1jn3kdOnDJy hp6fRlEZLyxjR0KISBUkfu2bto/EbB8uSJlj3qREZ3V0XWs7Pm4OG28QoEd5fDbI7Y9BzY7cHO UWE= WDCIronportException: Internal Received: from h72zxy2.ad.shared (HELO BXYGM33.ad.shared) ([10.225.32.116]) by uls-op-cesaip01.wdc.com with ESMTP; 14 Sep 2021 13:27:54 -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 v6 0/2] Add temperature notification support Date: Tue, 14 Sep 2021 23:27:29 +0300 Message-Id: <20210914202731.5242-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 v5 -> v6: - remove useless initializations 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 [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 | 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