aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorBin Meng2018-05-23 23:40:47 -0700
committerMarek Vasut2018-05-30 11:59:10 +0200
commit793c819c6e2168110ad7cfca0349738c79d79a1f (patch)
tree84d519a5edca80cddcc0022cff71c1376b682feb /drivers/usb/host
parent3f484226793166c75bd56784832d4c1a84061ad5 (diff)
usb: xhci: Set accurate add context flags when updating hub attributes
If a USB 3.0 hub is plugged into the root port of the xHC, the xHCI driver will issue a 'Configure Endpoint' command to the xHC for it to update its internal data structure for this hub device. The hub attributes are in the slot context so we need tell xHC to update the slot context by setting the add context flags of the input control context to only cover the slot context. At present the add context flags is or'ed with the slot context bit, but it should really be accurately set to the slot context, as the variable that holds the value of the add context flags comes from whatever was set in the last command execution, which may contain additional contexts that 'Configure Endpoint' command should not touch. Some xHC implementations like x86 don't complain such, but it was observed on Renesas RCar Gen3 platform that the RCar xHC complains with a 'TRB error' completion codes as the response. Reported-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Marek Vasut <marek.vasut@gmail.com> Tested-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 3adb0028f2a..565948c1199 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1424,7 +1424,7 @@ static int xhci_update_hub_device(struct udevice *dev, struct usb_device *udev)
ctrl_ctx = xhci_get_input_control_ctx(in_ctx);
/* Initialize the input context control */
- ctrl_ctx->add_flags |= cpu_to_le32(SLOT_FLAG);
+ ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG);
ctrl_ctx->drop_flags = 0;
xhci_inval_cache((uintptr_t)out_ctx->bytes, out_ctx->size);