Skip to contentSkip to conversation

scsi: ufs: Set fDeviceInit flag to initiate device initialization

PATCH New Dolev Raviv 1 participant 1 message May 9, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 scsi: ufs: Set fDeviceInit flag to initiate device initialization

Allow UFS device to complete its initialization and accept SCSI commands by setting fDeviceInit flag. The device may take time for this operation and hence the host should poll until fDeviceInit flag is toggled to zero. This step is mandated by UFS device specification for device initialization completion.

--
Changes for V4:
- Add NULL pointer check
- Changed fix from v3 to bug on since hba can't be null Changes for V3:
- Fix static checker error
Changes for V2:
- Add the query sending api via SCSI from the original query patch

drivers/scsi/ufs/ufs.h +9 -1
index 086ff03..742363d 100644
@@ -107,8 +107,13 @@ enum {
 	UPIU_QUERY_FUNC_STANDARD_WRITE_REQUEST = 0x81,
 };
 
+/* Flag idn for Query Requests*/
+enum flag_idn {
+	QUERY_FLAG_IDN_FDEVICEINIT = 0x01,
+};
+
 /* UTP QUERY Transaction Specific Fields OpCode */
-enum {
+enum query_opcode {
 	UPIU_QUERY_OPCODE_NOP		= 0x0,
 	UPIU_QUERY_OPCODE_READ_DESC	= 0x1,
 	UPIU_QUERY_OPCODE_WRITE_DESC	= 0x2,
@@ -208,6 +213,9 @@ struct utp_upiu_query {
 	u32 reserved[2];
 };
 
+/* Expose the flag value from utp_upiu_query.value */
+#define MASK_QUERY_UPIU_FLAG_LOC 0xFF
+
 /**
  * struct utp_upiu_req - general upiu request structure
  * @header:UPIU header structure DW-0 to DW-2
drivers/scsi/ufs/ufshcd.c +209 -0

233 lines not on this page · raw message

drivers/scsi/ufs/ufshcd.h +7 -0
index a91c558..76485da 100644
@@ -286,4 +286,11 @@ static inline int ufshcd_dme_hibern8_exit(struct ufs_hba *hba)
 	return ufshcd_dme_hibern8_ctrl(hba, 0);
 }
 
+int ufs_query_request(struct ufs_hba *hba,
+			struct ufs_query_req *query,
+			u8 *descriptor,
+			struct ufs_query_res *response,
+			int timeout,
+			int retries);
+
 #endif /* End of Header */
Signature · 5 lines
1.7.6

-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation