From patchwork Tue Jan 14 09:35:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avri Altman X-Patchwork-Id: 13938557 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 993F424334E; Tue, 14 Jan 2025 09:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.153.144 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736847488; cv=none; b=goje5VkRiptKR5EVbaCHQSf2pKSxl7NV55CHe/QfSTBVIBm8ZTMQ1O0iZbA/JdVgBzoLbaOVTb/7uDucbleJnCSzMVC9gSQgCuzdCIk9YTC5IqtTqH3b92fFPOTEqYWTlt0XoBWr6+NI1oqA7uzQeQee3VsfAAVncM6hJlSYNAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736847488; c=relaxed/simple; bh=xaY/0LrOW6WSLYSVlpxfs1XgOP9TPDdCciZPradmefE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZRVxRMy3EcWCpbWxaWUKm/6+3YtcAqIuEJoYBYHTrMH/46P9P2Wt87KzwbA/hRRpYQy5zVaSebrKpUiyHWo5+1aNUlDE6G4514neTSgk5LmxoiBBLO9++FywobDOIGmSGAK+iJ0j1bjkYZOXHfGgA3/nyt5P4PG/SJjHkz6HTUY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=o66tNXfA; arc=none smtp.client-ip=216.71.153.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="o66tNXfA" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1736847486; x=1768383486; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xaY/0LrOW6WSLYSVlpxfs1XgOP9TPDdCciZPradmefE=; b=o66tNXfAlCAkrqAORnhXY1Bve16Tk1hPLLgq8vDDGmL1RiNiVybybnWc 6yy8voE7fWLMUAVXKFvgjw17MhpW0XfnQsxqtGrfr2rsEhx4E2ZumcCeC fS22by3bnpravrEpzcCM+JdKLX/1RBDvYy1aN4UOqk/xr8D6AD0UpZRCC qY4p9HBH/BaQIWnxEWFd0h2H4mRpp3y/vta+XpWT5tR+tTGptO4nhZPl2 UFBOS7Gb+v0CiX1otaQt4Uym9GiywyU10mIVC+2jqH123zWZtENd/w22u UMt/hOBJ5d9z6C3kdPalWtH6N5Dylq7Ki1zS0sUnPxV6E6yauANxab0zx A==; X-CSE-ConnectionGUID: 1SNwRW4zR8ONm/BVd0lpVA== X-CSE-MsgGUID: ukPILo8QS0+jnmgzQxU2pA== X-IronPort-AV: E=Sophos;i="6.12,313,1728921600"; d="scan'208";a="36912840" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 14 Jan 2025 17:38:00 +0800 IronPort-SDR: 678622eb_/7r/CoKHi7gomHA7PCBCoUwMmq6uh9ChfJYceA2iTbYBqxG EJjATrjbu3+sK8zSBtK0eNREqR6KD1CGJw/UCNA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Jan 2025 00:40:11 -0800 WDCIronportException: Internal Received: from avri-office.ad.shared (HELO avri-office.sdcorp.global.sandisk.com) ([10.45.31.142]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Jan 2025 01:37:59 -0800 From: Avri Altman To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Bart Van Assche , Avri Altman Subject: [PATCH 1/2] scsi: ufs: core: Simplify temperature exception event handling Date: Tue, 14 Jan 2025 11:35:11 +0200 Message-Id: <20250114093512.151019-2-avri.altman@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250114093512.151019-1-avri.altman@wdc.com> References: <20250114093512.151019-1-avri.altman@wdc.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This commit simplifies the temperature exception event handling by removing the `ufshcd_temp_exception_event_handler` function and directly calling `ufs_hwmon_notify_event` in the `ufshcd_exception_event_handler` function. The `ufshcd_temp_exception_event_handler` function contained a placeholder comment for platform vendors to add additional steps if required. However, since its introduction a few years ago, no vendor has added any additional steps. Therefore, the placeholder function is removed to streamline the code. Signed-off-by: Avri Altman --- drivers/ufs/core/ufshcd.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 0920a443588c..f6c38cf10382 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5976,24 +5976,6 @@ static void ufshcd_bkops_exception_event_handler(struct ufs_hba *hba) __func__, err); } -static void ufshcd_temp_exception_event_handler(struct ufs_hba *hba, u16 status) -{ - u32 value; - - if (ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_READ_ATTR, - QUERY_ATTR_IDN_CASE_ROUGH_TEMP, 0, 0, &value)) - return; - - dev_info(hba->dev, "exception Tcase %d\n", value - 80); - - ufs_hwmon_notify_event(hba, status & MASK_EE_URGENT_TEMP); - - /* - * A placeholder for the platform vendors to add whatever additional - * steps required - */ -} - static int __ufshcd_wb_toggle(struct ufs_hba *hba, bool set, enum flag_idn idn) { u8 index; @@ -6214,7 +6196,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work) ufshcd_bkops_exception_event_handler(hba); if (status & hba->ee_drv_mask & MASK_EE_URGENT_TEMP) - ufshcd_temp_exception_event_handler(hba, status); + ufs_hwmon_notify_event(hba, status & MASK_EE_URGENT_TEMP); ufs_debugfs_exception_event(hba, status); } From patchwork Tue Jan 14 09:35:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avri Altman X-Patchwork-Id: 13938558 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB4912500B1; Tue, 14 Jan 2025 09:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736847496; cv=none; b=MoObuV1qGuYG/Tz+lYfQ2zAAdYHBAqhvvy2BIxl4cAmZt4FlBnKuXMTWeU698SAcLElmQtY3DATJY9h3FYIkUkPVPe2/NdLSr0Z9DLCtHlsc2q33HLWSXF7QjCRT4wrKYah+fqnUeGQ0nonFjCGP1yJPcxdNMYr4l4xDBMUyGrM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736847496; c=relaxed/simple; bh=wprwv1OkpKu8x+PAWg3ek/L5o90PlY4LhKUF+OC+IOk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s+C+Qk7GWLudJlLtrJIToy5UetQaxQQjJLCjiFKzdlgX6JTQ8W/+FohaJ73HEfQitclpkSyCnw8oWPiw/a83wm+sDIrakWy1y5fG9zlO/wuHHxL+DEAmooFkqvqftkhrnpbvMMFXH+0p1+L43VJx0g6U2Ck0slvBleVkPrcMgcA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=rimnANU6; arc=none smtp.client-ip=216.71.154.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="rimnANU6" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1736847494; x=1768383494; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wprwv1OkpKu8x+PAWg3ek/L5o90PlY4LhKUF+OC+IOk=; b=rimnANU6Bk0fhyxxA8cqqX9pxeq1WnuOBU2fW2gdioEgsSAzJ+SNxE4b aGD4ZGZ0wwxI0fld+naU39oYfrp3Edo9owHDqC/PcMHHG7ew2nm2MQ+x3 hLuL53dLRmvR+kmmYTPZ3PKGEINLd3ST3kYvQ7h0uwpxdMmxa5hOghJAU ddnfsSJqj3+SDNg1ux8iGVChXtZiozmX2HnvFkNh4pvU71YiDCfOCinyI eMBPdmPFCsnS8x/PnL+zYVV3uRCW2q7b4yNSUMobDDB5zqY6KdrPify0B Z7s7eJ/pCMHOslKcn88c2nEcaIUvL+YGrTgoWG51mme9O7JkFvVdmWEN9 A==; X-CSE-ConnectionGUID: xtu3SFj5TvCumkp7JUA++A== X-CSE-MsgGUID: 20tO3Qg7Tqynve5sJUl8nw== X-IronPort-AV: E=Sophos;i="6.12,313,1728921600"; d="scan'208";a="35258389" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 14 Jan 2025 17:38:08 +0800 IronPort-SDR: 678622f4_bg9KJ40f3Z2GaN17IcoSIyQNUaGVPMjNwDTs7Zwx4LLSRc+ dVFb+0tiFsjkjyyrfp/M8eRhwuMwv3mhfbbVo7A== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Jan 2025 00:40:20 -0800 WDCIronportException: Internal Received: from avri-office.ad.shared (HELO avri-office.sdcorp.global.sandisk.com) ([10.45.31.142]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 14 Jan 2025 01:38:07 -0800 From: Avri Altman To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Bart Van Assche , Avri Altman Subject: [PATCH 2/2] scsi: ufs: hwmon: Add missing ABI documentation Date: Tue, 14 Jan 2025 11:35:12 +0200 Message-Id: <20250114093512.151019-3-avri.altman@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250114093512.151019-1-avri.altman@wdc.com> References: <20250114093512.151019-1-avri.altman@wdc.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This commit adds ABI documentation for the UFS hwmon driver, detailing the sysfs attributes exposed by the driver. It includes the missing temperature notification entries, that were added back in 2021. The following sysfs attributes are documented: - /sys/class/hwmon/hwmon*/temp*_input - /sys/class/hwmon/hwmon*/temp*_crit - /sys/class/hwmon/hwmon*/temp*_lcrit - /sys/class/hwmon/hwmon*/temp*_enable While at it, update a missing reference to the ufs ABI doc in the MAINTAINERS file. Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support") Signed-off-by: Avri Altman --- .../ABI/testing/sysfs-driver-ufs-hwmon | 31 +++++++++++++++++++ MAINTAINERS | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-ufs-hwmon diff --git a/Documentation/ABI/testing/sysfs-driver-ufs-hwmon b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon new file mode 100644 index 000000000000..a27a108ffd28 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-driver-ufs-hwmon @@ -0,0 +1,31 @@ +What: /sys/class/hwmon/hwmon*/temp*_input +Date: September 2021 +KernelVersion: 5.16 +Contact: avri.altman@wdc.com +Description: + Temperature input value in millidegrees Celsius. + Read-only. + +What: /sys/class/hwmon/hwmon*/temp*_crit +Date: September 2021 +KernelVersion: 5.16 +Contact: avri.altman@wdc.com +Description: + Critical temperature value in millidegrees Celsius. + Read-only. + +What: /sys/class/hwmon/hwmon*/temp*_lcrit +Date: September 2021 +KernelVersion: 5.16 +Contact: avri.altman@wdc.com +Description: + Lower critical temperature value in millidegrees Celsius. + Read-only. + +What: /sys/class/hwmon/hwmon*/temp*_enable +Date: September 2021 +KernelVersion: 5.16 +Contact: avri.altman@wdc.com +Description: + Enable (1) or disable (0) this temperature sensor. + Read-write. diff --git a/MAINTAINERS b/MAINTAINERS index 838d3038e1ea..71a69551aee2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24070,6 +24070,8 @@ R: Avri Altman R: Bart Van Assche L: linux-scsi@vger.kernel.org S: Supported +F: Documentation/ABI/testing/sysfs-driver-ufs +F: Documentation/ABI/testing/sysfs-driver-ufs-hwmon F: Documentation/devicetree/bindings/ufs/ F: Documentation/scsi/ufs.rst F: drivers/ufs/core/