summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/aspeed-vhub
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2019-07-26 08:05:30 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2019-08-12 08:54:48 +0300
commit9fbbeb4eff076859891c022c151ad20eda83d983 (patch)
treebaa556350f3b847e4a293276b0166784c67b8da1 /drivers/usb/gadget/udc/aspeed-vhub
parent240b65dc1e89dd83d0c4946f58e49e7ee669b25d (diff)
downloadlinux-9fbbeb4eff076859891c022c151ad20eda83d983.tar.xz
usb: gadget: aspeed: Don't set port enable change bit on reset
This bit should be only set when the port enable goes down, for example, on errors. Not when it gets set after a port reset. Some USB stacks seem to be sensitive to this and fails enumeration. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/udc/aspeed-vhub')
-rw-r--r--drivers/usb/gadget/udc/aspeed-vhub/hub.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/aspeed-vhub/hub.c b/drivers/usb/gadget/udc/aspeed-vhub/hub.c
index 7c040f56100e..0755115fd90d 100644
--- a/drivers/usb/gadget/udc/aspeed-vhub/hub.c
+++ b/drivers/usb/gadget/udc/aspeed-vhub/hub.c
@@ -449,8 +449,15 @@ static void ast_vhub_change_port_stat(struct ast_vhub *vhub,
USB_PORT_STAT_C_OVERCURRENT |
USB_PORT_STAT_C_RESET |
USB_PORT_STAT_C_L1;
- p->change |= chg;
+ /*
+ * We only set USB_PORT_STAT_C_ENABLE if we are disabling
+ * the port as per USB spec, otherwise MacOS gets upset
+ */
+ if (p->status & USB_PORT_STAT_ENABLE)
+ chg &= ~USB_PORT_STAT_C_ENABLE;
+
+ p->change = chg;
ast_vhub_update_hub_ep1(vhub, port);
}
}