usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
PATCH 1/1 usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
From: Frank Wang <[email protected]>
In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64 bytes as default, as a result, it failed to match the size at initialization stage in usb controller.
Actually, hardware can support less than or equal to 512 bytes in high speed mode, so I changed the condition from '!=' to '>' to fix this issue.
---
drivers/usb/gadget/dwc2_udc_otg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/dwc2_udc_otg.c +2 -2
@@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep, }/* hardware _could_ do smaller, but driver doesn't */ -if ((desc->bmAttributes ==USB_ENDPOINT_XFER_BULK - &&le16_to_cpu (get_unaligned (&desc->wMaxPacketSize)) != +if ((desc->bmAttributes ==USB_ENDPOINT_XFER_BULK && +le16_to_cpu (get_unaligned (&desc->wMaxPacketSize)) >ep_maxpacket (ep)) || !get_unaligned (&desc->wMaxPacketSize)) {debug ("%s: bad %s maxpacket\n" , __func__, _ep->name);
Signature · 1 line
1.8.5
Marek Vasut
AppliedPATCH 1/1 usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
Quoted 9 lines · Steve Rae
From: Frank Wang <[email protected]>
In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64 bytes as default, as a result, it failed to match the size at initialization stage in usb controller.
Actually, hardware can support less than or equal to 512 bytes in high speed mode, so I changed the condition from '!=' to '>' to fix this issue.
Quoted 3 lines
Signed-off-by Frank Wang <[email protected]>Tested-by Steve Rae <[email protected]>---
Applied, thanks.
Best regards,
Marek Vasut
PATCH 1/1 usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
In reply to Steve RaeHi Steve,
Quoted 8 lines
From: Frank Wang <[email protected]>
In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64 bytes as default, as a result, it failed to match the size at initialization stage in usb controller.
Actually, hardware can support less than or equal to 512 bytes in high speed mode, so I changed the condition from '!=' to '>' to fix this issue.
I'm aware of this problem, however now I'm busy with fixing dfu issue regarding sending large files (e.g. 26 MiB). Patches are under testing now.
After sending them I'll fix the fastboot problem.
Quoted 23 lines
Signed-off-by Frank Wang <[email protected]>Tested-by Steve Rae <[email protected]>---
drivers/usb/gadget/dwc2_udc_otg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/usb/gadget/dwc2_udc_otg.cindex 90ed5ff..19d6dcd 100644drivers/usb/gadget/dwc2_udc_otg.c +2
-2@@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep, }/* hardware _could_ do smaller, but driver doesn't */ -if ((desc->bmAttributes ==USB_ENDPOINT_XFER_BULK - &&le16_to_cpu (get_unaligned (&desc->wMaxPacketSize)) != +if ((desc->bmAttributes ==USB_ENDPOINT_XFER_BULK && +le16_to_cpu (get_unaligned (&desc->wMaxPacketSize)) >ep_maxpacket (ep)) || !get_unaligned (&desc->wMaxPacketSize)) {debug ("%s: bad %s maxpacket\n" , __func__, _ep->name);
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH 1/1 usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
In reply to Steve RaeHi Steve,
Quoted 21 lines
From: Frank Wang <[email protected]>
In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64 bytes as default, as a result, it failed to match the size at initialization stage in usb controller.
Actually, hardware can support less than or equal to 512 bytes in high speed mode, so I changed the condition from '!=' to '>' to fix this issue.Signed-off-by Frank Wang <[email protected]>Tested-by Steve Rae <[email protected]>---
drivers/usb/gadget/dwc2_udc_otg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/usb/gadget/dwc2_udc_otg.cindex 90ed5ff..19d6dcd 100644
drivers/usb/gadget/dwc2_udc_otg.c static int dwc2_ep_enable(struct usb_ep *_ep, · line 572
Quoted 10 lines
drivers/usb/gadget/dwc2_udc_otg.c +2
-2@@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep, }/* hardware _could_ do smaller, but driver doesn't */ -if ((desc->bmAttributes ==USB_ENDPOINT_XFER_BULK - &&le16_to_cpu (get_unaligned (&desc->wMaxPacketSize)) != +if ((desc->bmAttributes ==USB_ENDPOINT_XFER_BULK && +le16_to_cpu (get_unaligned (&desc->wMaxPacketSize)) >ep_maxpacket (ep)) || !get_unaligned (&desc->wMaxPacketSize)) {debug ("%s: bad %s maxpacket\n" , __func__, _ep->name);
Test HW: Trats - Exynos4210 (dwc2 udc controller).
@Marek:
Should I pick this patch or will you take it?
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH 1/1 usb: gadget: dwc2_udc_otg: modified the check condition for max packet size of ep_in in high speed
Quoted 42 lines · Lukasz Majewski
Hi Steve,
Quoted 32 lines
From: Frank Wang <[email protected]>
In current high speed fastboot, fs_ep_in.wMaxPacketSize is configured 64 bytes as default, as a result, it failed to match the size at initialization stage in usb controller.
Actually, hardware can support less than or equal to 512 bytes in high speed mode, so I changed the condition from '!=' to '>' to fix this issue.Signed-off-by Frank Wang <[email protected]>Tested-by Steve Rae <[email protected]>---
drivers/usb/gadget/dwc2_udc_otg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/usb/gadget/dwc2_udc_otg.cindex 90ed5ff..19d6dcd 100644drivers/usb/gadget/dwc2_udc_otg.c +2
-2@@ -565,8 +565,8 @@ static int dwc2_ep_enable(struct usb_ep *_ep, }/* hardware _could_ do smaller, but driver doesn't */ - if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK - && le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) != + if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK && + le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) >
ep_maxpacket(ep))Quoted 4 lines
|| || !get_unaligned(&desc->wMaxPacketSize)) { ||
debug("%s: bad %s maxpacket\n", __func__, _ep->name);Acked-by Lukasz Majewski <[email protected]>Tested-by Lukasz Majewski <[email protected]>
Quoted 5 lines
Test HW: Trats - Exynos4210 (dwc2 udc controller).
@Marek:
Should I pick this patch or will you take it?
Pick it (and all the other udc stuff) and send me a PR please.
Best regards,
Marek Vasut