Commit cff97f33 authored by Al Cooper's avatar Al Cooper Committed by Felipe Balbi

usb: bdc: fix "xsf for ep not enabled" errror

This patch essentially clears the port status change bits at the
correct times. It is necessary because the driver was not handling
the change bits correctly for events during device
connection/disconnection and bus enumeration. So, one of them (PCC)
was left stuck sometimes causing the "xsf for ep not enabled"
error we get on first connection. This was found by the Android team.
This was debugged and fixed by Sasi Kumar.
Signed-off-by: default avatarAl Cooper <alcooperx@gmail.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 0de97425
...@@ -249,6 +249,7 @@ void bdc_sr_uspc(struct bdc *bdc, struct bdc_sr *sreport) ...@@ -249,6 +249,7 @@ void bdc_sr_uspc(struct bdc *bdc, struct bdc_sr *sreport)
disconn = true; disconn = true;
else if ((uspc & BDC_PCS) && !BDC_PST(uspc)) else if ((uspc & BDC_PCS) && !BDC_PST(uspc))
connected = true; connected = true;
clear_flags |= BDC_PCC;
} }
/* Change in VBus and VBus is present */ /* Change in VBus and VBus is present */
...@@ -259,16 +260,16 @@ void bdc_sr_uspc(struct bdc *bdc, struct bdc_sr *sreport) ...@@ -259,16 +260,16 @@ void bdc_sr_uspc(struct bdc *bdc, struct bdc_sr *sreport)
bdc_softconn(bdc); bdc_softconn(bdc);
usb_gadget_set_state(&bdc->gadget, USB_STATE_POWERED); usb_gadget_set_state(&bdc->gadget, USB_STATE_POWERED);
} }
clear_flags = BDC_VBC; clear_flags |= BDC_VBC;
} else if ((uspc & BDC_PRS) || (uspc & BDC_PRC) || disconn) { } else if ((uspc & BDC_PRS) || (uspc & BDC_PRC) || disconn) {
/* Hot reset, warm reset, 2.0 bus reset or disconn */ /* Hot reset, warm reset, 2.0 bus reset or disconn */
dev_dbg(bdc->dev, "Port reset or disconn\n"); dev_dbg(bdc->dev, "Port reset or disconn\n");
bdc_uspc_disconnected(bdc, disconn); bdc_uspc_disconnected(bdc, disconn);
clear_flags = BDC_PCC|BDC_PCS|BDC_PRS|BDC_PRC; clear_flags |= BDC_PRC;
} else if ((uspc & BDC_PSC) && (uspc & BDC_PCS)) { } else if ((uspc & BDC_PSC) && (uspc & BDC_PCS)) {
/* Change in Link state */ /* Change in Link state */
handle_link_state_change(bdc, uspc); handle_link_state_change(bdc, uspc);
clear_flags = BDC_PSC|BDC_PCS; clear_flags |= BDC_PSC;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment