Received: by 10.213.65.68 with SMTP id h4csp400419imn; Tue, 20 Mar 2018 06:13:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELuMCVlnO+WBFFk0NsujvwYC7uifeVhMmbKe+7TXEQ8dgJXxo9O6JOkMzyH70AYNV2Zr2I9e X-Received: by 2002:a17:902:760e:: with SMTP id k14-v6mr5734021pll.292.1521551598375; Tue, 20 Mar 2018 06:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521551598; cv=none; d=google.com; s=arc-20160816; b=bMrnMBZaFO0sMv4QT9z8fhk4vDVPIh38PgdgkEGhLLwGx+heSrI7LqA3YyWEZQ0Zc9 slaUBIU1bn6eq7x+YvQIDlLy8bVO6r3AmCBzPK2iwy2fWNryGx2/eIp8jBtb/eJJ626+ EShZc5d6kkBk+lzVjO+dVXm+AiHJctAAyB7Fs6FM7gtejiOqRVA20P+eo5f2y09mjqJr u8955Oq5tmVCWm1EWnBAs6NUL4OI+WlNLZOeucelxoDpEg03RwBMUax4MTMapKVKRcOJ 2nA9nGZnEpGMpLcwjxD3FUYAKiGXUI55339E2dKwQhV+R76aN4XiVPpPubA9lM6Bg5jI tENw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:wdcipoutbound :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :dkim-signature:arc-authentication-results; bh=bNXoT1+j0wYDZ1TJjtzDH4U5R2NE9vJ5Naqkb+JehM0=; b=WpZDRQUl8rY5RfIXtWofSHqo7ZzrCnP2EBs4aJUwm1gAHJfGiwp2WK5iIDbu3JHLYH JGFHE/QodHHRWTK5MQYHfpabPcuZ6vlmy+/wO2UXFkJwfGjQwKt7FGXAbHWrgXpLEsuF 5yfdSPgipSe3OYUWY8DLDC2RPBZ336YChjQFq9KNtxWMDZ/TimEI5fvqx5Ji4lvus0Fm BlnQmZedqYpTGb+toQIwzD2axapJFAfLTbamxF103If6rhxuje3X9zk5sgX/Yo8zTRjG GJuzsofEFC4CD2C3N5RNCZZeCWTbQGmFNoQRkWht4mZGJJpXVj97pazgOuLWbPgefUfu pzYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=kARv0cFT; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b=QIMPWZzk; 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 p2-v6si1477805pll.304.2018.03.20.06.13.03; Tue, 20 Mar 2018 06:13:18 -0700 (PDT) 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=kARv0cFT; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector1-wdc-com header.b=QIMPWZzk; 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 S1753404AbeCTNMN (ORCPT + 99 others); Tue, 20 Mar 2018 09:12:13 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:25237 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753246AbeCTNML (ORCPT ); Tue, 20 Mar 2018 09:12:11 -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=1521551532; x=1553087532; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=VGBTcoSXJb7ajCNzDlCR0jKrvXx/bRSlS/K5S8kFJbQ=; b=kARv0cFT5sUqjBZYZEQNbaZG6AJszBOGy+Q07Xt9LhYH1yFORFOvnkO2 bJcTLkU0tfMjgpdVpvvbR5khAbg2P9jh9iYsMEL3IWvzkRGChHTZmmz2/ BJGkwjLMF1lhHto6ZLStjv5409rhpTHzjyAw9Df6tRznxkwCKnJstRVb5 pwRJvXQA85zW/1hWwskMuQe09Ya19ehO5YbnlgOyL3p9afh6IKpebRhSe 2x3Orx2s3pUWSfO63OGQlvhKhpwyVfeboofPkOWXWThuZHuM9hVvtoqPI LKFQ8LIJCJmTtyuhUEJRTx13mFCr0DNHLzT4Q0gOp3x7FWQbzyZNOf0yZ g==; X-IronPort-AV: E=Sophos;i="5.48,335,1517846400"; d="scan'208";a="74053415" Received: from mail-co1nam03lp0022.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.22]) by ob1.hgst.iphmx.com with ESMTP; 20 Mar 2018 21:12:11 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bNXoT1+j0wYDZ1TJjtzDH4U5R2NE9vJ5Naqkb+JehM0=; b=QIMPWZzkDRoAl9IRFtnqPJThWm9vDBrRIXnALO8lNa/BnXbQ+Oq60/70tdwMXpO6743xirB9nFL6B/vHpf/L0W/aNuU2deO93p4KiEKgq6Dx7ilKA/RZ8CGs2ab2N0XV4GPeZu4PR/evYx8K+qcnV1ZTW8K/ldMTTXd/CcgyNQE= Received: from MWHPR04MB1137.namprd04.prod.outlook.com (10.173.51.151) by MWHPR04MB0542.namprd04.prod.outlook.com (10.173.49.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Tue, 20 Mar 2018 13:12:07 +0000 Received: from MWHPR04MB1137.namprd04.prod.outlook.com ([fe80::1c41:512e:796b:69e4]) by MWHPR04MB1137.namprd04.prod.outlook.com ([fe80::1c41:512e:796b:69e4%17]) with mapi id 15.20.0588.017; Tue, 20 Mar 2018 13:12:07 +0000 From: Stanislav Nijnikov To: Adrian Hunter , Vinayak Holikatti , "Martin K. Petersen" , "James E.J. Bottomley" CC: Jaegeuk Kim , Bart Van Assche , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Szymon Mielczarek , Alim Akhtar , Alex Lemberg , Vivek Gautam Subject: RE: [PATCH V3 1/1] scsi: ufs: Add support for Auto-Hibernate Idle Timer Thread-Topic: [PATCH V3 1/1] scsi: ufs: Add support for Auto-Hibernate Idle Timer Thread-Index: AQHTwEyf6/ox3b0bCE6eB0oySVuM9KPZGTog Date: Tue, 20 Mar 2018 13:12:06 +0000 Message-ID: References: <1521551258-4027-1-git-send-email-adrian.hunter@intel.com> <1521551258-4027-2-git-send-email-adrian.hunter@intel.com> In-Reply-To: <1521551258-4027-2-git-send-email-adrian.hunter@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Stanislav.Nijnikov@wdc.com; x-originating-ip: [212.25.79.133] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR04MB0542;7:2OnnEm+Cge98rz5YGin18LjeBVGapHgEO2PfrIccPkbs4TActPFpwVOCAWBUwIB8j8Ol1mxWWVzMWVyAkPiydSaDRlhabDAuDui6f9pknOXp3QOjrm5525VCOeEJBkA/Z/DDjhGC17I6GSDsBOOZpx1fSo6n5DP4pJ9EyL9cyP7iY/iEG0OcjeTSkqYuASxHhUlIBKrgX1KAM/dGEy9C8uhplneJO9+CduyABbKAVW0Ew/y8no7ioRMRuhxEayi4;20:nSkFbl5Toq4ZtPqHosJMEqXfesSv4bo51iWoHEPPj7rwp0gsHFw3fiCuPWM6EFJTlDVgglTMdgwHcXvgfkXNr9qo6djMSKBlD+Z3zgINkzPuxlyuq8xFVTjILiPQ8AatT0qHpDqJHj99SICcIvTeiWAO8UfAkRTbDzlzpdN5ZjM= x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ffd1a7b7-c279-48d2-17d6-08d58e642e8e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:MWHPR04MB0542; x-ms-traffictypediagnostic: MWHPR04MB0542: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(85827821059158)(104084551191319)(146099531331640)(7411616537696)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231221)(944501244)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041310)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:MWHPR04MB0542;BCL:0;PCL:0;RULEID:;SRVR:MWHPR04MB0542; x-forefront-prvs: 061725F016 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(346002)(376002)(39860400002)(396003)(39380400002)(50944005)(199004)(189003)(13464003)(186003)(5660300001)(68736007)(3280700002)(9686003)(229853002)(72206003)(6246003)(305945005)(2950100002)(4326008)(74316002)(53936002)(105586002)(39060400002)(7736002)(102836004)(575784001)(478600001)(8676002)(3846002)(26005)(3660700001)(86362001)(97736004)(81156014)(81166006)(316002)(2900100001)(106356001)(25786009)(7416002)(59450400001)(7696005)(5250100002)(6436002)(66066001)(6116002)(110136005)(33656002)(76176011)(2906002)(55016002)(6506007)(53546011)(54906003)(14454004)(99286004)(8936002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR04MB0542;H:MWHPR04MB1137.namprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-microsoft-antispam-message-info: cAbjhy3LZ/Kp/28XdolO6MVmOepvRO/zvZTADs4IiFzJUULjYCKbf+Rm5MYF75nFn3ye5I+Ldcq7g06Te4i1Lb8iqQsFsYVBOiC/MrNlCs7ZlGfzgUghATBzQrdlPSkb/78l+DiwbLek2HngyW3/BD2578fjGt2oi8/Sn+NpjYXpvWABFTKLwjYKsKWUVigEPOBX4WRrFwq2iu8aYAgELuNqML1pMlTYmtefxg26HLnsm4DD5ak300X3WsTtW7dxJtaowoy4kav4oVtmhbiYfvdcmkXcV3rAWFBeH3TglPOTN504mNsVDpKA+cNGmms6blRSmo59H/EMLMRFqZwN0g== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffd1a7b7-c279-48d2-17d6-08d58e642e8e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2018 13:12:07.0324 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR04MB0542 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Adrian Hunter [mailto:adrian.hunter@intel.com] > Sent: Tuesday, March 20, 2018 3:08 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; Szymon Mielczarek > ; Alim Akhtar > ; Alex Lemberg ; > Vivek Gautam > Subject: [PATCH V3 1/1] scsi: ufs: Add support for Auto-Hibernate Idle Ti= mer >=20 > UFS host controllers may support an autonomous power management > feature called the Auto-Hibernate Idle Timer. The timer is set to the num= ber > of microseconds of idle time before the UFS host controller will > autonomously put the link into Hibernate state. That will save power at t= he > 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. >=20 > 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. >=20 > Signed-off-by: Adrian Hunter Acked-by: Stanislav Nijnikov > --- > Documentation/ABI/testing/sysfs-driver-ufs | 14 ++++++ > drivers/scsi/ufs/ufs-sysfs.c | 76 > ++++++++++++++++++++++++++++++ > drivers/scsi/ufs/ufshcd.c | 26 ++++++++++ > drivers/scsi/ufs/ufshcd.h | 3 ++ > drivers/scsi/ufs/ufshci.h | 7 +++ > 5 files changed, 126 insertions(+) >=20 > diff --git a/Documentation/ABI/testing/sysfs-driver-ufs > b/Documentation/ABI/testing/sysfs-driver-ufs > index 83735f79e572..016724ec26d5 100644 > --- a/Documentation/ABI/testing/sysfs-driver-ufs > +++ b/Documentation/ABI/testing/sysfs-driver-ufs > @@ -1,3 +1,17 @@ > +What: /sys/bus/*/drivers/ufshcd/*/auto_hibern8 > +Date: March 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 '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 > 4ff9e0b7eba1..8d9332bb7d0c 100644 > --- a/drivers/scsi/ufs/ufs-sysfs.c > +++ b/drivers/scsi/ufs/ufs-sysfs.c > @@ -3,6 +3,7 @@ >=20 > #include > #include > +#include > #include >=20 > #include "ufs.h" > @@ -117,12 +118,86 @@ static ssize_t spm_target_link_state_show(struct > device *dev, > ufs_pm_lvl_states[hba- > >spm_lvl].link_state)); > } >=20 > +static void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit) { > + unsigned long flags; > + > + if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT)) > + return; > + > + spin_lock_irqsave(hba->host->host_lock, flags); > + if (hba->ahit =3D=3D ahit) > + goto out_unlock; > + hba->ahit =3D ahit; > + if (!pm_runtime_suspended(hba->dev)) > + ufshcd_writel(hba, hba->ahit, > REG_AUTO_HIBERNATE_IDLE_TIMER); > +out_unlock: > + spin_unlock_irqrestore(hba->host->host_lock, flags); } > + > +/* Convert Auto-Hibernate Idle Timer register value to microseconds */ > +static int ufshcd_ahit_to_us(u32 ahit) { > + int timer =3D FIELD_GET(UFSHCI_AHIBERN8_TIMER_MASK, ahit); > + int scale =3D FIELD_GET(UFSHCI_AHIBERN8_SCALE_MASK, ahit); > + > + for (; scale > 0; --scale) > + timer *=3D UFSHCI_AHIBERN8_SCALE_FACTOR; > + > + return timer; > +} > + > +/* Convert microseconds to Auto-Hibernate Idle Timer register value */ > +static u32 ufshcd_us_to_ahit(unsigned int timer) { > + unsigned int scale; > + > + for (scale =3D 0; timer > UFSHCI_AHIBERN8_TIMER_MASK; ++scale) > + timer /=3D UFSHCI_AHIBERN8_SCALE_FACTOR; > + > + return FIELD_PREP(UFSHCI_AHIBERN8_TIMER_MASK, timer) | > + FIELD_PREP(UFSHCI_AHIBERN8_SCALE_MASK, scale); } > + > +static ssize_t auto_hibern8_show(struct device *dev, > + struct device_attribute *attr, char *buf) { > + struct ufs_hba *hba =3D dev_get_drvdata(dev); > + > + if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT)) > + return -EOPNOTSUPP; > + > + return snprintf(buf, PAGE_SIZE, "%d\n", ufshcd_ahit_to_us(hba- > >ahit)); > +} > + > +static ssize_t auto_hibern8_store(struct device *dev, > + struct device_attribute *attr, > + const char *buf, size_t count) > +{ > + struct ufs_hba *hba =3D dev_get_drvdata(dev); > + unsigned int timer; > + > + if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT)) > + return -EOPNOTSUPP; > + > + if (kstrtouint(buf, 0, &timer)) > + return -EINVAL; > + > + if (timer > UFSHCI_AHIBERN8_MAX) > + return -EINVAL; > + > + ufshcd_auto_hibern8_update(hba, ufshcd_us_to_ahit(timer)); > + > + return count; > +} > + > static DEVICE_ATTR_RW(rpm_lvl); > static DEVICE_ATTR_RO(rpm_target_dev_state); > static DEVICE_ATTR_RO(rpm_target_link_state); > static DEVICE_ATTR_RW(spm_lvl); > static DEVICE_ATTR_RO(spm_target_dev_state); > static DEVICE_ATTR_RO(spm_target_link_state); > +static DEVICE_ATTR_RW(auto_hibern8); >=20 > static struct attribute *ufs_sysfs_ufshcd_attrs[] =3D { > &dev_attr_rpm_lvl.attr, > @@ -131,6 +206,7 @@ static ssize_t spm_target_link_state_show(struct > device *dev, > &dev_attr_spm_lvl.attr, > &dev_attr_spm_target_dev_state.attr, > &dev_attr_spm_target_link_state.attr, > + &dev_attr_auto_hibern8.attr, > NULL > }; >=20 > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index > 3abcd31646eb..facee2b97926 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -41,6 +41,7 @@ > #include > #include > #include > +#include > #include "ufshcd.h" > #include "ufs_quirks.h" > #include "unipro.h" > @@ -3708,6 +3709,18 @@ static int ufshcd_uic_hibern8_exit(struct ufs_hba > *hba) > return ret; > } >=20 > +static void ufshcd_auto_hibern8_enable(struct ufs_hba *hba) { > + unsigned long flags; > + > + if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) || !hba- > >ahit) > + return; > + > + spin_lock_irqsave(hba->host->host_lock, flags); > + ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER); > + spin_unlock_irqrestore(hba->host->host_lock, flags); } > + > /** > * ufshcd_init_pwr_info - setting the POR (power on reset) > * values in hba power info > @@ -6307,6 +6320,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) > /* UniPro link is active now */ > ufshcd_set_link_active(hba); >=20 > + /* Enable Auto-Hibernate if configured */ > + ufshcd_auto_hibern8_enable(hba); > + > ret =3D ufshcd_verify_dev_init(hba); > if (ret) > goto out; > @@ -7391,6 +7407,10 @@ static int ufshcd_resume(struct ufs_hba *hba, > enum ufs_pm_op pm_op) >=20 > /* Schedule clock gating in case of no access to UFS device yet */ > ufshcd_release(hba); > + > + /* Enable Auto-Hibernate if configured */ > + ufshcd_auto_hibern8_enable(hba); > + > goto out; >=20 > set_old_link_state: > @@ -7834,6 +7854,12 @@ int ufshcd_init(struct ufs_hba *hba, void > __iomem *mmio_base, unsigned int irq) > UFS_SLEEP_PWR_MODE, > UIC_LINK_HIBERN8_STATE); >=20 > + /* Set the default auto-hiberate idle timer value to 150 ms */ > + if (hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) { > + hba->ahit =3D FIELD_PREP(UFSHCI_AHIBERN8_TIMER_MASK, > 150) | > + FIELD_PREP(UFSHCI_AHIBERN8_SCALE_MASK, 3); > + } > + > /* Hold auto suspend until async scan completes */ > pm_runtime_get_sync(dev); >=20 > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index > deb3c5d382e9..8110dcd04d22 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -531,6 +531,9 @@ struct ufs_hba { > struct device_attribute spm_lvl_attr; > int pm_op_in_progress; >=20 > + /* Auto-Hibernate Idle Timer register value */ > + u32 ahit; > + > struct ufshcd_lrb *lrb; > unsigned long lrb_in_use; >=20 > diff --git a/drivers/scsi/ufs/ufshci.h b/drivers/scsi/ufs/ufshci.h index > 1a1b5d9fe514..bb5d9c7f3353 100644 > --- a/drivers/scsi/ufs/ufshci.h > +++ b/drivers/scsi/ufs/ufshci.h > @@ -86,6 +86,7 @@ enum { > enum { > MASK_TRANSFER_REQUESTS_SLOTS =3D 0x0000001F, > MASK_TASK_MANAGEMENT_REQUEST_SLOTS =3D 0x00070000, > + MASK_AUTO_HIBERN8_SUPPORT =3D 0x00800000, > MASK_64_ADDRESSING_SUPPORT =3D 0x01000000, > MASK_OUT_OF_ORDER_DATA_DELIVERY_SUPPORT =3D 0x02000000, > MASK_UIC_DME_TEST_MODE_SUPPORT =3D 0x04000000, > @@ -119,6 +120,12 @@ enum { > #define MANUFACTURE_ID_MASK UFS_MASK(0xFFFF, 0) > #define PRODUCT_ID_MASK UFS_MASK(0xFFFF, 16) >=20 > +/* AHIT - Auto-Hibernate Idle Timer */ > +#define UFSHCI_AHIBERN8_TIMER_MASK GENMASK(9, 0) > +#define UFSHCI_AHIBERN8_SCALE_MASK GENMASK(12, 10) > +#define UFSHCI_AHIBERN8_SCALE_FACTOR 10 > +#define UFSHCI_AHIBERN8_MAX (1023 * 100000) > + > /* > * IS - Interrupt Status - 20h > */ > -- > 1.9.1