Received: by 10.223.185.116 with SMTP id b49csp2631644wrg; Mon, 5 Mar 2018 06:18:54 -0800 (PST) X-Google-Smtp-Source: AG47ELt9LOa5DtjhIGdZ2ohOefZos4zyvoTKxKMpfM1laHJBpRETXcGEbXyuzj4Zf41Urc99X+L4 X-Received: by 10.98.69.196 with SMTP id n65mr15577297pfi.29.1520259534551; Mon, 05 Mar 2018 06:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520259534; cv=none; d=google.com; s=arc-20160816; b=ldLnFTQnKfFMSH29LZbw8a6O8lcatGt3JiNjrWiF8awqAHS/vzOmAbktWCMB6jhZ82 QLUf7FFxTKk7vEcr6aQ24j9utAZkz+p9DxT9tQe7z/xwVE8PvoTsTh3l8niDpwJyKc0J MhE5lDcCCVtEzTl+hO2FpfJPtvwdrqeNfOdBmEMdYAh50opDz2nwnIWc4jHbNuydtV+s SmulyrBoJYcRoubGvj8lch09xEKma1AtrFwLi4eWgLNrjd4R7Bp6z076Dwd30rfZhPBU PQR+oHSvcRjMKAVpm5Q6kZqWKDUzglXwGawV7fucL6/zhm8UZq+ennm8HuSSrX8OLJEt 3Ffg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=urFCJa/99zm5G8QbWsf9oBTpCt/vCCP8iuTKA74KD5o=; b=ecPnuO00RLCbJB2Wu3E3wFRDdbGXsx4FAfoyz5psDn7xU9tPQxz4oj7cP8DhgN+84X cRHev7PCVQUFMHtRU/jopsJK5X0QJ6GoysfZ/2MZONZWK3bRaW5J9gpACnmonh+tYIgC T/3+Aojq1B+zSugYaKaxT8IWLY6TpB4agBTFHhB1XOo6OdAD2pDAHB1x76lWs6G5d890 7YzIyQ67ZTv5P/1eVc2tH99k1n+VJPBSM0faU02p1bo4EMg9+5j96yFGjuWoGxM/ivsf QKAdK3HYtNsM/LLLY9ykWhZEkzl4UpWOdP5UO4vm86L+CgV1NH6F0L7pBktUTNZ+q3AI dYqw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 44-v6si9439578plb.70.2018.03.05.06.18.40; Mon, 05 Mar 2018 06:18:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964845AbeCENJY (ORCPT + 99 others); Mon, 5 Mar 2018 08:09:24 -0500 Received: from mga01.intel.com ([192.55.52.88]:38644 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932459AbeCENJR (ORCPT ); Mon, 5 Mar 2018 08:09:17 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 05:09:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="208907609" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.168]) ([10.237.72.168]) by fmsmga005.fm.intel.com with ESMTP; 05 Mar 2018 05:09:13 -0800 Subject: Re: [PATCH 1/1] scsi: ufs: Add support for Auto-Hibernate Idle Timer To: Avri Altman , Vinayak Holikatti , "Martin K. Petersen" , "James E.J. Bottomley" Cc: Stanislav Nijnikov , Jaegeuk Kim , Bart Van Assche , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Michal Potomski , Szymon Mielczarek References: <1518782464-28847-1-git-send-email-adrian.hunter@intel.com> <1518782464-28847-2-git-send-email-adrian.hunter@intel.com> <5b6cc5c9-0045-9270-fec7-29ac6d0b4fcb@intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <4403f748-b7c6-7996-f44d-4a2775d2ffa6@intel.com> Date: Mon, 5 Mar 2018 15:08:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <5b6cc5c9-0045-9270-fec7-29ac6d0b4fcb@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/02/18 08:35, Adrian Hunter wrote: > On 18/02/18 11:45, Avri Altman wrote: >> >> >>> -----Original Message----- >>> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi- >>> owner@vger.kernel.org] On Behalf Of Adrian Hunter >>> Sent: Friday, February 16, 2018 2:01 PM >>> To: Vinayak Holikatti ; Martin K. Petersen >>> ; James E.J. Bottomley >>> >>> Cc: Stanislav Nijnikov ; Jaegeuk Kim >>> ; Bart Van Assche ; linux- >>> scsi@vger.kernel.org; linux-kernel@vger.kernel.org; Michal Potomski >>> ; Szymon Mielczarek >>> >>> Subject: [PATCH 1/1] scsi: ufs: Add support for Auto-Hibernate Idle Timer >>> >>> UFS host controllers may support an autonomous power management >>> feature called the Auto-Hibernate Idle Timer. The timer is set to the number >>> of microseconds of idle time before the UFS host controller will >>> autonomously put the link into Hibernate state. That will save power at the >>> expense of increased latency. Any access to the host controller interface >>> registers will automatically put the link out of Hibernate state. So once >>> configured, the feature is transparent to the driver. >>> >>> Expose the Auto-Hibernate Idle Timer value via SysFS to allow users to >>> choose between power efficiency or lower latency. Set a default value of >>> 150 ms. >>> >>> Signed-off-by: Adrian Hunter >>> --- >>> Documentation/ABI/testing/sysfs-driver-ufs | 15 ++++++ >>> drivers/scsi/ufs/ufs-sysfs.c | 77 ++++++++++++++++++++++++++++++ >>> drivers/scsi/ufs/ufshcd.c | 26 ++++++++++ >>> drivers/scsi/ufs/ufshcd.h | 3 ++ >>> drivers/scsi/ufs/ufshci.h | 7 +++ >>> 5 files changed, 128 insertions(+) >>> >>> diff --git a/Documentation/ABI/testing/sysfs-driver-ufs >>> b/Documentation/ABI/testing/sysfs-driver-ufs >>> index 07f1c2f8dbfc..c7f9441079eb 100644 >>> --- a/Documentation/ABI/testing/sysfs-driver-ufs >>> +++ b/Documentation/ABI/testing/sysfs-driver-ufs >>> @@ -1,3 +1,18 @@ >>> +What: /sys/bus/*/drivers/ufshcd/*/auto_hibern8 >>> +Date: February 2018 >>> +Contact: linux-scsi@vger.kernel.org >>> +Description: >>> + This file contains the auto-hibernate idle timer setting of a >>> + UFS host controller. A value of '-1' means auto-hibernate is >>> not >>> + supported. A value of '0' means auto-hibernate is not >>> enabled. >>> + Otherwise the value is the number of microseconds of idle >>> time >>> + before the UFS host controller will autonomously put the link >>> + into hibernate state. That will save power at the expense of >>> + increased latency. Note that the hardware supports 10-bit >>> values >>> + with a power-of-ten multiplier which allows a maximum >>> value of >>> + 102300000. Refer to the UFS Host Controller Interface >>> + specification for more details. >>> + >>> What: >>> /sys/bus/platform/drivers/ufshcd/*/device_descriptor/device_type >>> Date: February 2018 >>> Contact: Stanislav Nijnikov >>> diff --git a/drivers/scsi/ufs/ufs-sysfs.c b/drivers/scsi/ufs/ufs-sysfs.c index >>> cd7174d2d225..a0e38776dc92 100644 SNIP >>> @@ -7843,6 +7863,12 @@ int ufshcd_init(struct ufs_hba *hba, void >>> __iomem *mmio_base, unsigned int irq) >>> UFS_SLEEP_PWR_MODE, >>> UIC_LINK_HIBERN8_STATE); >>> >>> + /* Set the default auto-hiberate idle timer value to 150 ms */ >> Your commit said you are setting an idle timer in microseconds, Better use usec to avoid confusion? > > As the SysFS documentation says "Note that the hardware supports 10-bit > values with a power-of-ten multiplier ... Refer to the UFS Host Controller > Interface specification for more details.", so 150,000 us is still a value > of 150 with a power-of-ten multiplier of 3. Are there any other comments?