linux_dsm_epyc7002/drivers/usb
Pawel Laszczak 5d363120aa usb: gadget: Fix issue with config_ep_by_speed function
This patch adds new config_ep_by_speed_and_alt function which
extends the config_ep_by_speed about alt parameter.
This additional parameter allows to find proper usb_ss_ep_comp_descriptor.

Problem has appeared during testing f_tcm (BOT/UAS) driver function.

f_tcm function for SS use array of headers for both  BOT/UAS alternate
setting:

static struct usb_descriptor_header *uasp_ss_function_desc[] = {
        (struct usb_descriptor_header *) &bot_intf_desc,
        (struct usb_descriptor_header *) &uasp_ss_bi_desc,
        (struct usb_descriptor_header *) &bot_bi_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_ss_bo_desc,
        (struct usb_descriptor_header *) &bot_bo_ep_comp_desc,

        (struct usb_descriptor_header *) &uasp_intf_desc,
        (struct usb_descriptor_header *) &uasp_ss_bi_desc,
        (struct usb_descriptor_header *) &uasp_bi_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_bi_pipe_desc,
        (struct usb_descriptor_header *) &uasp_ss_bo_desc,
        (struct usb_descriptor_header *) &uasp_bo_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_bo_pipe_desc,
        (struct usb_descriptor_header *) &uasp_ss_status_desc,
        (struct usb_descriptor_header *) &uasp_status_in_ep_comp_desc,
        (struct usb_descriptor_header *) &uasp_status_pipe_desc,
        (struct usb_descriptor_header *) &uasp_ss_cmd_desc,
        (struct usb_descriptor_header *) &uasp_cmd_comp_desc,
        (struct usb_descriptor_header *) &uasp_cmd_pipe_desc,
        NULL,
};

The first 5 descriptors are associated with BOT alternate setting,
and others are associated with UAS.

During handling UAS alternate setting f_tcm driver invokes
config_ep_by_speed and this function sets incorrect companion endpoint
descriptor in usb_ep object.

Instead setting ep->comp_desc to uasp_bi_ep_comp_desc function in this
case set ep->comp_desc to uasp_ss_bi_desc.

This is due to the fact that it searches endpoint based on endpoint
address:

        for_each_ep_desc(speed_desc, d_spd) {
                chosen_desc = (struct usb_endpoint_descriptor *)*d_spd;
                if (chosen_desc->bEndpoitAddress == _ep->address)
                        goto ep_found;
        }

And in result it uses the descriptor from BOT alternate setting
instead UAS.

Finally, it causes that controller driver during enabling endpoints
detect that just enabled endpoint for bot.

Signed-off-by: Jayshri Pawar <jpawar@cadence.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
2020-05-25 11:09:44 +03:00
..
atm USB: atm: Use the correct style for SPDX License Identifier 2020-03-17 20:03:28 +01:00
c67x00 USB: c67x00: Use the correct style for SPDX License Identifier 2020-03-17 20:03:28 +01:00
cdns3 usb: cdns3: ep0: delete the redundant status stage 2020-05-25 11:09:44 +03:00
chipidea Power management updates for 5.7-rc1 2020-03-30 15:05:01 -07:00
class cdc-acm: introduce a cool down 2020-04-16 14:59:49 +02:00
common usb: common: usb-conn-gpio: Don't log an error on probe deferral 2019-12-10 11:41:20 +01:00
core USB: hub: Revert commit bd0e6c9614 ("usb: hub: try old enumeration scheme first for high speed devices") 2020-04-23 15:22:41 +02:00
dwc2 usb: dwc2: Update Core Reset programming flow. 2020-05-25 11:09:44 +03:00
dwc3 usb: dwc3: Increase timeout for CmdAct cleared by device controller 2020-05-25 11:09:43 +03:00
early USB: early: Handle AMD's spec-compliant identifiers, too 2020-04-16 14:46:00 +02:00
gadget usb: gadget: Fix issue with config_ep_by_speed function 2020-05-25 11:09:44 +03:00
host xhci: Don't clear hub TT buffer on ep0 protocol stall 2020-04-21 16:27:38 +02:00
image Merge 5.4-rc3 into usb-next 2019-10-14 07:09:59 +02:00
isp1760 remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
misc USB: sisusbvga: Change port variable from signed to unsigned 2020-04-23 15:26:17 +02:00
mon USB: mon: Use scnprintf() for avoiding potential buffer overflow 2020-03-12 09:49:28 +01:00
mtu3 USB: mtu3: Use the correct style for SPDX License Identifier 2020-05-25 11:09:37 +03:00
musb usb: musb: tusb6010: fix a possible missing data type replacement 2020-03-17 20:03:28 +01:00
phy usb: phy: Add driver for the Ingenic JZ4770 USB transceiver 2020-03-12 09:53:08 +01:00
renesas_usbhs usb: renesas_usbhs: Use the correct style for SPDX License Identifier 2020-05-25 11:09:38 +03:00
roles usb: roles: Allow the role switches to be named 2020-03-04 11:12:50 +01:00
serial USB-serial updates for 5.7-rc1 2020-03-26 11:15:30 +01:00
storage usb-storage: Add unusual_devs entry for JMicron JMS566 2020-04-23 15:22:42 +02:00
typec usb: typec: altmode: Fix typec_altmode_get_partner sometimes returning an invalid pointer 2020-04-22 19:23:19 +02:00
usbip usbip: Fix error path of vhci_recv_ret_submit() 2019-12-17 16:36:33 +01:00
Kconfig usb: common: create Kconfig file 2019-09-03 19:00:39 +02:00
Makefile USB: Changes for v5.4 merge window 2019-09-02 19:20:57 +02:00
usb-skeleton.c USB: usb-skeleton: drop redundant in-urb check 2019-10-10 12:41:19 +02:00