History log of /linux-master/drivers/usb/gadget/udc/aspeed-vhub/ep0.c
Revision Date Author Comments
# 34427557 13-Mar-2023 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

usb: gadget: aspeed: Rectify a bit a random header inclusion

It looks like the driver copied'n'pasted almost random set of
headers for its code. Rectify it a bit by removing of_gpio.h
that is not only unused, but also will be removed in the future
completely.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230313155310.80022-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d693bbd4 08-Dec-2021 Neal Liu <neal_liu@aspeedtech.com>

usb: aspeed-vhub: fix ep0 OUT ack received wrong length issue

If multiple devices in vhub are enumerated simultaneously, ep0 OUT
ack might received wrong data length. Using expected data length
instead.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
Link: https://lore.kernel.org/r/20211208100545.1441397-4-neal_liu@aspeedtech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5786b433 22-Aug-2021 Cai Huoqing <caihuoqing@baidu.com>

usb: gadget: aspeed: Remove repeated verbose license text

remove it because SPDX-License-Identifier is already used

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210823045807.49-1-caihuoqing@baidu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ef9d3468 25-Jul-2019 Benjamin Herrenschmidt <benh@kernel.crashing.org>

usb: gadget: aspeed: Don't reject requests on suspended devices

A disconnect may just suspend the hub in absence of a physical
disconnect detection. If we start rejecting requests, the mass
storage function gets into a spin trying to requeue the same
request for ever and hangs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 7e420cef 25-Jul-2019 Benjamin Herrenschmidt <benh@kernel.crashing.org>

usb: gadget: aspeed: Fix EP0 stall handling

When stalling EP0, we need to wait for an ACK interrupt,
otherwise we may get out of sync on the next setup packet
data phase. Also we need to ignore the direction when
processing that interrupt as the HW reports a potential
mismatch.

Implement this by adding a stall state to EP0. This fixes
some reported issues with mass storage and some hosts.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# d042c35e 25-Jul-2019 Benjamin Herrenschmidt <benh@kernel.crashing.org>

usb: gadget: aspeed: Cleanup EP0 state on port reset

Otherwise, we can have a stale state after a disconnect and reconnect
causing errors on the first SETUP packet to the device.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# bb286336 11-Jul-2018 Benjamin Herrenschmidt <benh@kernel.crashing.org>

usb: gadget: aspeed: Workaround memory ordering issue

The Aspeed SoC has a memory ordering issue that (thankfully)
only affects the USB gadget device. A read back is necessary
after writing to memory and before letting the device DMA
from it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 9196b55e 27-Jun-2018 Benjamin Herrenschmidt <benh@linux.vnet.ibm.com>

usb: gadget: aspeed-vhub: Fix SETUP packets with OUT data phase

A couple of bugs in the driver are preventing SETUP packets
with an OUT data phase from working properly.

Interestingly those are incredibly rare (RNDIS typically
uses them and thus is broken without this fix).

The main problem was an incorrect register offset being
applied for arming RX on EP0. The other problem relates
to stalling such a packet before the data phase, in which
case we don't get an ACK cycle, and get the next SETUP
packet directly, so we shouldn't reject it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 7ecca2a4 03-May-2018 Benjamin Herrenschmidt <benh@kernel.crashing.org>

usb/gadget: Add driver for Aspeed SoC virtual hub

The Aspeed BMC SoCs support a "virtual hub" function. It provides some
HW support for a top-level USB2 hub behind which sit 5 gadget "ports".

This driver adds support for the full functionality, emulating the
hub standard requests and exposing 5 UDC gadget drivers corresponding
to the ports.

The hub itself has HW provided dedicated EP0 and EP1 (the latter for
hub interrupts). It also has dedicated EP0s for each function. For
other endpoints, there's a pool of 15 "generic" endpoints that are
shared among the ports.

The driver relies on my previous patch adding a "dispose" EP op to
handle EP allocation between ports. EPs are allocated from the shared
pool in the UDC "match_ep" callback and assigned to the UDC instance
(added to the gadget ep_list).

When the composite driver gets unbound, the new hook will allow the UDC
to clean things up and return those EPs to the shared pool.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>