Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2496072ybl; Sat, 1 Feb 2020 23:45:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwl/kzBjRewJAXBlyGMRinnwuaNFbZvqOLMAsovzKsyug0O7j/Hsx6Vhv6kaYd1DfkeICrm X-Received: by 2002:aca:90f:: with SMTP id 15mr11413012oij.18.1580629524200; Sat, 01 Feb 2020 23:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580629524; cv=none; d=google.com; s=arc-20160816; b=k2U0MYOrQsk7XimnyYbpNrjZh8LGwbWn8HL1dprlBvqyuPhFB2Kv1SRw+KCjRmAgnZ LUZuJIZl69lLWBypDiX9VcXTkuADAzSaxyD7fTRAHChcVCgclAq/u/udL1wzeXgTzeDF 2HtX1PYz1DDf79hp3Bm+/ox4CdVA1THG3stfhAm4ijh3wVpHkV3mEMy7GHwFHB01pYGu YK0rtJYjWJWZ3l357l63lpQ7a1stVAVCG+pwAYaX8guEOhkf9fuamK7X6cAD4OBKPfny 8C/IebIVOekY3W0x+7RzyBrFwjTtb+ow4U+6TGgF7xZ8ihrgV0/ZyK9VFNzSz2/0D+du fvjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:wdcironportexception :ironport-sdr:ironport-sdr:ironport-sdr:dkim-signature; bh=L3HqUIWCExLObWLIVGUVAAAaEJWzVe7POP4pa9pImu8=; b=IRe9B/3oKIxRXZdTWV2Kmx3+hjteoP0vlLXnNjh8QReEGwN+pPtEuMM49pCytZRPiX 89PTBT5ijiE53SatRPePKf8Unfp1PFV4qfPquG+pprKS5h75l+r8yjf/jLapk/xHH4df a4eXe/gM/JMXmWfiGc6X+kbiWHAJJHwz+B6innWgZSWOv6MLmgMR6y0v+HxxoAIyFSMT ERFzAy5e2JDvzftZLZBwHwRjfUsSTePbD7JmYFjhnJpNlJaJMFxGNPf61UKNYNzQSsJg otoX92oCOzjzzYaSSG9zzi9CC8jCHG1ifi5z7lkkw5ekZqyItvoAvqlsXryBfIJpp6IE LOlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=cf2ItoUx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d197si5952263oig.115.2020.02.01.23.44.44; Sat, 01 Feb 2020 23:45:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=cf2ItoUx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726834AbgBBHmA (ORCPT + 99 others); Sun, 2 Feb 2020 02:42:00 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:6569 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbgBBHl7 (ORCPT ); Sun, 2 Feb 2020 02:41:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1580629318; x=1612165318; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pVVPGA2WzFp5c3l0K1TYYcBXTEJeNaWFm/zchLzBFCA=; b=cf2ItoUxjL/xL5atC6sNmYyExmt6O8Y61bVb6i3w/+2F+FL24MLq9X2R MoJHhfniCgyr4E8KkwXzOOMTFuWH3dpnxBNXNdI6tCMKykM9siC0VyRIA bqMNcLc0zbeEXG8JbqLLrcUZHo9WGxBQlqFdV6r2irl61DiFp5RBMFgtf QIjU6BkLMK4l2wuR4n9TAwHpjaK89svnVgvrpeWp9hFOvXmclnNINqT94 uSmT/aqw4GxXs3FSlvR1XuWr0kWafsXqCs2CeY42HjEWfPQ7JpzIm99wk +IoLQBN0hDBI/RtDXwIavLIWezMyjomJlCnEeyJYBPzVrvc1LBdWz2FHE A==; IronPort-SDR: NqIJVL35WNHEZKQHDEvNvydj1asX/5Wz4FnqArP1S77by2vVlcwdeHpFstSuqDRimFvrXouUrr olFFvl+/gFafOmW02tNhABdQJjNzUW8fJMXUc96uQTfopreUvtYQ3mo4Itf8/VCnyYm2kgbv8r 675lgZvP4bm3xPBBhRMQ9e5dpqWjL9IXksIs00reMfOmBC5zXf7nY7D0GvpIuxkbTt2qeinQrU rGruNABEftyRR7DbwQ/x7b5Ma4pB0sMiWI0OwYFYhUCEyei/vrIS2faEoOdHVZwvRylVhsasE0 HXw= X-IronPort-AV: E=Sophos;i="5.70,393,1574092800"; d="scan'208";a="130383374" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2020 15:41:58 +0800 IronPort-SDR: kVRhrivDNyWmctJ7DiyIRuqWW6r25YYHWhxBiNlXdcdtMduKbMrEKvVyofYSHxMm+8p/jknHNs 4m8kYwK1LWhAkMNRkxR9zdJagA0KHBd0sRaC+mCIWXISZvcYYtyWpKXGdJrTqR+F5u9HIQCNTO 9JuhDxaBe4UcqN/+GF4AVUfl3LZ9/foik5Xw82ozm6v+eO57SMhc+BEBKsQPeEdvtscZze1TUa rA8as9wwQCtBD/m+M9avwC7HPe1GcOddtG3rYP8byc1zR+vr1uHDEzrfpbSgWlo8mPA8drTcSh phmLAQRudniqNwdwLY32xGRm 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; 01 Feb 2020 23:35:04 -0800 IronPort-SDR: ZVz61PXsm9VRyiyyjzqEdOLP5A/vwyBDKs5tpCxcDi22TnzcIv8ggkvRmR2eFoiVjXZBMEuXlo eQ6szzpkt+ZK1+rjPyzmAcxk2jhX2Hm39YchMFpDK84li39yCV13/enjT7/hE2JVZ3+Fj0Ec5Q rceIKf3Jxs9Y5tE+Yfs61RPetgChKCCFkfxF6nMMCC8Zmbed6OJK7Jx1Hd5QUcadvCzOSDIBHG JbY6gVReRZ8AlVEzr+MWu+qmg7xBDApVNBe6W41+3wYrrAlWNaYT5Soad5JFELTj/7GJ8Pcvb1 9ug= WDCIronportException: Internal Received: from kfae419068.sdcorp.global.sandisk.com ([10.0.231.195]) by uls-op-cesaip02.wdc.com with ESMTP; 01 Feb 2020 23:41:56 -0800 From: Avi Shchislowski To: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Avi Shchislowski Subject: [PATCH 0/5] scsi: ufs: ufs device as a temperature sensor Date: Sun, 2 Feb 2020 09:41:48 +0200 Message-Id: <1580629313-20078-1-git-send-email-avi.shchislowski@wdc.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Avi Shchislowski UFS3.0 allows using the ufs device as a temperature sensor. The purpose of this 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. We added the capability of responding to such notifications, while notifying the kernel's thermal core, which further exposes the thermal zone attributes to user space. UFS temperature attributes are all read-only, so only thermal read ops (.get_xxx) can be implemented. Avi Shchislowski (5): scsi: ufs: Add ufs thermal support scsi: ufs: export ufshcd_enable_ee scsi: ufs: enable thermal exception event scsi: ufs-thermal: implement thermal file ops scsi: ufs: temperature atrributes add to ufs_sysfs drivers/scsi/ufs/Kconfig | 11 ++ drivers/scsi/ufs/Makefile | 1 + drivers/scsi/ufs/ufs-sysfs.c | 6 + drivers/scsi/ufs/ufs-thermal.c | 247 +++++++++++++++++++++++++++++++++++++++++ drivers/scsi/ufs/ufs-thermal.h | 25 +++++ drivers/scsi/ufs/ufs.h | 20 +++- drivers/scsi/ufs/ufshcd.c | 9 +- drivers/scsi/ufs/ufshcd.h | 12 ++ 8 files changed, 329 insertions(+), 2 deletions(-) create mode 100644 drivers/scsi/ufs/ufs-thermal.c create mode 100644 drivers/scsi/ufs/ufs-thermal.h -- 1.9.1