Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1839331pxb; Mon, 13 Sep 2021 06:41:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDtiU2N75mrJmNaDtAgoupAtiFhW+9M9D67mnn87NhP6itCeRlyzh+FTfpCvRFhgTux/Qx X-Received: by 2002:a5d:9681:: with SMTP id m1mr9111094ion.113.1631540478711; Mon, 13 Sep 2021 06:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540478; cv=none; d=google.com; s=arc-20160816; b=xSv48NcqtbTJ5ECdJ0znF8z3Xgglx3i1925mhMHZ8V0cHD+e3+Z0AuVoIZ/PyfqR8a H6xYmvPZFfrGDmWRS9+Eu0fDiPHzVWKbIwAakQbyQDRsTkedipq2yzmsuC7gmiurSigr b8GcKjE8686SUPGDWtdZbxHwRqy9KAwa9yyoqZYzOmuL3f/fYk7v15pICTn3eDX3wtpi CA4MEaJ1Bb2R2sfOunXqTJFLWQVcuRXUACzkGzcR3N6tk6j9OpX7UpgEUJaK+zNmgihJ Ut9Dqtp7FY8Q6mx4dwRy7ptnW6WS8TwXDcCOGYefw9lG86jPvsUipXwXCDRne2cXPO+g Ux0A== 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=vupZJsbO/hoP4+pSa/0GMVEPQ2b9u74m2XgGzkU3yNo=; b=Mz5W70JfRmn3ENvDJky7pB3TZ8lbCGrvtDkXlAJhM9fVtF8jOtBx3KCXM/4gk8qZdC BiBqlb3x6i6xRfRKJcjbUHRAM4fM/OpFUcH2xsU3wHGoAFAwkEp6NP30thrrMJmWfYz6 6s1iO8zt93Sdr9ofHlNRlxiJcSSR7gmUlkdLD4ntU0n4YbCRkUikZa1c94qqCWOo7LsL Ck/nYghxF+XUOfjmQ4tdDVGit8Honc+6+O51tDd5eHt2oGUAoThzJO8Pbfngmu7Fe+Le aqqxTUg43tFeQePbAynAR3rJctNWIY40ebTwm8JznbJP5+YKoxGvFJ1lZgJwUc2K9GSn Fl+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=NUetyUEx; 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 v4si7196349ilc.20.2021.09.13.06.41.05; Mon, 13 Sep 2021 06:41:18 -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=NUetyUEx; 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 S243766AbhIMNkB (ORCPT + 99 others); Mon, 13 Sep 2021 09:40:01 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:47565 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242988AbhIMNeo (ORCPT ); Mon, 13 Sep 2021 09:34:44 -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=1631540008; x=1663076008; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pGp6s8OXSV13dUq3hfMuAIW/HNTvZVlyt23W1OpT7yo=; b=NUetyUEx0JUtBW5EqoJkH0BFFVHksDn49NflRlaPy41byL40uovyZ5Td jkklnxncPEIOsOADZaefNv62etEAz92rG48y+S+1qoiWKMHaBkQiMuBHY ih7rxwGvZpx150IUa47WwBHLg4ZCaqMdETDHUts7VvV9adJFwFDqLzW+g T3YDziIVOk4X4dhExpOlARhuUU2ROUEsm9cXZDNJ4n7ES7f/yN2i747Eh 5HMTiIZuqndqIS3XvFpt+CZUekn42begDrqOXll91kStp8wc6maTOzOim ZmTiyFzqkN9E3C9w9w5+FHCsfWXlRIvPplo67+CYuPLfIg1Qf6Y5pmWsH w==; X-IronPort-AV: E=Sophos;i="5.85,290,1624291200"; d="scan'208";a="291474599" 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; 13 Sep 2021 21:33:25 +0800 IronPort-SDR: UgFTwvG7eCnjZZi2UvMbOvFgL1UUNfGyi5lHekcA5Onmzjq+jMDdFw7FJhO0W0R6fSDEeb/s55 wB8fXRyBo+EdIZKPqoLyc+iDjLOHfFFYWmr92n/54OY5GbVehh1vHcycehEmMVMWeg72mBe/X3 DU6FnZpltkPPcTfcd6Lb8ibk+xQRpGy89L91lkCOOnOrFpOWM29PteQGrxLzsyIIctZzA+eKXp 6VYl2rFs4zb+PWlGI/jiDP7rzp4RQdtthABcMMvgzwFPUmqF64yKl2kjtoFzdil2eEI2zTyp3G zayqnLJFhgoCkfbGjmlJTVYC 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; 13 Sep 2021 06:08:16 -0700 IronPort-SDR: J9P/tHWteB5xzEXTLb4/izfiWw7nZKWqyy7qJA9Ku2ZTYM5pJriYCU0O92k2ZgSfU8OsI9Gorv VqQ+kdZsQ+z8CUtt/XdPC8FxxwMEPSA1A9bgbckiitxjP3i09jcsy7YgfY8iYrge7RrIC41Xwe N+OlbJY6JuPsPyDTrd0+wEFl0s1L3Ewzsq5rUSNnH+d4abZ7NufiqXgQDDEteZqOkSObbOkn7V wzQBm5Hn2lfPpG2DuQBediOaUGt7hVcRF4rb97G2hfGm0/+kvtEGMt09/s3ZGOOkje7xYrznRt cdc= WDCIronportException: Internal Received: from bxygm33.sdcorp.global.sandisk.com (HELO BXYGM33.ad.shared) ([10.0.231.247]) by uls-op-cesaip01.wdc.com with ESMTP; 13 Sep 2021 06:33: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 v4 0/2] Add temperature notification support Date: Mon, 13 Sep 2021 16:33:01 +0300 Message-Id: <20210913133303.10154-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 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 | 206 +++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufs.h | 7 ++ drivers/scsi/ufs/ufshcd.c | 47 ++++++++ drivers/scsi/ufs/ufshcd.h | 20 ++++ 6 files changed, 290 insertions(+) create mode 100644 drivers/scsi/ufs/ufs-hwmon.c -- 2.17.1