REMOVE LATER ON!
In today's UAS host driver MODE SENSE command isn't handled correctly.
Each time after power up there is a unit attention condition of
RESET_OCCURRED that needs to be cleared (= acknowledged by the
host) by the MODE SENSE command.
Due to the above this patch resets the RESET_OCCURRED unit attention.

Signed-off-by: Tatyana Brokhman <[email protected]>

diff --git a/drivers/usb/gadget/uasp_cmdiu.c b/drivers/usb/gadget/uasp_cmdiu.c
index 4df3d98..51eb132 100644
--- a/drivers/usb/gadget/uasp_cmdiu.c
+++ b/drivers/usb/gadget/uasp_cmdiu.c
@@ -83,6 +83,13 @@ static __u32 check_cmdiu(struct uasp_dev *udev,
                        curlun->lun->unit_attention_data = SS_NO_SENSE;
                        return ua_data;
                }
+                       /* HACK!!! REMOVE!!! */
+               if (curlun->lun->unit_attention_data == SS_RESET_OCCURRED &&
+                       cmdiu->cdb[0] == INQUIRY) {
+                       curlun->lun->unit_attention_data = SS_NO_SENSE;
+                       DBG(udev->ucommon->common, "check_cmdiu() - "
+                              "HACK!!! RESETTING  unit attention condition\n");
+               }
        }
 
        if (curlun && !(curlun->lun->filp) && needs_medium) {
-- 
1.7.0.4

--
Sent by a Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to