aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufs.h
diff options
context:
space:
mode:
authorSujit Reddy Thumma <sthumma@codeaurora.org>2013-07-29 15:05:59 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-08-26 04:51:25 -0400
commit66ec6d59407baf7c7a1f99c79d632403c1064266 (patch)
tree8b91e5a11b0b6966c00146229ff7ac0e91ae6412 /drivers/scsi/ufs/ufs.h
parent68078d5cc1a59b2ddfc6982c67308f20f991426a (diff)
[SCSI] ufs: Add support for host assisted background operations
Background operations in the UFS device can be disabled by the host to reduce the response latency of transfer requests. Add support for enabling/disabling the background operations during runtime suspend/resume of the device. If the device is in critical need of BKOPS it will raise an URGENT_BKOPS exception which should be handled by the host to make sure the device performs as expected. During bootup, the BKOPS is enabled in the device by default. The disable of BKOPS is supported only when the driver supports runtime suspend/resume operations as the runtime PM framework provides a way to determine the device idleness and hence BKOPS can be managed effectively. During runtime resume the BKOPS is disabled to reduce latency and during runtime suspend the BKOPS is enabled to allow device to carry out idle time BKOPS. In some cases where the BKOPS is disabled during runtime resume and due to continuous data transfers the runtime suspend is not triggered, the BKOPS is enabled when the device raises a level-2 exception (outstanding operations - performance impact). Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs.h')
-rw-r--r--drivers/scsi/ufs/ufs.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h
index 50d32f16ece0..bce09a6898c4 100644
--- a/drivers/scsi/ufs/ufs.h
+++ b/drivers/scsi/ufs/ufs.h
@@ -107,6 +107,28 @@ enum {
107/* Flag idn for Query Requests*/ 107/* Flag idn for Query Requests*/
108enum flag_idn { 108enum flag_idn {
109 QUERY_FLAG_IDN_FDEVICEINIT = 0x01, 109 QUERY_FLAG_IDN_FDEVICEINIT = 0x01,
110 QUERY_FLAG_IDN_BKOPS_EN = 0x04,
111};
112
113/* Attribute idn for Query requests */
114enum attr_idn {
115 QUERY_ATTR_IDN_BKOPS_STATUS = 0x05,
116 QUERY_ATTR_IDN_EE_CONTROL = 0x0D,
117 QUERY_ATTR_IDN_EE_STATUS = 0x0E,
118};
119
120/* Exception event mask values */
121enum {
122 MASK_EE_STATUS = 0xFFFF,
123 MASK_EE_URGENT_BKOPS = (1 << 2),
124};
125
126/* Background operation status */
127enum {
128 BKOPS_STATUS_NO_OP = 0x0,
129 BKOPS_STATUS_NON_CRITICAL = 0x1,
130 BKOPS_STATUS_PERF_IMPACT = 0x2,
131 BKOPS_STATUS_CRITICAL = 0x3,
110}; 132};
111 133
112/* UTP QUERY Transaction Specific Fields OpCode */ 134/* UTP QUERY Transaction Specific Fields OpCode */
@@ -155,6 +177,7 @@ enum {
155 MASK_TASK_RESPONSE = 0xFF00, 177 MASK_TASK_RESPONSE = 0xFF00,
156 MASK_RSP_UPIU_RESULT = 0xFFFF, 178 MASK_RSP_UPIU_RESULT = 0xFFFF,
157 MASK_QUERY_DATA_SEG_LEN = 0xFFFF, 179 MASK_QUERY_DATA_SEG_LEN = 0xFFFF,
180 MASK_RSP_EXCEPTION_EVENT = 0x10000,
158}; 181};
159 182
160/* Task management service response */ 183/* Task management service response */