Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2835001ybl; Sun, 2 Feb 2020 07:49:38 -0800 (PST) X-Google-Smtp-Source: APXvYqy2LjKnpWN30Pn7x2GtLhHhuXBgdWcF3v8e1e7xrAzEcWobsp+6V7oQIH/+fVaHKWAk4dec X-Received: by 2002:a9d:394:: with SMTP id f20mr14722149otf.148.1580658578456; Sun, 02 Feb 2020 07:49:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580658578; cv=none; d=google.com; s=arc-20160816; b=ClQElV5WC7cVMWf4KqO+c2hhNofQsY7zatuqgesWLS0/TRe193SRUhie3O2KkZrAzq wBu028RjiehuAev6BE6DS5VzKwofVCqTRVzrqMf2pT3rAaIrCBKnT1pNACBaIno5ds2C kriXfXMTJIjJEW9HxP0OFsXTFN5TGk0E27w6hL2PaT8uqc963xfZxHJUG/1jH0F7FX1i dZBSxhnpz2fyAKSWHiFhJWi2d3TBskvGPDitwJH41j/Hn9+t++cwgbPs0KxEJB4Y5pOZ frP/qsBOQmJpiqITvbLJJNNzTiTb5uhEgV8Q1gQWjcFUJD3piunxS8LfHn8i25PbPuIs XoBA== 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=vYs+BIb0fqmYMlxkmTe9sXY01uevYfOwnN8xuHSX1Z0=; b=V8nrtEaSGJzGCxX4np5BDnuRgper60JZ8iR0Ik+grDy4imnr1KtU5a9iCzS6EnPa2H qi/7zI4NOmZZVeXyYrRxts/YseUxRyw53MiXgJmsYHqZD5jwt/+WFMxHRZe/QU1tx7ym socZ1bBTAAUNThIJcaf7RMCkp7wHeYTZugDby6fhb+0zj63kSj6HSD+U6g9gRy0mgtUL GTphTIpNMtNBZT27QCrf99Pr1V8uwWha64jZNCDmfXxGNUK5q0DlQdJxzsoO8CAsdlHs 9FYzf83jfsy+Qj4twGYFgk1N8vJWxKzJ1oBT6a+QYo5gipB7Vc6bBP9YsoN5hUz2gYNu i15A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=BUcEtW5+; 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 b126si5312838oii.72.2020.02.02.07.49.11; Sun, 02 Feb 2020 07:49:38 -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=BUcEtW5+; 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 S1726907AbgBBPrc (ORCPT + 99 others); Sun, 2 Feb 2020 10:47:32 -0500 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:15703 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbgBBPrc (ORCPT ); Sun, 2 Feb 2020 10:47:32 -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=1580658451; x=1612194451; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yjQuSD40krTJ5lbMtA0mAHZ+m2VaBFNpM0wv92vjO+w=; b=BUcEtW5+1/EZpiDOkazxwE/lbIaZPkzR8U8KZNSCFF2hepHoJjGEm+rD CZwUV9lfZrQbS1R0uRTMY4neiu8wfDXnLy9O2nYibS66NIjP9b+bzRD0e ih0Es5K1bQhMaDCAn/KVf5bOCKPsRwg+6fZcs3kVQdcjHk+Yc9c/UBIlV N8AQ+aNfy0ycSWPDmLyN08yykPSXzfOdBTcF3GylS/nABC7rk89aA3vFe sZp1pEzMLj5x3+CK/ZQnCc2KNd1cdGWReOdUFMf3nHgQ21qhT5UPrlmmr rB8AFf02V0vT/N8LJXNrdGuXb4iA1YIaMemaosiYJoDndrvKAyEDjJXkq Q==; IronPort-SDR: 5Ug3xjax5r0LmwiP9WsIqjSpHaXPRqmAn+uzlZZBsjgffCX4/4ks+vVEM5E9Du1/4a1GJh6f14 jWv2tkblm0ZyrihY9lSdLSzRGyO3JFVSzs78f4F4DyLWyoNlKDJxgjZhGBDlx+GHFg2a4ILgoz Pvkf8OcmcWZYlo6UmmQB/yT4VrrKEzBYqmqn3g/Km6sr5gXgKgOuQPX94Rui7SWpSvTD31wzwK 5cJdNQlOhyRgKt/ccrjk9Ktco+4U0ByvgPXpM15am0yiqCpt6zxuTE3Jn3qGDU7/v0IrSKP3hY ILc= X-IronPort-AV: E=Sophos;i="5.70,394,1574092800"; d="scan'208";a="128932815" 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 23:47:31 +0800 IronPort-SDR: 40acwZYROph2jknKzx/+ByHfE++AyKbJGx34XzDWaVNn96kkw4FtnxsGV/UD0pT0+gWsC7lGfZ eeCAHIt5QfAtiRYXKqwCjRJBLA/9ARDTQKOgjbkLgbOcPrzvDuYaHdk68gyX+pKHA2NgVOdBQX 5plrHeKLDJRD5+C7MyxWfJ+JrNXtiXvIv6ym9Hnc7K14JgQbwFPEzr6Ae5GXiLNTIt0IwFOLN+ mUqrVDDb1j5WOlmZq/ykiOh7paNVtVMX4j3dASmL+j204P51Mh+Kz38z925o/8t7IKzSmSF74I Qqieonjp51N6ZdN1cZJ2LkaX 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; 02 Feb 2020 07:40:37 -0800 IronPort-SDR: peB792mNCbU6MdT12/NxCTEjqGUC6tC85M+l2TTEL5H0vaUr04FAc5Tnh+0D2H7lPgVM6h8tRB UCAyNPf436Lrj5Ywb35xmd5cyqT8eUt7IraUg4iTNUycKQ8k29JxIamMWZv2V9tAldZxhmykdj +6J4Q+RHQN/VcJBkPQtY7jw7ymi4U88B5OG5m+6gYth0T5S3DThmUWz0nESSCkkNqJkgho7MvN a+QVyKkm5iZUHlS1mxh4B1SQfazYuQfKOnsgS1PN6vclt/812OoG7zcOoWW0w2EQaZra8I5Zo8 BMg= WDCIronportException: Internal Received: from kfae419068.sdcorp.global.sandisk.com ([10.0.231.195]) by uls-op-cesaip02.wdc.com with ESMTP; 02 Feb 2020 07:47:30 -0800 From: Avi Shchislowski To: alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, linux-kernel@vger.kernel.org Cc: Avi Shchislowski Subject: [PATCH 0/5] scsi: ufs: ufs device as a temperature sensor Date: Sun, 2 Feb 2020 17:47:20 +0200 Message-Id: <1580658445-15232-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 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