diff options
author | Peter Chen <peter.chen@nxp.com> | 2020-09-10 11:11:29 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-10-02 08:57:46 +0200 |
commit | d6be7c94f9f80fdb64d896b89657ebc9ed96e3ed (patch) | |
tree | 0e7ddfd8857a11eae2322fc01ff8a7a0b9694f80 /drivers/usb | |
parent | usb: cdns3: gadget: need to handle sg case for workaround 2 case (diff) | |
download | linux-d6be7c94f9f80fdb64d896b89657ebc9ed96e3ed.tar.xz linux-d6be7c94f9f80fdb64d896b89657ebc9ed96e3ed.zip |
usb: cdns3: gadget: sg_support is only for DEV_VER_V2 or above
The scatter buffer list support earlier than DEV_VER_V2 is not
good enough, software can't know well about short transfer for it.
Cc: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/cdns3/gadget.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index 9116704fd48e..6e7b70a2e352 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -3159,7 +3159,6 @@ static int cdns3_gadget_start(struct cdns3 *cdns) priv_dev->gadget.speed = USB_SPEED_UNKNOWN; priv_dev->gadget.ops = &cdns3_gadget_ops; priv_dev->gadget.name = "usb-ss-gadget"; - priv_dev->gadget.sg_supported = 1; priv_dev->gadget.quirk_avoids_skb_reserve = 1; priv_dev->gadget.irq = cdns->dev_irq; @@ -3198,6 +3197,8 @@ static int cdns3_gadget_start(struct cdns3 *cdns) readl(&priv_dev->regs->usb_cap2)); priv_dev->dev_ver = GET_DEV_BASE_VERSION(priv_dev->dev_ver); + if (priv_dev->dev_ver >= DEV_VER_V2) + priv_dev->gadget.sg_supported = 1; priv_dev->zlp_buf = kzalloc(CDNS3_EP_ZLP_BUF_SIZE, GFP_KERNEL); if (!priv_dev->zlp_buf) { |