mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Merge remote-tracking branch 'sm8350/lineage-20' into lineage-22.2
* sm8350/lineage-20: ANDROID: fix wakeup reason findings Revert "genirq: Provide new interfaces for affinity hints" Revert "i40e: Use irq_update_affinity_hint()" Revert "i40e: fix IRQ freeing in i40e_vsi_request_irq_msix error path" Linux 5.4.300 mm/hugetlb: fix folio is still mapped when deleted i40e: add mask to apply valid bits for itr_idx i40e: fix validation of VF state in get resources i40e: fix idx validation in config queues msg i40e: add validation for ring_len param i40e: increase max descriptors for XL710 mm/migrate_device: don't add folio to be freed to LRU in migrate_device_finalize() fbcon: Fix OOB access in font allocation fbcon: fix integer overflow in fbcon_do_set_font i40e: add max boundary check for VF filters i40e: fix input validation logic for action_meta i40e: fix idx validation in i40e_validate_queue_map drm/gma500: Fix null dereference in hdmi teardown can: peak_usb: fix shift-out-of-bounds issue can: mcba_usb: populate ndo_change_mtu() to prevent buffer overflow ... Change-Id: I35c2bd8174f8de67fbe46fb7fba584ee769722fa
This commit is contained in:
commit
cd41689b70
622 changed files with 45008 additions and 3929 deletions
|
|
@ -984,94 +984,6 @@ cleanup:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void cxacru_upload_firmware(struct cxacru_data *instance,
|
||||
const struct firmware *fw,
|
||||
const struct firmware *bp)
|
||||
{
|
||||
int ret;
|
||||
struct usbatm_data *usbatm = instance->usbatm;
|
||||
struct usb_device *usb_dev = usbatm->usb_dev;
|
||||
__le16 signature[] = { usb_dev->descriptor.idVendor,
|
||||
usb_dev->descriptor.idProduct };
|
||||
__le32 val;
|
||||
|
||||
usb_dbg(usbatm, "%s\n", __func__);
|
||||
|
||||
/* FirmwarePllFClkValue */
|
||||
val = cpu_to_le32(instance->modem_type->pll_f_clk);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, PLLFCLK_ADDR, (u8 *) &val, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "FirmwarePllFClkValue failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* FirmwarePllBClkValue */
|
||||
val = cpu_to_le32(instance->modem_type->pll_b_clk);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, PLLBCLK_ADDR, (u8 *) &val, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "FirmwarePllBClkValue failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Enable SDRAM */
|
||||
val = cpu_to_le32(SDRAM_ENA);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, SDRAMEN_ADDR, (u8 *) &val, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Enable SDRAM failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Firmware */
|
||||
usb_info(usbatm, "loading firmware\n");
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, FW_ADDR, fw->data, fw->size);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Firmware upload failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Boot ROM patch */
|
||||
if (instance->modem_type->boot_rom_patch) {
|
||||
usb_info(usbatm, "loading boot ROM patch\n");
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, BR_ADDR, bp->data, bp->size);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Boot ROM patching failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Signature */
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, SIG_ADDR, (u8 *) signature, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Signature storing failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
usb_info(usbatm, "starting device\n");
|
||||
if (instance->modem_type->boot_rom_patch) {
|
||||
val = cpu_to_le32(BR_ADDR);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, BR_STACK_ADDR, (u8 *) &val, 4);
|
||||
} else {
|
||||
ret = cxacru_fw(usb_dev, FW_GOTO_MEM, 0x0, 0x0, FW_ADDR, NULL, 0);
|
||||
}
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Passing control to firmware failed: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Delay to allow firmware to start up. */
|
||||
msleep_interruptible(1000);
|
||||
|
||||
usb_clear_halt(usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_CMD));
|
||||
usb_clear_halt(usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_CMD));
|
||||
usb_clear_halt(usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_DATA));
|
||||
usb_clear_halt(usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_DATA));
|
||||
|
||||
ret = cxacru_cm(instance, CM_REQUEST_CARD_GET_STATUS, NULL, 0, NULL, 0);
|
||||
if (ret < 0) {
|
||||
usb_err(usbatm, "modem failed to initialize: %d\n", ret);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int cxacru_find_firmware(struct cxacru_data *instance,
|
||||
char *phase, const struct firmware **fw_p)
|
||||
|
|
@ -1098,8 +1010,14 @@ static int cxacru_heavy_init(struct usbatm_data *usbatm_instance,
|
|||
{
|
||||
const struct firmware *fw, *bp;
|
||||
struct cxacru_data *instance = usbatm_instance->driver_data;
|
||||
int ret = cxacru_find_firmware(instance, "fw", &fw);
|
||||
struct usbatm_data *usbatm = instance->usbatm;
|
||||
struct usb_device *usb_dev = usbatm->usb_dev;
|
||||
__le16 signature[] = { usb_dev->descriptor.idVendor,
|
||||
usb_dev->descriptor.idProduct };
|
||||
__le32 val;
|
||||
int ret;
|
||||
|
||||
ret = cxacru_find_firmware(instance, "fw", &fw);
|
||||
if (ret) {
|
||||
usb_warn(usbatm_instance, "firmware (cxacru-fw.bin) unavailable (system misconfigured?)\n");
|
||||
return ret;
|
||||
|
|
@ -1114,8 +1032,82 @@ static int cxacru_heavy_init(struct usbatm_data *usbatm_instance,
|
|||
}
|
||||
}
|
||||
|
||||
cxacru_upload_firmware(instance, fw, bp);
|
||||
/* FirmwarePllFClkValue */
|
||||
val = cpu_to_le32(instance->modem_type->pll_f_clk);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, PLLFCLK_ADDR, (u8 *) &val, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "FirmwarePllFClkValue failed: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* FirmwarePllBClkValue */
|
||||
val = cpu_to_le32(instance->modem_type->pll_b_clk);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, PLLBCLK_ADDR, (u8 *) &val, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "FirmwarePllBClkValue failed: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Enable SDRAM */
|
||||
val = cpu_to_le32(SDRAM_ENA);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, SDRAMEN_ADDR, (u8 *) &val, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Enable SDRAM failed: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Firmware */
|
||||
usb_info(usbatm, "loading firmware\n");
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, FW_ADDR, fw->data, fw->size);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Firmware upload failed: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Boot ROM patch */
|
||||
if (instance->modem_type->boot_rom_patch) {
|
||||
usb_info(usbatm, "loading boot ROM patch\n");
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, BR_ADDR, bp->data, bp->size);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Boot ROM patching failed: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* Signature */
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, SIG_ADDR, (u8 *) signature, 4);
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Signature storing failed: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
usb_info(usbatm, "starting device\n");
|
||||
if (instance->modem_type->boot_rom_patch) {
|
||||
val = cpu_to_le32(BR_ADDR);
|
||||
ret = cxacru_fw(usb_dev, FW_WRITE_MEM, 0x2, 0x0, BR_STACK_ADDR, (u8 *) &val, 4);
|
||||
} else {
|
||||
ret = cxacru_fw(usb_dev, FW_GOTO_MEM, 0x0, 0x0, FW_ADDR, NULL, 0);
|
||||
}
|
||||
if (ret) {
|
||||
usb_err(usbatm, "Passing control to firmware failed: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Delay to allow firmware to start up. */
|
||||
msleep_interruptible(1000);
|
||||
|
||||
usb_clear_halt(usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_CMD));
|
||||
usb_clear_halt(usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_CMD));
|
||||
usb_clear_halt(usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_DATA));
|
||||
usb_clear_halt(usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_DATA));
|
||||
|
||||
ret = cxacru_cm(instance, CM_REQUEST_CARD_GET_STATUS, NULL, 0, NULL, 0);
|
||||
if (ret < 0) {
|
||||
usb_err(usbatm, "modem failed to initialize: %d\n", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
done:
|
||||
if (instance->modem_type->boot_rom_patch)
|
||||
release_firmware(bp);
|
||||
release_firmware(fw);
|
||||
|
|
|
|||
|
|
@ -277,8 +277,19 @@ static inline int ci_role_start(struct ci_hdrc *ci, enum ci_role role)
|
|||
return -ENXIO;
|
||||
|
||||
ret = ci->roles[role]->start(ci);
|
||||
if (!ret)
|
||||
ci->role = role;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ci->role = role;
|
||||
|
||||
if (ci->usb_phy) {
|
||||
if (role == CI_ROLE_HOST)
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_ID);
|
||||
else
|
||||
/* in device mode but vbus is invalid*/
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_NONE);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -292,6 +303,9 @@ static inline void ci_role_stop(struct ci_hdrc *ci)
|
|||
ci->role = CI_ROLE_END;
|
||||
|
||||
ci->roles[role]->stop(ci);
|
||||
|
||||
if (ci->usb_phy)
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_NONE);
|
||||
}
|
||||
|
||||
static inline enum usb_role ci_role_to_usb_role(struct ci_hdrc *ci)
|
||||
|
|
|
|||
|
|
@ -1533,44 +1533,68 @@ static const struct usb_ep_ops usb_ep_ops = {
|
|||
/******************************************************************************
|
||||
* GADGET block
|
||||
*****************************************************************************/
|
||||
/**
|
||||
* ci_hdrc_gadget_connect: caller makes sure gadget driver is binded
|
||||
*/
|
||||
static void ci_hdrc_gadget_connect(struct usb_gadget *_gadget, int is_active)
|
||||
{
|
||||
struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
|
||||
|
||||
if (is_active) {
|
||||
pm_runtime_get_sync(&_gadget->dev);
|
||||
hw_device_reset(ci);
|
||||
spin_lock_irq(&ci->lock);
|
||||
if (ci->driver) {
|
||||
hw_device_state(ci, ci->ep0out->qh.dma);
|
||||
usb_gadget_set_state(_gadget, USB_STATE_POWERED);
|
||||
spin_unlock_irq(&ci->lock);
|
||||
usb_udc_vbus_handler(_gadget, true);
|
||||
} else {
|
||||
spin_unlock_irq(&ci->lock);
|
||||
}
|
||||
} else {
|
||||
usb_udc_vbus_handler(_gadget, false);
|
||||
if (ci->driver)
|
||||
ci->driver->disconnect(&ci->gadget);
|
||||
hw_device_state(ci, 0);
|
||||
if (ci->platdata->notify_event)
|
||||
ci->platdata->notify_event(ci,
|
||||
CI_HDRC_CONTROLLER_STOPPED_EVENT);
|
||||
_gadget_stop_activity(&ci->gadget);
|
||||
pm_runtime_put_sync(&_gadget->dev);
|
||||
usb_gadget_set_state(_gadget, USB_STATE_NOTATTACHED);
|
||||
}
|
||||
}
|
||||
|
||||
static int ci_udc_vbus_session(struct usb_gadget *_gadget, int is_active)
|
||||
{
|
||||
struct ci_hdrc *ci = container_of(_gadget, struct ci_hdrc, gadget);
|
||||
unsigned long flags;
|
||||
int gadget_ready = 0;
|
||||
int ret = 0;
|
||||
|
||||
spin_lock_irqsave(&ci->lock, flags);
|
||||
ci->vbus_active = is_active;
|
||||
if (ci->driver)
|
||||
gadget_ready = 1;
|
||||
spin_unlock_irqrestore(&ci->lock, flags);
|
||||
|
||||
if (ci->usb_phy)
|
||||
usb_phy_set_charger_state(ci->usb_phy, is_active ?
|
||||
USB_CHARGER_PRESENT : USB_CHARGER_ABSENT);
|
||||
|
||||
if (gadget_ready) {
|
||||
if (is_active) {
|
||||
pm_runtime_get_sync(&_gadget->dev);
|
||||
hw_device_reset(ci);
|
||||
hw_device_state(ci, ci->ep0out->qh.dma);
|
||||
usb_gadget_set_state(_gadget, USB_STATE_POWERED);
|
||||
usb_udc_vbus_handler(_gadget, true);
|
||||
} else {
|
||||
usb_udc_vbus_handler(_gadget, false);
|
||||
if (ci->driver)
|
||||
ci->driver->disconnect(&ci->gadget);
|
||||
hw_device_state(ci, 0);
|
||||
if (ci->platdata->notify_event)
|
||||
ci->platdata->notify_event(ci,
|
||||
CI_HDRC_CONTROLLER_STOPPED_EVENT);
|
||||
_gadget_stop_activity(&ci->gadget);
|
||||
pm_runtime_put_sync(&_gadget->dev);
|
||||
usb_gadget_set_state(_gadget, USB_STATE_NOTATTACHED);
|
||||
}
|
||||
if (ci->platdata->notify_event)
|
||||
ret = ci->platdata->notify_event(ci,
|
||||
CI_HDRC_CONTROLLER_VBUS_EVENT);
|
||||
|
||||
if (ci->usb_phy) {
|
||||
if (is_active)
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_VBUS);
|
||||
else
|
||||
usb_phy_set_event(ci->usb_phy, USB_EVENT_NONE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (ci->driver)
|
||||
ci_hdrc_gadget_connect(_gadget, is_active);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ci_udc_wakeup(struct usb_gadget *_gadget)
|
||||
|
|
@ -1794,18 +1818,10 @@ static int ci_udc_start(struct usb_gadget *gadget,
|
|||
return retval;
|
||||
}
|
||||
|
||||
pm_runtime_get_sync(&ci->gadget.dev);
|
||||
if (ci->vbus_active) {
|
||||
hw_device_reset(ci);
|
||||
} else {
|
||||
if (ci->vbus_active)
|
||||
ci_hdrc_gadget_connect(gadget, 1);
|
||||
else
|
||||
usb_udc_vbus_handler(&ci->gadget, false);
|
||||
pm_runtime_put_sync(&ci->gadget.dev);
|
||||
return retval;
|
||||
}
|
||||
|
||||
retval = hw_device_state(ci, ci->ep0out->qh.dma);
|
||||
if (retval)
|
||||
pm_runtime_put_sync(&ci->gadget.dev);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -1835,6 +1851,7 @@ static int ci_udc_stop(struct usb_gadget *gadget)
|
|||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&ci->lock, flags);
|
||||
ci->driver = NULL;
|
||||
|
||||
if (ci->vbus_active) {
|
||||
hw_device_state(ci, 0);
|
||||
|
|
@ -1847,7 +1864,6 @@ static int ci_udc_stop(struct usb_gadget *gadget)
|
|||
pm_runtime_put(&ci->gadget.dev);
|
||||
}
|
||||
|
||||
ci->driver = NULL;
|
||||
spin_unlock_irqrestore(&ci->lock, flags);
|
||||
|
||||
ci_udc_stop_for_otg_fsm(ci);
|
||||
|
|
@ -1890,6 +1906,9 @@ static irqreturn_t udc_irq(struct ci_hdrc *ci)
|
|||
if (USBi_PCI & intr) {
|
||||
ci->gadget.speed = hw_port_is_high_speed(ci) ?
|
||||
USB_SPEED_HIGH : USB_SPEED_FULL;
|
||||
if (ci->usb_phy)
|
||||
usb_phy_set_event(ci->usb_phy,
|
||||
USB_EVENT_ENUMERATED);
|
||||
if (ci->suspended) {
|
||||
if (ci->driver->resume) {
|
||||
spin_unlock(&ci->lock);
|
||||
|
|
|
|||
|
|
@ -1520,8 +1520,6 @@ skip_countries:
|
|||
acm->nb_index = 0;
|
||||
acm->nb_size = 0;
|
||||
|
||||
dev_info(&intf->dev, "ttyACM%d: USB ACM device\n", minor);
|
||||
|
||||
acm->line.dwDTERate = cpu_to_le32(9600);
|
||||
acm->line.bDataBits = 8;
|
||||
acm_set_line(acm, &acm->line);
|
||||
|
|
@ -1529,6 +1527,12 @@ skip_countries:
|
|||
usb_driver_claim_interface(&acm_driver, data_interface, acm);
|
||||
usb_set_intfdata(data_interface, acm);
|
||||
|
||||
if (quirks & CLEAR_HALT_CONDITIONS) {
|
||||
/* errors intentionally ignored */
|
||||
usb_clear_halt(usb_dev, acm->in);
|
||||
usb_clear_halt(usb_dev, acm->out);
|
||||
}
|
||||
|
||||
tty_dev = tty_port_register_device(&acm->port, acm_tty_driver, minor,
|
||||
&control_interface->dev);
|
||||
if (IS_ERR(tty_dev)) {
|
||||
|
|
@ -1536,10 +1540,7 @@ skip_countries:
|
|||
goto alloc_fail6;
|
||||
}
|
||||
|
||||
if (quirks & CLEAR_HALT_CONDITIONS) {
|
||||
usb_clear_halt(usb_dev, acm->in);
|
||||
usb_clear_halt(usb_dev, acm->out);
|
||||
}
|
||||
dev_info(&intf->dev, "ttyACM%d: USB ACM device\n", minor);
|
||||
|
||||
return 0;
|
||||
alloc_fail6:
|
||||
|
|
|
|||
|
|
@ -55,6 +55,12 @@
|
|||
#define USB_TP_TRANSMISSION_DELAY_MAX 65535 /* ns */
|
||||
#define USB_PING_RESPONSE_TIME 400 /* ns */
|
||||
|
||||
/*
|
||||
* Give SS hubs 200ms time after wake to train downstream links before
|
||||
* assuming no port activity and allowing hub to runtime suspend back.
|
||||
*/
|
||||
#define USB_SS_PORT_U0_WAKE_TIME 200 /* ms */
|
||||
|
||||
/* Protect struct usb_device->state and ->children members
|
||||
* Note: Both are also protected by ->dev.sem, except that ->state can
|
||||
* change to USB_STATE_NOTATTACHED even when the semaphore isn't held. */
|
||||
|
|
@ -1055,6 +1061,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
|
|||
goto init2;
|
||||
goto init3;
|
||||
}
|
||||
|
||||
kref_get(&hub->kref);
|
||||
|
||||
/* The superspeed hub except for root hub has to use Hub Depth
|
||||
|
|
@ -1303,6 +1310,17 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
|
|||
device_unlock(&hdev->dev);
|
||||
}
|
||||
|
||||
if (type == HUB_RESUME && hub_is_superspeed(hub->hdev)) {
|
||||
/* give usb3 downstream links training time after hub resume */
|
||||
usb_autopm_get_interface_no_resume(
|
||||
to_usb_interface(hub->intfdev));
|
||||
|
||||
queue_delayed_work(system_power_efficient_wq,
|
||||
&hub->post_resume_work,
|
||||
msecs_to_jiffies(USB_SS_PORT_U0_WAKE_TIME));
|
||||
return;
|
||||
}
|
||||
|
||||
kref_put(&hub->kref, hub_release);
|
||||
}
|
||||
|
||||
|
|
@ -1321,6 +1339,14 @@ static void hub_init_func3(struct work_struct *ws)
|
|||
hub_activate(hub, HUB_INIT3);
|
||||
}
|
||||
|
||||
static void hub_post_resume(struct work_struct *ws)
|
||||
{
|
||||
struct usb_hub *hub = container_of(ws, struct usb_hub, post_resume_work.work);
|
||||
|
||||
usb_autopm_put_interface_async(to_usb_interface(hub->intfdev));
|
||||
kref_put(&hub->kref, hub_release);
|
||||
}
|
||||
|
||||
enum hub_quiescing_type {
|
||||
HUB_DISCONNECT, HUB_PRE_RESET, HUB_SUSPEND
|
||||
};
|
||||
|
|
@ -1346,6 +1372,7 @@ static void hub_quiesce(struct usb_hub *hub, enum hub_quiescing_type type)
|
|||
|
||||
/* Stop hub_wq and related activity */
|
||||
del_timer_sync(&hub->irq_urb_retry);
|
||||
flush_delayed_work(&hub->post_resume_work);
|
||||
usb_kill_urb(hub->urb);
|
||||
if (hub->has_indicators)
|
||||
cancel_delayed_work_sync(&hub->leds);
|
||||
|
|
@ -1892,6 +1919,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
|||
hub->hdev = hdev;
|
||||
INIT_DELAYED_WORK(&hub->leds, led_work);
|
||||
INIT_DELAYED_WORK(&hub->init_work, NULL);
|
||||
INIT_DELAYED_WORK(&hub->post_resume_work, hub_post_resume);
|
||||
INIT_WORK(&hub->events, hub_event);
|
||||
spin_lock_init(&hub->irq_urb_lock);
|
||||
timer_setup(&hub->irq_urb_retry, hub_retry_irq_urb, 0);
|
||||
|
|
@ -2759,6 +2787,8 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
|
|||
#define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
|
||||
#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
|
||||
|
||||
#define DETECT_DISCONNECT_TRIES 5
|
||||
|
||||
#define HUB_ROOT_RESET_TIME 60 /* times are in msec */
|
||||
#define HUB_SHORT_RESET_TIME 10
|
||||
#define HUB_BH_RESET_TIME 50
|
||||
|
|
@ -5395,6 +5425,8 @@ static void port_event(struct usb_hub *hub, int port1)
|
|||
struct usb_device *udev = port_dev->child;
|
||||
struct usb_device *hdev = hub->hdev;
|
||||
u16 portstatus, portchange;
|
||||
int i = 0;
|
||||
int err;
|
||||
|
||||
connect_change = test_bit(port1, hub->change_bits);
|
||||
clear_bit(port1, hub->event_bits);
|
||||
|
|
@ -5471,17 +5503,30 @@ static void port_event(struct usb_hub *hub, int port1)
|
|||
connect_change = 1;
|
||||
|
||||
/*
|
||||
* Warm reset a USB3 protocol port if it's in
|
||||
* SS.Inactive state.
|
||||
* Avoid trying to recover a USB3 SS.Inactive port with a warm reset if
|
||||
* the device was disconnected. A 12ms disconnect detect timer in
|
||||
* SS.Inactive state transitions the port to RxDetect automatically.
|
||||
* SS.Inactive link error state is common during device disconnect.
|
||||
*/
|
||||
if (hub_port_warm_reset_required(hub, port1, portstatus)) {
|
||||
dev_dbg(&port_dev->dev, "do warm reset\n");
|
||||
if (!udev || !(portstatus & USB_PORT_STAT_CONNECTION)
|
||||
while (hub_port_warm_reset_required(hub, port1, portstatus)) {
|
||||
if ((i++ < DETECT_DISCONNECT_TRIES) && udev) {
|
||||
u16 unused;
|
||||
|
||||
msleep(20);
|
||||
hub_port_status(hub, port1, &portstatus, &unused);
|
||||
dev_dbg(&port_dev->dev, "Wait for inactive link disconnect detect\n");
|
||||
continue;
|
||||
} else if (!udev || !(portstatus & USB_PORT_STAT_CONNECTION)
|
||||
|| udev->state == USB_STATE_NOTATTACHED) {
|
||||
if (hub_port_reset(hub, port1, NULL,
|
||||
HUB_BH_RESET_TIME, true) < 0)
|
||||
dev_dbg(&port_dev->dev, "do warm reset, port only\n");
|
||||
err = hub_port_reset(hub, port1, NULL,
|
||||
HUB_BH_RESET_TIME, true);
|
||||
if (!udev && err == -ENOTCONN)
|
||||
connect_change = 0;
|
||||
else if (err < 0)
|
||||
hub_port_disable(hub, port1, 1);
|
||||
} else {
|
||||
dev_dbg(&port_dev->dev, "do warm reset, full device\n");
|
||||
usb_unlock_port(port_dev);
|
||||
usb_lock_device(udev);
|
||||
usb_reset_device(udev);
|
||||
|
|
@ -5489,6 +5534,7 @@ static void port_event(struct usb_hub *hub, int port1)
|
|||
usb_lock_port(port_dev);
|
||||
connect_change = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (connect_change)
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ struct usb_hub {
|
|||
u8 indicator[USB_MAXCHILDREN];
|
||||
struct delayed_work leds;
|
||||
struct delayed_work init_work;
|
||||
struct delayed_work post_resume_work;
|
||||
struct work_struct events;
|
||||
spinlock_t irq_urb_lock;
|
||||
struct timer_list irq_urb_retry;
|
||||
|
|
|
|||
|
|
@ -368,6 +368,7 @@ static const struct usb_device_id usb_quirk_list[] = {
|
|||
{ USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM },
|
||||
|
||||
/* SanDisk Corp. SanDisk 3.2Gen1 */
|
||||
{ USB_DEVICE(0x0781, 0x5596), .driver_info = USB_QUIRK_DELAY_INIT },
|
||||
{ USB_DEVICE(0x0781, 0x55a3), .driver_info = USB_QUIRK_DELAY_INIT },
|
||||
|
||||
/* SanDisk Extreme 55AE */
|
||||
|
|
@ -728,7 +729,7 @@ void usb_detect_quirks(struct usb_device *udev)
|
|||
udev->quirks ^= usb_detect_dynamic_quirks(udev);
|
||||
|
||||
if (udev->quirks)
|
||||
dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
|
||||
dev_dbg(&udev->dev, "USB quirks for this device: 0x%x\n",
|
||||
udev->quirks);
|
||||
|
||||
#ifdef CONFIG_USB_DEFAULT_PERSIST
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
|
|||
|
||||
/* Check that the pipe's type matches the endpoint's type */
|
||||
if (usb_pipe_type_check(urb->dev, urb->pipe))
|
||||
dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
|
||||
dev_warn_once(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
|
||||
usb_pipetype(urb->pipe), pipetypes[xfertype]);
|
||||
|
||||
/* Check against a simple/standard policy */
|
||||
|
|
|
|||
|
|
@ -529,6 +529,9 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev)
|
|||
|
||||
usb_role_switch_unregister(priv->role_switch);
|
||||
|
||||
put_device(priv->switch_desc.udc);
|
||||
put_device(priv->switch_desc.usb2_port);
|
||||
|
||||
of_platform_depopulate(dev);
|
||||
|
||||
for (i = 0 ; i < PHY_COUNT ; ++i) {
|
||||
|
|
|
|||
|
|
@ -641,13 +641,13 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
|
|||
ret = reset_control_deassert(qcom->resets);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to deassert resets, err=%d\n", ret);
|
||||
goto reset_assert;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = dwc3_qcom_clk_init(qcom, of_clk_get_parent_count(np));
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to get clocks\n");
|
||||
goto reset_assert;
|
||||
return ret;
|
||||
}
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
|
@ -729,8 +729,6 @@ clk_disable:
|
|||
if (qcom->gdsc)
|
||||
if (regulator_disable(qcom->gdsc))
|
||||
dev_err(qcom->dev, "unable to disable usb3 gdsc\n");
|
||||
reset_assert:
|
||||
reset_control_assert(qcom->resets);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -754,8 +752,6 @@ static int dwc3_qcom_remove(struct platform_device *pdev)
|
|||
}
|
||||
qcom->num_clocks = 0;
|
||||
|
||||
reset_control_assert(qcom->resets);
|
||||
|
||||
pm_runtime_allow(dev);
|
||||
pm_runtime_disable(dev);
|
||||
|
||||
|
|
|
|||
|
|
@ -3531,6 +3531,15 @@ out:
|
|||
static void dwc3_gadget_endpoint_transfer_not_ready(struct dwc3_ep *dep,
|
||||
const struct dwc3_event_depevt *event)
|
||||
{
|
||||
/*
|
||||
* During a device-initiated disconnect, a late xferNotReady event can
|
||||
* be generated after the End Transfer command resets the event filter,
|
||||
* but before the controller is halted. Ignore it to prevent a new
|
||||
* transfer from starting.
|
||||
*/
|
||||
if (!dep->dwc->connected)
|
||||
return;
|
||||
|
||||
dwc3_gadget_endpoint_frame_from_event(dep, event);
|
||||
(void) __dwc3_gadget_start_isoc(dep);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -678,6 +678,10 @@ int __init early_xdbc_setup_hardware(void)
|
|||
|
||||
xdbc.table_base = NULL;
|
||||
xdbc.out_buf = NULL;
|
||||
|
||||
early_iounmap(xdbc.xhci_base, xdbc.xhci_length);
|
||||
xdbc.xhci_base = NULL;
|
||||
xdbc.xhci_length = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -2322,6 +2322,11 @@ int composite_os_desc_req_prepare(struct usb_composite_dev *cdev,
|
|||
if (!cdev->os_desc_req->buf) {
|
||||
ret = -ENOMEM;
|
||||
usb_ep_free_request(ep0, cdev->os_desc_req);
|
||||
/*
|
||||
* Set os_desc_req to NULL so that composite_dev_cleanup()
|
||||
* will not try to free it again.
|
||||
*/
|
||||
cdev->os_desc_req = NULL;
|
||||
goto end;
|
||||
}
|
||||
cdev->os_desc_req->context = cdev;
|
||||
|
|
|
|||
|
|
@ -951,6 +951,8 @@ static ssize_t os_desc_qw_sign_store(struct config_item *item, const char *page,
|
|||
struct gadget_info *gi = os_desc_item_to_gadget_info(item);
|
||||
int res, l;
|
||||
|
||||
if (!len)
|
||||
return len;
|
||||
l = min((int)len, OS_STRING_QW_SIGN_LEN >> 1);
|
||||
if (page[l - 1] == '\n')
|
||||
--l;
|
||||
|
|
|
|||
|
|
@ -748,7 +748,7 @@ static int dummy_dequeue(struct usb_ep *_ep, struct usb_request *_req)
|
|||
struct dummy *dum;
|
||||
int retval = -EINVAL;
|
||||
unsigned long flags;
|
||||
struct dummy_request *req = NULL;
|
||||
struct dummy_request *req = NULL, *iter;
|
||||
|
||||
if (!_ep || !_req)
|
||||
return retval;
|
||||
|
|
@ -758,25 +758,26 @@ static int dummy_dequeue(struct usb_ep *_ep, struct usb_request *_req)
|
|||
if (!dum->driver)
|
||||
return -ESHUTDOWN;
|
||||
|
||||
local_irq_save(flags);
|
||||
spin_lock(&dum->lock);
|
||||
list_for_each_entry(req, &ep->queue, queue) {
|
||||
if (&req->req == _req) {
|
||||
list_del_init(&req->queue);
|
||||
_req->status = -ECONNRESET;
|
||||
retval = 0;
|
||||
break;
|
||||
}
|
||||
spin_lock_irqsave(&dum->lock, flags);
|
||||
list_for_each_entry(iter, &ep->queue, queue) {
|
||||
if (&iter->req != _req)
|
||||
continue;
|
||||
list_del_init(&iter->queue);
|
||||
_req->status = -ECONNRESET;
|
||||
req = iter;
|
||||
retval = 0;
|
||||
break;
|
||||
}
|
||||
spin_unlock(&dum->lock);
|
||||
|
||||
if (retval == 0) {
|
||||
dev_dbg(udc_dev(dum),
|
||||
"dequeued req %p from %s, len %d buf %p\n",
|
||||
req, _ep->name, _req->length, _req->buf);
|
||||
spin_unlock(&dum->lock);
|
||||
usb_gadget_giveback_request(_ep, _req);
|
||||
spin_lock(&dum->lock);
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
spin_unlock_irqrestore(&dum->lock, flags);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2551,6 +2551,7 @@ static int renesas_usb3_remove(struct platform_device *pdev)
|
|||
struct renesas_usb3 *usb3 = platform_get_drvdata(pdev);
|
||||
|
||||
debugfs_remove_recursive(usb3->dentry);
|
||||
put_device(usb3->host_dev);
|
||||
device_remove_file(&pdev->dev, &dev_attr_role);
|
||||
|
||||
cancel_work_sync(&usb3->role_work);
|
||||
|
|
|
|||
|
|
@ -629,8 +629,7 @@ static int xhci_enter_test_mode(struct xhci_hcd *xhci,
|
|||
if (!xhci->devs[i])
|
||||
continue;
|
||||
|
||||
retval = xhci_disable_slot(xhci, i);
|
||||
xhci_free_virt_device(xhci, i);
|
||||
retval = xhci_disable_and_free_slot(xhci, i);
|
||||
if (retval)
|
||||
xhci_err(xhci, "Failed to disable slot %d, %d. Enter test mode anyway\n",
|
||||
i, retval);
|
||||
|
|
|
|||
|
|
@ -879,21 +879,20 @@ free_tts:
|
|||
* will be manipulated by the configure endpoint, allocate device, or update
|
||||
* hub functions while this function is removing the TT entries from the list.
|
||||
*/
|
||||
void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
|
||||
void xhci_free_virt_device(struct xhci_hcd *xhci, struct xhci_virt_device *dev,
|
||||
int slot_id)
|
||||
{
|
||||
struct xhci_virt_device *dev;
|
||||
int i;
|
||||
int old_active_eps = 0;
|
||||
|
||||
/* Slot ID 0 is reserved */
|
||||
if (slot_id == 0 || !xhci->devs[slot_id])
|
||||
if (slot_id == 0 || !dev)
|
||||
return;
|
||||
|
||||
dev = xhci->devs[slot_id];
|
||||
|
||||
xhci->dcbaa->dev_context_ptrs[slot_id] = 0;
|
||||
if (!dev)
|
||||
return;
|
||||
/* If device ctx array still points to _this_ device, clear it */
|
||||
if (dev->out_ctx &&
|
||||
xhci->dcbaa->dev_context_ptrs[slot_id] == cpu_to_le64(dev->out_ctx->dma))
|
||||
xhci->dcbaa->dev_context_ptrs[slot_id] = 0;
|
||||
|
||||
trace_xhci_free_virt_device(dev);
|
||||
|
||||
|
|
@ -932,8 +931,9 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id)
|
|||
|
||||
if (dev->udev && dev->udev->slot_id)
|
||||
dev->udev->slot_id = 0;
|
||||
kfree(xhci->devs[slot_id]);
|
||||
xhci->devs[slot_id] = NULL;
|
||||
if (xhci->devs[slot_id] == dev)
|
||||
xhci->devs[slot_id] = NULL;
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -975,7 +975,7 @@ static void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_i
|
|||
out:
|
||||
/* we are now at a leaf device */
|
||||
xhci_debugfs_remove_slot(xhci, slot_id);
|
||||
xhci_free_virt_device(xhci, slot_id);
|
||||
xhci_free_virt_device(xhci, vdev, slot_id);
|
||||
}
|
||||
|
||||
int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id,
|
||||
|
|
@ -1214,6 +1214,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
|
|||
ep0_ctx->deq = cpu_to_le64(dev->eps[0].ring->first_seg->dma |
|
||||
dev->eps[0].ring->cycle_state);
|
||||
|
||||
ep0_ctx->tx_info = cpu_to_le32(EP_AVG_TRB_LENGTH(8));
|
||||
|
||||
trace_xhci_setup_addressable_virt_device(dev);
|
||||
|
||||
/* Steps 7 and 8 were done in xhci_alloc_virt_device() */
|
||||
|
|
|
|||
|
|
@ -358,7 +358,8 @@ static int xhci_plat_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
usb3_hcd = xhci_get_usb3_hcd(xhci);
|
||||
if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4)
|
||||
if (usb3_hcd && HCC_MAX_PSA(xhci->hcc_params) >= 4 &&
|
||||
!(xhci->quirks & XHCI_BROKEN_STREAMS))
|
||||
usb3_hcd->can_do_streams = 1;
|
||||
|
||||
if (xhci->shared_hcd) {
|
||||
|
|
|
|||
|
|
@ -977,12 +977,15 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci,
|
|||
*/
|
||||
void xhci_hc_died(struct xhci_hcd *xhci)
|
||||
{
|
||||
bool notify;
|
||||
int i, j;
|
||||
|
||||
if (xhci->xhc_state & XHCI_STATE_DYING)
|
||||
return;
|
||||
|
||||
xhci_err(xhci, "xHCI host controller not responding, assume dead\n");
|
||||
notify = !(xhci->xhc_state & XHCI_STATE_REMOVING);
|
||||
if (notify)
|
||||
xhci_err(xhci, "xHCI host controller not responding, assume dead\n");
|
||||
xhci->xhc_state |= XHCI_STATE_DYING;
|
||||
|
||||
xhci_cleanup_command_queue(xhci);
|
||||
|
|
@ -996,7 +999,7 @@ void xhci_hc_died(struct xhci_hcd *xhci)
|
|||
}
|
||||
|
||||
/* inform usb core hc died if PCI remove isn't already handling it */
|
||||
if (!(xhci->xhc_state & XHCI_STATE_REMOVING))
|
||||
if (notify)
|
||||
usb_hc_died(xhci_to_hcd(xhci));
|
||||
}
|
||||
|
||||
|
|
@ -1259,7 +1262,8 @@ static void xhci_handle_cmd_enable_slot(struct xhci_hcd *xhci, int slot_id,
|
|||
command->slot_id = 0;
|
||||
}
|
||||
|
||||
static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id)
|
||||
static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id,
|
||||
u32 cmd_comp_code)
|
||||
{
|
||||
struct xhci_virt_device *virt_dev;
|
||||
struct xhci_slot_ctx *slot_ctx;
|
||||
|
|
@ -1274,6 +1278,10 @@ static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id)
|
|||
if (xhci->quirks & XHCI_EP_LIMIT_QUIRK)
|
||||
/* Delete default control endpoint resources */
|
||||
xhci_free_device_endpoint_resources(xhci, virt_dev, true);
|
||||
if (cmd_comp_code == COMP_SUCCESS) {
|
||||
xhci->dcbaa->dev_context_ptrs[slot_id] = 0;
|
||||
xhci->devs[slot_id] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void xhci_handle_cmd_config_ep(struct xhci_hcd *xhci, int slot_id,
|
||||
|
|
@ -1513,7 +1521,7 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
|
|||
xhci_handle_cmd_enable_slot(xhci, slot_id, cmd, cmd_comp_code);
|
||||
break;
|
||||
case TRB_DISABLE_SLOT:
|
||||
xhci_handle_cmd_disable_slot(xhci, slot_id);
|
||||
xhci_handle_cmd_disable_slot(xhci, slot_id, cmd_comp_code);
|
||||
break;
|
||||
case TRB_CONFIG_EP:
|
||||
if (!cmd->completion)
|
||||
|
|
@ -4225,7 +4233,8 @@ static int queue_command(struct xhci_hcd *xhci, struct xhci_command *cmd,
|
|||
|
||||
if ((xhci->xhc_state & XHCI_STATE_DYING) ||
|
||||
(xhci->xhc_state & XHCI_STATE_HALTED)) {
|
||||
xhci_dbg(xhci, "xHCI dying or halted, can't queue_command\n");
|
||||
xhci_dbg(xhci, "xHCI dying or halted, can't queue_command. state: 0x%x\n",
|
||||
xhci->xhc_state);
|
||||
return -ESHUTDOWN;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,8 @@ int xhci_halt(struct xhci_hcd *xhci)
|
|||
ret = xhci_handshake(&xhci->op_regs->status,
|
||||
STS_HALT, STS_HALT, 3 * XHCI_MAX_HALT_USEC);
|
||||
if (ret) {
|
||||
xhci_warn(xhci, "Host halt failed, %d\n", ret);
|
||||
if (!(xhci->xhc_state & XHCI_STATE_DYING))
|
||||
xhci_warn(xhci, "Host halt failed, %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
xhci->xhc_state |= XHCI_STATE_HALTED;
|
||||
|
|
@ -204,7 +205,8 @@ int xhci_reset(struct xhci_hcd *xhci, u64 timeout_us)
|
|||
state = readl(&xhci->op_regs->status);
|
||||
|
||||
if (state == ~(u32)0) {
|
||||
xhci_warn(xhci, "Host not accessible, reset failed.\n");
|
||||
if (!(xhci->xhc_state & XHCI_STATE_DYING))
|
||||
xhci_warn(xhci, "Host not accessible, reset failed.\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -4130,7 +4132,7 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
|||
xhci_disable_slot(xhci, udev->slot_id);
|
||||
|
||||
spin_lock_irqsave(&xhci->lock, flags);
|
||||
xhci_free_virt_device(xhci, udev->slot_id);
|
||||
xhci_free_virt_device(xhci, virt_dev, udev->slot_id);
|
||||
spin_unlock_irqrestore(&xhci->lock, flags);
|
||||
|
||||
}
|
||||
|
|
@ -4179,6 +4181,16 @@ int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int xhci_disable_and_free_slot(struct xhci_hcd *xhci, u32 slot_id)
|
||||
{
|
||||
struct xhci_virt_device *vdev = xhci->devs[slot_id];
|
||||
int ret;
|
||||
|
||||
ret = xhci_disable_slot(xhci, slot_id);
|
||||
xhci_free_virt_device(xhci, vdev, slot_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if we have enough host controller resources for the default control
|
||||
* endpoint.
|
||||
|
|
@ -4284,8 +4296,7 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
|
|||
return 1;
|
||||
|
||||
disable_slot:
|
||||
xhci_disable_slot(xhci, udev->slot_id);
|
||||
xhci_free_virt_device(xhci, udev->slot_id);
|
||||
xhci_disable_and_free_slot(xhci, udev->slot_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -4414,8 +4425,7 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,
|
|||
dev_warn(&udev->dev, "Device not responding to setup %s.\n", act);
|
||||
|
||||
mutex_unlock(&xhci->mutex);
|
||||
ret = xhci_disable_slot(xhci, udev->slot_id);
|
||||
xhci_free_virt_device(xhci, udev->slot_id);
|
||||
ret = xhci_disable_and_free_slot(xhci, udev->slot_id);
|
||||
if (!ret) {
|
||||
if (xhci_alloc_dev(hcd, udev) == 1)
|
||||
xhci_setup_addressable_virt_dev(xhci, udev);
|
||||
|
|
|
|||
|
|
@ -2031,7 +2031,7 @@ void xhci_dbg_trace(struct xhci_hcd *xhci, void (*trace)(struct va_format *),
|
|||
/* xHCI memory management */
|
||||
void xhci_mem_cleanup(struct xhci_hcd *xhci);
|
||||
int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags);
|
||||
void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id);
|
||||
void xhci_free_virt_device(struct xhci_hcd *xhci, struct xhci_virt_device *dev, int slot_id);
|
||||
int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, struct usb_device *udev, gfp_t flags);
|
||||
int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *udev);
|
||||
void xhci_copy_ep0_dequeue_into_input_ctx(struct xhci_hcd *xhci,
|
||||
|
|
@ -2123,6 +2123,7 @@ void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev);
|
|||
int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev,
|
||||
struct usb_tt *tt, gfp_t mem_flags);
|
||||
int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id);
|
||||
int xhci_disable_and_free_slot(struct xhci_hcd *xhci, u32 slot_id);
|
||||
int xhci_ext_cap_init(struct xhci_hcd *xhci);
|
||||
|
||||
int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup);
|
||||
|
|
|
|||
|
|
@ -1910,6 +1910,7 @@ static int musb_gadget_stop(struct usb_gadget *g)
|
|||
* gadget driver here and have everything work;
|
||||
* that currently misbehaves.
|
||||
*/
|
||||
usb_gadget_set_state(g, USB_STATE_NOTATTACHED);
|
||||
|
||||
/* Force check of devctl register for PM runtime */
|
||||
schedule_delayed_work(&musb->irq_work, 0);
|
||||
|
|
@ -2018,6 +2019,7 @@ void musb_g_disconnect(struct musb *musb)
|
|||
case OTG_STATE_B_PERIPHERAL:
|
||||
case OTG_STATE_B_IDLE:
|
||||
musb->xceiv->otg->state = OTG_STATE_B_IDLE;
|
||||
usb_gadget_set_state(&musb->g, USB_STATE_NOTATTACHED);
|
||||
break;
|
||||
case OTG_STATE_B_SRP_INIT:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -476,13 +476,13 @@ static int omap2430_probe(struct platform_device *pdev)
|
|||
ARRAY_SIZE(musb_resources));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to add resources\n");
|
||||
goto err2;
|
||||
goto err_put_control_otghs;
|
||||
}
|
||||
|
||||
ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to add platform_data\n");
|
||||
goto err2;
|
||||
goto err_put_control_otghs;
|
||||
}
|
||||
|
||||
pm_runtime_enable(glue->dev);
|
||||
|
|
@ -497,7 +497,9 @@ static int omap2430_probe(struct platform_device *pdev)
|
|||
|
||||
err3:
|
||||
pm_runtime_disable(glue->dev);
|
||||
|
||||
err_put_control_otghs:
|
||||
if (!IS_ERR(glue->control_otghs))
|
||||
put_device(glue->control_otghs);
|
||||
err2:
|
||||
platform_device_put(musb);
|
||||
|
||||
|
|
@ -511,6 +513,8 @@ static int omap2430_remove(struct platform_device *pdev)
|
|||
|
||||
platform_device_unregister(glue->musb);
|
||||
pm_runtime_disable(glue->dev);
|
||||
if (!IS_ERR(glue->control_otghs))
|
||||
put_device(glue->control_otghs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -394,6 +394,7 @@ static bool mxs_phy_is_otg_host(struct mxs_phy *mxs_phy)
|
|||
static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on)
|
||||
{
|
||||
bool vbus_is_on = false;
|
||||
enum usb_phy_events last_event = mxs_phy->phy.last_event;
|
||||
|
||||
/* If the SoCs don't need to disconnect line without vbus, quit */
|
||||
if (!(mxs_phy->data->flags & MXS_PHY_DISCONNECT_LINE_WITHOUT_VBUS))
|
||||
|
|
@ -405,7 +406,8 @@ static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on)
|
|||
|
||||
vbus_is_on = mxs_phy_get_vbus_status(mxs_phy);
|
||||
|
||||
if (on && !vbus_is_on && !mxs_phy_is_otg_host(mxs_phy))
|
||||
if (on && ((!vbus_is_on && !mxs_phy_is_otg_host(mxs_phy))
|
||||
|| (last_event == USB_EVENT_VBUS)))
|
||||
__mxs_phy_disconnect_line(mxs_phy, true);
|
||||
else
|
||||
__mxs_phy_disconnect_line(mxs_phy, false);
|
||||
|
|
|
|||
|
|
@ -781,6 +781,8 @@ static const struct usb_device_id id_table_combined[] = {
|
|||
.driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_NDI_AURORA_SCU_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
|
||||
{ USB_DEVICE(FTDI_NDI_VID, FTDI_NDI_EMGUIDE_GEMINI_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk },
|
||||
{ USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
|
||||
{ USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) },
|
||||
{ USB_DEVICE(FTDI_VID, RTSYSTEMS_USB_VX8_PID) },
|
||||
|
|
|
|||
|
|
@ -197,6 +197,9 @@
|
|||
#define FTDI_NDI_FUTURE_3_PID 0xDA73 /* NDI future device #3 */
|
||||
#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */
|
||||
|
||||
#define FTDI_NDI_VID 0x23F2
|
||||
#define FTDI_NDI_EMGUIDE_GEMINI_PID 0x0003 /* NDI Emguide Gemini */
|
||||
|
||||
/*
|
||||
* ChamSys Limited (www.chamsys.co.uk) USB wing/interface product IDs
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1322,7 +1322,18 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = NCTRL(0) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1033, 0xff), /* Telit LE910C1-EUX (ECM) */
|
||||
.driver_info = NCTRL(0) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1034, 0xff), /* Telit LE910C4-WWX (rmnet) */
|
||||
.driver_info = RSVD(2) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1035, 0xff) }, /* Telit LE910C4-WWX (ECM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1036, 0xff) }, /* Telit LE910C4-WWX */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1037, 0xff), /* Telit LE910C4-WWX (rmnet) */
|
||||
.driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1038, 0xff), /* Telit LE910C4-WWX (rmnet) */
|
||||
.driver_info = NCTRL(0) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x103b, 0xff), /* Telit LE910C4-WWX */
|
||||
.driver_info = NCTRL(0) | NCTRL(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x103c, 0xff), /* Telit LE910C4-WWX */
|
||||
.driver_info = NCTRL(0) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0),
|
||||
.driver_info = RSVD(0) | RSVD(1) | NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG1),
|
||||
|
|
@ -1369,6 +1380,12 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990A (PCIe) */
|
||||
.driver_info = RSVD(0) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1077, 0xff), /* Telit FN990A (rmnet + audio) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1078, 0xff), /* Telit FN990A (MBIM + audio) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1079, 0xff), /* Telit FN990A (RNDIS + audio) */
|
||||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1080, 0xff), /* Telit FE990A (rmnet) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1081, 0xff), /* Telit FE990A (MBIM) */
|
||||
|
|
@ -1415,6 +1432,9 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = NCTRL(5) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10c7, 0xff, 0xff, 0x30), /* Telit FE910C04 (ECM) */
|
||||
.driver_info = NCTRL(4) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10c7, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x30), /* Telit FN990B (MBIM) */
|
||||
.driver_info = NCTRL(6) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x40) },
|
||||
|
|
@ -2343,6 +2363,10 @@ static const struct usb_device_id option_ids[] = {
|
|||
.driver_info = RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe145, 0xff), /* Foxconn T99W651 RNDIS */
|
||||
.driver_info = RSVD(5) | RSVD(6) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe15f, 0xff), /* Foxconn T99W709 */
|
||||
.driver_info = RSVD(5) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe167, 0xff), /* Foxconn T99W640 MBIM */
|
||||
.driver_info = RSVD(3) },
|
||||
{ USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */
|
||||
.driver_info = RSVD(4) | RSVD(5) | RSVD(6) },
|
||||
{ USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ static int rts51x_bulk_transport(struct us_data *us, u8 lun,
|
|||
return USB_STOR_TRANSPORT_ERROR;
|
||||
}
|
||||
|
||||
residue = bcs->Residue;
|
||||
residue = le32_to_cpu(bcs->Residue);
|
||||
if (bcs->Tag != us->tag)
|
||||
return USB_STOR_TRANSPORT_ERROR;
|
||||
|
||||
|
|
|
|||
|
|
@ -934,6 +934,13 @@ UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451,
|
|||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_SANE_SENSE ),
|
||||
|
||||
/* Added by Maël GUERIN <[email protected]> */
|
||||
UNUSUAL_DEV( 0x0603, 0x8611, 0x0000, 0xffff,
|
||||
"Novatek",
|
||||
"NTK96550-based camera",
|
||||
USB_SC_SCSI, USB_PR_BULK, NULL,
|
||||
US_FL_BULK_IGNORE_TAG ),
|
||||
|
||||
/*
|
||||
* Reported by Hanno Boeck <hanno@gmx.de>
|
||||
* Taken from the Lycoris Kernel
|
||||
|
|
@ -1483,6 +1490,28 @@ UNUSUAL_DEV( 0x0bc2, 0x3332, 0x0000, 0x9999,
|
|||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_NO_WP_DETECT ),
|
||||
|
||||
/*
|
||||
* Reported by Zenm Chen <zenmchen@gmail.com>
|
||||
* Ignore driver CD mode, otherwise usb_modeswitch may fail to switch
|
||||
* the device into Wi-Fi mode.
|
||||
*/
|
||||
UNUSUAL_DEV( 0x0bda, 0x1a2b, 0x0000, 0xffff,
|
||||
"Realtek",
|
||||
"DISK",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_IGNORE_DEVICE ),
|
||||
|
||||
/*
|
||||
* Reported by Zenm Chen <zenmchen@gmail.com>
|
||||
* Ignore driver CD mode, otherwise usb_modeswitch may fail to switch
|
||||
* the device into Wi-Fi mode.
|
||||
*/
|
||||
UNUSUAL_DEV( 0x0bda, 0xa192, 0x0000, 0xffff,
|
||||
"Realtek",
|
||||
"DISK",
|
||||
USB_SC_DEVICE, USB_PR_DEVICE, NULL,
|
||||
US_FL_IGNORE_DEVICE ),
|
||||
|
||||
UNUSUAL_DEV( 0x0d49, 0x7310, 0x0000, 0x9999,
|
||||
"Maxtor",
|
||||
"USB to SATA",
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ struct fusb302_chip {
|
|||
bool vconn_on;
|
||||
bool vbus_on;
|
||||
bool charge_on;
|
||||
bool pd_rx_on;
|
||||
bool vbus_present;
|
||||
enum typec_cc_polarity cc_polarity;
|
||||
enum typec_cc_status cc1;
|
||||
|
|
@ -841,6 +842,11 @@ static int tcpm_set_pd_rx(struct tcpc_dev *dev, bool on)
|
|||
int ret = 0;
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
if (chip->pd_rx_on == on) {
|
||||
fusb302_log(chip, "pd is already %s", on ? "on" : "off");
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = fusb302_pd_rx_flush(chip);
|
||||
if (ret < 0) {
|
||||
fusb302_log(chip, "cannot flush pd rx buffer, ret=%d", ret);
|
||||
|
|
@ -863,6 +869,8 @@ static int tcpm_set_pd_rx(struct tcpc_dev *dev, bool on)
|
|||
on ? "on" : "off", ret);
|
||||
goto done;
|
||||
}
|
||||
|
||||
chip->pd_rx_on = on;
|
||||
fusb302_log(chip, "pd := %s", on ? "on" : "off");
|
||||
done:
|
||||
mutex_unlock(&chip->lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue