* [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros
@ 2015-05-14 18:39 Subbaraya Sundeep Bhatta
2015-05-14 18:39 ` [PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails Subbaraya Sundeep Bhatta
2015-05-14 18:47 ` [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros Felipe Balbi
0 siblings, 2 replies; 3+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2015-05-14 18:39 UTC (permalink / raw)
To: balbi; +Cc: gregkh, linux-usb, linux-kernel, Subbaraya Sundeep Bhatta
Modified DEPCMD and DGCMD status checking macros as per databook.
Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
---
drivers/usb/dwc3/core.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index fdab715..60acc5c9 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -339,7 +339,7 @@
#define DWC3_DGCMD_SET_ENDPOINT_NRDY 0x0c
#define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK 0x10
-#define DWC3_DGCMD_STATUS(n) (((n) >> 15) & 1)
+#define DWC3_DGCMD_STATUS(n) (((n) >> 12) & 1)
#define DWC3_DGCMD_CMDACT (1 << 10)
#define DWC3_DGCMD_CMDIOC (1 << 8)
@@ -355,7 +355,7 @@
#define DWC3_DEPCMD_PARAM_SHIFT 16
#define DWC3_DEPCMD_PARAM(x) ((x) << DWC3_DEPCMD_PARAM_SHIFT)
#define DWC3_DEPCMD_GET_RSC_IDX(x) (((x) >> DWC3_DEPCMD_PARAM_SHIFT) & 0x7f)
-#define DWC3_DEPCMD_STATUS(x) (((x) >> 15) & 1)
+#define DWC3_DEPCMD_STATUS(x) (((x) >> 12) & 0x0F)
#define DWC3_DEPCMD_HIPRI_FORCERM (1 << 11)
#define DWC3_DEPCMD_CMDACT (1 << 10)
#define DWC3_DEPCMD_CMDIOC (1 << 8)
--
1.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails
2015-05-14 18:39 [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros Subbaraya Sundeep Bhatta
@ 2015-05-14 18:39 ` Subbaraya Sundeep Bhatta
2015-05-14 18:47 ` [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros Felipe Balbi
1 sibling, 0 replies; 3+ messages in thread
From: Subbaraya Sundeep Bhatta @ 2015-05-14 18:39 UTC (permalink / raw)
To: balbi; +Cc: gregkh, linux-usb, linux-kernel, Subbaraya Sundeep Bhatta
When sending DEPCMD or DGCMD command fails return error to caller.
Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
---
drivers/usb/dwc3/gadget.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 8946c32..55b5edc 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -291,6 +291,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DGCMD_STATUS(reg));
+ if (DWC3_DGCMD_STATUS(reg))
+ return -EINVAL;
return 0;
}
@@ -328,6 +330,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DEPCMD_STATUS(reg));
+ if (DWC3_DEPCMD_STATUS(reg))
+ return -EINVAL;
return 0;
}
--
1.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros
2015-05-14 18:39 [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros Subbaraya Sundeep Bhatta
2015-05-14 18:39 ` [PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails Subbaraya Sundeep Bhatta
@ 2015-05-14 18:47 ` Felipe Balbi
1 sibling, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2015-05-14 18:47 UTC (permalink / raw)
To: Subbaraya Sundeep Bhatta
Cc: balbi, gregkh, linux-usb, linux-kernel, Subbaraya Sundeep Bhatta
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
On Fri, May 15, 2015 at 12:09:29AM +0530, Subbaraya Sundeep Bhatta wrote:
> Modified DEPCMD and DGCMD status checking macros as per databook.
>
> Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
please resend with proper Fixes and Cc stable. Should be something like:
Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support)
Cc: <stable@vger.kernel.org> # v3.5+
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-14 21:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 18:39 [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros Subbaraya Sundeep Bhatta
2015-05-14 18:39 ` [PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails Subbaraya Sundeep Bhatta
2015-05-14 18:47 ` [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome