2020-07-17 15:26:18

by Al Cooper

[permalink] [raw]
Subject: [PATCH 0/7] usb: bdc: Updates and fixes to the USB BDC driver

Updates and fixes to the Broadcom USB BDC driver.

Al Cooper (4):
dt-bindings: usb: bdc: Update compatible strings
usb: bdc: Add compatible string for new style USB DT nodes
usb: bdc: Adb shows offline after resuming from S2
usb: bdc: driver runs out of buffer descriptors on large ADB transfers

Danesh Petigara (1):
usb: bdc: Halt controller on suspend

Florian Fainelli (1):
usb: bdc: Use devm_clk_get_optional()

Sasi Kumar (1):
bdc: Fix bug causing crash after multiple disconnects

.../devicetree/bindings/usb/brcm,bdc.txt | 4 +--
drivers/usb/gadget/udc/bdc/bdc.h | 2 +-
drivers/usb/gadget/udc/bdc/bdc_core.c | 26 ++++++++++++++-----
drivers/usb/gadget/udc/bdc/bdc_ep.c | 16 +++++++-----
4 files changed, 32 insertions(+), 16 deletions(-)

--
2.17.1


2020-07-17 15:27:00

by Al Cooper

[permalink] [raw]
Subject: [PATCH 4/7] usb: bdc: Adb shows offline after resuming from S2

On Android systems, After temporarily putting device to S2 by
short pressing the power button on the remote, the display turns
off. Then press the power button to turn the display back up. Adb
devices would show the devices is offline. It needs a physical
disconnect of the usb cable or power cycle to bring the device
back online. The device is operational otherwise.

The problem is that during S2 resume, the ADB gadget driver could
not link back with the BDC driver because the endpoint flags were
cleared. The fix is to clear the endpoint flags for the disconnect
case only and not for S2 exit.

Signed-off-by: Al Cooper <[email protected]>
---
drivers/usb/gadget/udc/bdc/bdc_core.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index be833d9e9db2..47bcc9f6afbd 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -292,9 +292,13 @@ static void bdc_mem_init(struct bdc *bdc, bool reinit)
/* Initialize SRR to 0 */
memset(bdc->srr.sr_bds, 0,
NUM_SR_ENTRIES * sizeof(struct bdc_bd));
- /* clear ep flags to avoid post disconnect stops/deconfigs */
- for (i = 1; i < bdc->num_eps; ++i)
- bdc->bdc_ep_array[i]->flags = 0;
+ /*
+ * clear ep flags to avoid post disconnect stops/deconfigs but
+ * not during S2 exit
+ */
+ if (!bdc->gadget.speed)
+ for (i = 1; i < bdc->num_eps; ++i)
+ bdc->bdc_ep_array[i]->flags = 0;
} else {
/* One time initiaization only */
/* Enable status report function pointers */
--
2.17.1

2020-07-21 09:36:36

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH 0/7] usb: bdc: Updates and fixes to the USB BDC driver


Hi,

Al Cooper <[email protected]> writes:
> Updates and fixes to the Broadcom USB BDC driver.
>
> Al Cooper (4):
> dt-bindings: usb: bdc: Update compatible strings
> usb: bdc: Add compatible string for new style USB DT nodes
> usb: bdc: Adb shows offline after resuming from S2
> usb: bdc: driver runs out of buffer descriptors on large ADB transfers
>
> Danesh Petigara (1):
> usb: bdc: Halt controller on suspend
>
> Florian Fainelli (1):
> usb: bdc: Use devm_clk_get_optional()
>
> Sasi Kumar (1):
> bdc: Fix bug causing crash after multiple disconnects

What should we do here? There are few comments which seem
unresolved. Are we getting a new version?

--
balbi


Attachments:
signature.asc (847.00 B)

2020-07-21 13:49:02

by Al Cooper

[permalink] [raw]
Subject: Re: [PATCH 0/7] usb: bdc: Updates and fixes to the USB BDC driver

On Tue, Jul 21, 2020 at 5:33 AM Felipe Balbi <[email protected]> wrote:
>
>
> Hi,
>
> Al Cooper <[email protected]> writes:
> > Updates and fixes to the Broadcom USB BDC driver.
> >
> > Al Cooper (4):
> > dt-bindings: usb: bdc: Update compatible strings
> > usb: bdc: Add compatible string for new style USB DT nodes
> > usb: bdc: Adb shows offline after resuming from S2
> > usb: bdc: driver runs out of buffer descriptors on large ADB transfers
> >
> > Danesh Petigara (1):
> > usb: bdc: Halt controller on suspend
> >
> > Florian Fainelli (1):
> > usb: bdc: Use devm_clk_get_optional()
> >
> > Sasi Kumar (1):
> > bdc: Fix bug causing crash after multiple disconnects
>
> What should we do here? There are few comments which seem
> unresolved. Are we getting a new version?

I'm resolving the comments and submitting v2 today.

Thanks
Al

>
> --
> balbi