Skip to contentSkip to conversation

usb: xhci: Add interrupt transfer support and full speed device support

PATCH Superseded Bin Meng 1 participant 14 messages Jul 14, 2017

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

v2 cover usb: xhci: Add interrupt transfer support and full speed device support

This series is the final series of the xHCI driver update.

This adds the missing interrupt transfer support to xHCI driver, so that devices like USB keyboard that uses interrupt transfer when CONFIG_SYS_USB_EVENT_POLL is defined can work.

This also adds full speed device support. Unlike low/high/super speed devices, full speed device may report its endpoint 0 max packet size as 8/16/32/64. xHCI driver guesses 64 for the first attempt to get the initial 8 bytes device descriptor, and later adjusts the context for endpoint 0.

This series also made several updates to xHCI driver to conform with the spec.

Previous two series:
[1]: usb: xhci: Fix USB xHCI support on Intel platform
https://lists.denx.de/pipermail/u-boot/2017-June/296166.html
[2]: usb: hub: Support USB 3.0 hubs
https://lists.denx.de/pipermail/u-boot/2017-June/296284.html

This series is available at u-boot-x86/xhci-working3 for testing.

Bin Meng (13):
usb: xhci: Add interrupt transfer support
usb: configs: Clean up CONFIG_SYS_USB_EVENT_POLL_(xxx) in board
configs
usb: kbd: kconfig: Set a default polling mechanism for USB keyboard
usb: Only get 64 bytes device descriptor for full speed devices
usb: Read device descriptor after device is addressed for xHCI
usb: xhci: Fix max packet size for full speed device endpoint 0
usb: hub: Clear port reset before usb_hub_port_connect_change()
usb: hub: Clear BH reset status change for a 3.0 hub
usb: Handle audio extension endpoint descriptor in usb_parse_config()
usb: xhci: Honor endpoint's interval
usb: xhci: Program max burst size for endpoint
usb: xhci: Set 'Error Count' to 0 for isoch endpoints
usb: xhci: Set 'Average TRB Length' to 8 for control endpoints

 common/usb.c                                   |  45 +++--
 common/usb_hub.c                               |  16 +-
 configs/A10-OLinuXino-Lime_defconfig           |   1 +
 configs/A10s-OLinuXino-M_defconfig             |   1 +
 configs/A13-OLinuXinoM_defconfig               |   1 +
 configs/A13-OLinuXino_defconfig                |   1 +
 configs/A20-OLinuXino-Lime2_defconfig          |   1 +
 configs/A20-OLinuXino-Lime_defconfig           |   1 +
 configs/A20-OLinuXino_MICRO_defconfig          |   1 +
 configs/A20-Olimex-SOM-EVB_defconfig           |   1 +
 configs/A33-OLinuXino_defconfig                |   1 +
 configs/Ainol_AW1_defconfig                    |   1 +
 configs/Ampe_A76_defconfig                     |   1 +
 configs/Auxtek-T003_defconfig                  |   1 +
 configs/Auxtek-T004_defconfig                  |   1 +
 configs/Bananapi_M2_Ultra_defconfig            |   1 +
 configs/Bananapi_defconfig                     |   1 +
 configs/Bananapro_defconfig                    |   1 +
 configs/CHIP_defconfig                         |   1 +
 configs/CHIP_pro_defconfig                     |   1 +
 configs/CSQ_CS908_defconfig                    |   1 +
 configs/Chuwi_V7_CW0825_defconfig              |   1 +
 configs/Colombus_defconfig                     |   1 +
 configs/Cubieboard2_defconfig                  |   1 +
 configs/Cubieboard4_defconfig                  |   1 +
 configs/Cubieboard_defconfig                   |   1 +
 configs/Cubietruck_defconfig                   |   1 +
 configs/Cubietruck_plus_defconfig              |   1 +
 configs/Empire_electronix_d709_defconfig       |   1 +
 configs/Empire_electronix_m712_defconfig       |   1 +
 configs/Hummingbird_A31_defconfig              |   1 +
 configs/Hyundai_A7HD_defconfig                 |   1 +
 configs/Itead_Ibox_A20_defconfig               |   1 +
 configs/Lamobo_R1_defconfig                    |   1 +
 configs/LicheePi_Zero_defconfig                |   1 +
 configs/Linksprite_pcDuino3_Nano_defconfig     |   1 +
 configs/Linksprite_pcDuino3_defconfig          |   1 +
 configs/Linksprite_pcDuino_defconfig           |   1 +
 configs/MK808C_defconfig                       |   1 +
 configs/MSI_Primo73_defconfig                  |   1 +
 configs/MSI_Primo81_defconfig                  |   1 +
 configs/Marsboard_A10_defconfig                |   1 +
 configs/Mele_A1000G_quad_defconfig             |   1 +
 configs/Mele_A1000_defconfig                   |   1 +
 configs/Mele_I7_defconfig                      |   1 +
 configs/Mele_M3_defconfig                      |   1 +
 configs/Mele_M5_defconfig                      |   1 +
 configs/Mele_M9_defconfig                      |   1 +
 configs/Merrii_A80_Optimus_defconfig           |   1 +
 configs/Mini-X_defconfig                       |   1 +
 configs/Nintendo_NES_Classic_Edition_defconfig |   1 +
 configs/Orangepi_defconfig                     |   1 +
 configs/Orangepi_mini_defconfig                |   1 +
 configs/Sinlinx_SinA31s_defconfig              |   1 +
 configs/Sinlinx_SinA33_defconfig               |   1 +
 configs/Sinovoip_BPI_M2_Plus_defconfig         |   1 +
 configs/Sinovoip_BPI_M2_defconfig              |   1 +
 configs/Sinovoip_BPI_M3_defconfig              |   1 +
 configs/Sunchip_CX-A99_defconfig               |   1 +
 configs/UTOO_P66_defconfig                     |   1 +
 configs/Wexler_TAB7200_defconfig               |   1 +
 configs/Wits_Pro_A20_DKT_defconfig             |   1 +
 configs/Wobo_i5_defconfig                      |   1 +
 configs/Yones_Toptech_BD1078_defconfig         |   1 +
 configs/Yones_Toptech_BS1078_V2_defconfig      |   1 +
 configs/ba10_tv_box_defconfig                  |   1 +
 configs/bananapi_m64_defconfig                 |   1 +
 configs/cgtqmx6eval_defconfig                  |   1 +
 configs/colorfly_e708_q1_defconfig             |   1 +
 configs/difrnce_dit4350_defconfig              |   1 +
 configs/dms-ba16-1g_defconfig                  |   1 +
 configs/dms-ba16_defconfig                     |   1 +
 configs/dserve_dsrv9703c_defconfig             |   1 +
 configs/ga10h_v1_1_defconfig                   |   1 +
 configs/gt90h_v4_defconfig                     |   1 +
 configs/gwventana_emmc_defconfig               |   1 +
 configs/gwventana_gw5904_defconfig             |   1 +
 configs/gwventana_nand_defconfig               |   1 +
 configs/h8_homlet_v2_defconfig                 |   1 +
 configs/i12-tvbox_defconfig                    |   1 +
 configs/iNet_3F_defconfig                      |   1 +
 configs/iNet_3W_defconfig                      |   1 +
 configs/iNet_86VS_defconfig                    |   1 +
 configs/iNet_D978_rev2_defconfig               |   1 +
 configs/icnova-a20-swac_defconfig              |   1 +
 configs/inet1_defconfig                        |   1 +
 configs/inet86dz_defconfig                     |   1 +
 configs/inet97fv2_defconfig                    |   1 +
 configs/inet98v_rev2_defconfig                 |   1 +
 configs/inet9f_rev03_defconfig                 |   1 +
 configs/inet_q972_defconfig                    |   1 +
 configs/jesurun_q5_defconfig                   |   1 +
 configs/mixtile_loftq_defconfig                |   1 +
 configs/mk802_a10s_defconfig                   |   1 +
 configs/mk802_defconfig                        |   1 +
 configs/mk802ii_defconfig                      |   1 +
 configs/mx6qsabrelite_defconfig                |   1 +
 configs/nanopi_m1_defconfig                    |   1 +
 configs/nanopi_m1_plus_defconfig               |   1 +
 configs/nanopi_neo2_defconfig                  |   1 +
 configs/nanopi_neo_air_defconfig               |   1 +
 configs/nanopi_neo_defconfig                   |   1 +
 configs/nitrogen6dl2g_defconfig                |   1 +
 configs/nitrogen6dl_defconfig                  |   1 +
 configs/nitrogen6q2g_defconfig                 |   1 +
 configs/nitrogen6q_defconfig                   |   1 +
 configs/nitrogen6s1g_defconfig                 |   1 +
 configs/nitrogen6s_defconfig                   |   1 +
 configs/novena_defconfig                       |   1 +
 configs/orangepi_2_defconfig                   |   1 +
 configs/orangepi_lite_defconfig                |   1 +
 configs/orangepi_one_defconfig                 |   1 +
 configs/orangepi_pc2_defconfig                 |   1 +
 configs/orangepi_pc_defconfig                  |   1 +
 configs/orangepi_pc_plus_defconfig             |   1 +
 configs/orangepi_plus2e_defconfig              |   1 +
 configs/orangepi_plus_defconfig                |   1 +
 configs/orangepi_prime_defconfig               |   1 +
 configs/orangepi_win_defconfig                 |   1 +
 configs/orangepi_zero_defconfig                |   1 +
 configs/orangepi_zero_plus2_defconfig          |   1 +
 configs/parrot_r16_defconfig                   |   1 +
 configs/pine64_plus_defconfig                  |   1 +
 configs/polaroid_mid2407pxe03_defconfig        |   1 +
 configs/polaroid_mid2809pxe04_defconfig        |   1 +
 configs/pov_protab2_ips9_defconfig             |   1 +
 configs/q8_a13_tablet_defconfig                |   1 +
 configs/q8_a23_tablet_800x480_defconfig        |   1 +
 configs/q8_a33_tablet_1024x600_defconfig       |   1 +
 configs/q8_a33_tablet_800x480_defconfig        |   1 +
 configs/r7-tv-dongle_defconfig                 |   1 +
 configs/sandbox_defconfig                      |   1 -
 configs/sandbox_flattree_defconfig             |   1 -
 configs/sandbox_noblk_defconfig                |   1 -
 configs/sandbox_spl_defconfig                  |   1 -
 configs/sopine_baseboard_defconfig             |   1 +
 configs/sun8i_a23_evb_defconfig                |   1 +
 configs/sunxi_Gemei_G9_defconfig               |   1 +
 configs/tbs2910_defconfig                      |   1 +
 drivers/usb/Kconfig                            |   2 +-
 drivers/usb/host/xhci-mem.c                    |   6 +
 drivers/usb/host/xhci.c                        | 264 ++++++++++++++++++++++++-
 drivers/usb/host/xhci.h                        |   5 +-
 include/configs/MPC8610HPCD.h                  |   1 -
 include/configs/MPC8641HPCN.h                  |   1 -
 include/configs/advantech_dms-ba16.h           |   1 -
 include/configs/am3517_crane.h                 |   1 -
 include/configs/am3517_evm.h                   |   1 -
 include/configs/apalis_imx6.h                  |   3 -
 include/configs/cgtqmx6eval.h                  |   1 -
 include/configs/colibri_imx6.h                 |   3 -
 include/configs/cyrus.h                        |   1 -
 include/configs/ge_bx50v3.h                    |   1 -
 include/configs/gw_ventana.h                   |   1 -
 include/configs/mx6cuboxi.h                    |   1 -
 include/configs/nitrogen6x.h                   |   1 -
 include/configs/novena.h                       |   1 -
 include/configs/omap3_evm.h                    |   1 -
 include/configs/rpi.h                          |   1 -
 include/configs/sunxi-common.h                 |   1 -
 include/configs/tbs2910.h                      |   1 -
 include/configs/tegra-common-post.h            |   1 -
 include/configs/x86-common.h                   |   1 -
 include/linux/usb/ch9.h                        |  20 ++
 164 files changed, 457 insertions(+), 62 deletions(-)
Signature · 1 line
2.9.2
author
#1 lore raw

PATCH v2 1/13 usb: xhci: Add interrupt transfer support

xHCI uses normal TRBs for both bulk and interrupt. This adds the missing interrupt transfer support to xHCI so that devices like USB keyboard that uses interrupt transfer can work.

Note: when interrupt transfer complets, the xHC generates an event TRB with TRB type 'Transfer Event', which is exactly the same as a control or bulk transfer. In our xHCI driver, xhci_wait_for_event() checks the event TRB type and depending on the timing, it may wrongly return an event TRB to the caller which originates from another USB device (different slot ID is checked by the driver and if different a "BUG" will be thrown).

The following situation can cerntainly trigger such a "BUG":
- a USB keyboard is connected to xHC
- USB keyboard driver is successfully probed
- adding some debug output after a control or bulk transfer is initiated, but before xHC event is checked

There are possible ways to avoid such issue:
- Add multiple event queue support and let such device like USB keyboard generate transfer event TRB from a different queue.
- In xhci_wait_for_event(), check slot ID and if it is not the caller's, add the event to a completed event list for that device/slot.
- Each device registers a callback routine for each transfer. In xhci_wait_for_event() if we encounter another slot ID, call its callback to handle the event.

---

 drivers/usb/host/xhci.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)
drivers/usb/host/xhci.c +24 -3
index e64637b..8aff5b5 100644
@@ -890,11 +890,32 @@ unknown:
 static int _xhci_submit_int_msg(struct usb_device *udev, unsigned long pipe,
 				void *buffer, int length, int interval)
 {
+	if (usb_pipetype(pipe) != PIPE_INTERRUPT) {
+		printf("non-interrupt pipe (type=%lu)", usb_pipetype(pipe));
+		return -EINVAL;
+	}
+
 	/*
-	 * TODO: Not addressing any interrupt type transfer requests
-	 * Add support for it later.
+	 * xHCI uses normal TRBs for both bulk and interrupt. When the
+	 * interrupt endpoint is to be serviced, the xHC will consume
+	 * (at most) one TD. A TD (comprised of sg list entries) can
+	 * take several service intervals to transmit.
+	 *
+	 * Note: when interrupt transfer complets, the xHC generates an
+	 * event TRB with TRB type 'Transfer Event', which is exactly
+	 * the same as a control or bulk transfer. In our xHCI driver,
+	 * xhci_wait_for_event() checks the event TRB type and depending
+	 * on the timing, it may wrongly return an event TRB to the caller
+	 * which originates from another USB device (different slot ID is
+	 * checked by the driver and if different a "BUG" will be thrown).
+	 *
+	 * The following situation can cerntainly trigger such a "BUG":
+	 * - a USB keyboard is connected to xHC
+	 * - USB keyboard driver is successfully probed
+	 * - adding some debug output after a control or bulk transfer
+	 *   is initiated, but before xHC event is checked
 	 */
-	return -EINVAL;
+	return xhci_bulk_tx(udev, pipe, length, buffer);
 }
 
 /**
Signature · 1 line
2.9.2
author
#2 lore raw

PATCH v2 2/13 usb: configs: Clean up CONFIG_SYS_USB_EVENT_POLL_(xxx) in board configs

In reply to Bin Meng

The following 3 Kconfig options
- CONFIG_SYS_USB_EVENT_POLL
- CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
- CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE

are already converted to Kconfig. Let's clean up all board configs to switch over to use them.

---

 configs/A10-OLinuXino-Lime_defconfig           | 1 +
 configs/A10s-OLinuXino-M_defconfig             | 1 +
 configs/A13-OLinuXinoM_defconfig               | 1 +
 configs/A13-OLinuXino_defconfig                | 1 +
 configs/A20-OLinuXino-Lime2_defconfig          | 1 +
 configs/A20-OLinuXino-Lime_defconfig           | 1 +
 configs/A20-OLinuXino_MICRO_defconfig          | 1 +
 configs/A20-Olimex-SOM-EVB_defconfig           | 1 +
 configs/A33-OLinuXino_defconfig                | 1 +
 configs/Ainol_AW1_defconfig                    | 1 +
 configs/Ampe_A76_defconfig                     | 1 +
 configs/Auxtek-T003_defconfig                  | 1 +
 configs/Auxtek-T004_defconfig                  | 1 +
 configs/Bananapi_M2_Ultra_defconfig            | 1 +
 configs/Bananapi_defconfig                     | 1 +
 configs/Bananapro_defconfig                    | 1 +
 configs/CHIP_defconfig                         | 1 +
 configs/CHIP_pro_defconfig                     | 1 +
 configs/CSQ_CS908_defconfig                    | 1 +
 configs/Chuwi_V7_CW0825_defconfig              | 1 +
 configs/Colombus_defconfig                     | 1 +
 configs/Cubieboard2_defconfig                  | 1 +
 configs/Cubieboard4_defconfig                  | 1 +
 configs/Cubieboard_defconfig                   | 1 +
 configs/Cubietruck_defconfig                   | 1 +
 configs/Cubietruck_plus_defconfig              | 1 +
 configs/Empire_electronix_d709_defconfig       | 1 +
 configs/Empire_electronix_m712_defconfig       | 1 +
 configs/Hummingbird_A31_defconfig              | 1 +
 configs/Hyundai_A7HD_defconfig                 | 1 +
 configs/Itead_Ibox_A20_defconfig               | 1 +
 configs/Lamobo_R1_defconfig                    | 1 +
 configs/LicheePi_Zero_defconfig                | 1 +
 configs/Linksprite_pcDuino3_Nano_defconfig     | 1 +
 configs/Linksprite_pcDuino3_defconfig          | 1 +
 configs/Linksprite_pcDuino_defconfig           | 1 +
 configs/MK808C_defconfig                       | 1 +
 configs/MSI_Primo73_defconfig                  | 1 +
 configs/MSI_Primo81_defconfig                  | 1 +
 configs/Marsboard_A10_defconfig                | 1 +
 configs/Mele_A1000G_quad_defconfig             | 1 +
 configs/Mele_A1000_defconfig                   | 1 +
 configs/Mele_I7_defconfig                      | 1 +
 configs/Mele_M3_defconfig                      | 1 +
 configs/Mele_M5_defconfig                      | 1 +
 configs/Mele_M9_defconfig                      | 1 +
 configs/Merrii_A80_Optimus_defconfig           | 1 +
 configs/Mini-X_defconfig                       | 1 +
 configs/Nintendo_NES_Classic_Edition_defconfig | 1 +
 configs/Orangepi_defconfig                     | 1 +
 configs/Orangepi_mini_defconfig                | 1 +
 configs/Sinlinx_SinA31s_defconfig              | 1 +
 configs/Sinlinx_SinA33_defconfig               | 1 +
 configs/Sinovoip_BPI_M2_Plus_defconfig         | 1 +
 configs/Sinovoip_BPI_M2_defconfig              | 1 +
 configs/Sinovoip_BPI_M3_defconfig              | 1 +
 configs/Sunchip_CX-A99_defconfig               | 1 +
 configs/UTOO_P66_defconfig                     | 1 +
 configs/Wexler_TAB7200_defconfig               | 1 +
 configs/Wits_Pro_A20_DKT_defconfig             | 1 +
 configs/Wobo_i5_defconfig                      | 1 +
 configs/Yones_Toptech_BD1078_defconfig         | 1 +
 configs/Yones_Toptech_BS1078_V2_defconfig      | 1 +
 configs/ba10_tv_box_defconfig                  | 1 +
 configs/bananapi_m64_defconfig                 | 1 +
 configs/cgtqmx6eval_defconfig                  | 1 +
 configs/colorfly_e708_q1_defconfig             | 1 +
 configs/difrnce_dit4350_defconfig              | 1 +
 configs/dms-ba16-1g_defconfig                  | 1 +
 configs/dms-ba16_defconfig                     | 1 +
 configs/dserve_dsrv9703c_defconfig             | 1 +
 configs/ga10h_v1_1_defconfig                   | 1 +
 configs/gt90h_v4_defconfig                     | 1 +
 configs/gwventana_emmc_defconfig               | 1 +
 configs/gwventana_gw5904_defconfig             | 1 +
 configs/gwventana_nand_defconfig               | 1 +
 configs/h8_homlet_v2_defconfig                 | 1 +
 configs/i12-tvbox_defconfig                    | 1 +
 configs/iNet_3F_defconfig                      | 1 +
 configs/iNet_3W_defconfig                      | 1 +
 configs/iNet_86VS_defconfig                    | 1 +
 configs/iNet_D978_rev2_defconfig               | 1 +
 configs/icnova-a20-swac_defconfig              | 1 +
 configs/inet1_defconfig                        | 1 +
 configs/inet86dz_defconfig                     | 1 +
 configs/inet97fv2_defconfig                    | 1 +
 configs/inet98v_rev2_defconfig                 | 1 +
 configs/inet9f_rev03_defconfig                 | 1 +
 configs/inet_q972_defconfig                    | 1 +
 configs/jesurun_q5_defconfig                   | 1 +
 configs/mixtile_loftq_defconfig                | 1 +
 configs/mk802_a10s_defconfig                   | 1 +
 configs/mk802_defconfig                        | 1 +
 configs/mk802ii_defconfig                      | 1 +
 configs/mx6qsabrelite_defconfig                | 1 +
 configs/nanopi_m1_defconfig                    | 1 +
 configs/nanopi_m1_plus_defconfig               | 1 +
 configs/nanopi_neo2_defconfig                  | 1 +
 configs/nanopi_neo_air_defconfig               | 1 +
 configs/nanopi_neo_defconfig                   | 1 +
 configs/nitrogen6dl2g_defconfig                | 1 +
 configs/nitrogen6dl_defconfig                  | 1 +
 configs/nitrogen6q2g_defconfig                 | 1 +
 configs/nitrogen6q_defconfig                   | 1 +
 configs/nitrogen6s1g_defconfig                 | 1 +
 configs/nitrogen6s_defconfig                   | 1 +
 configs/novena_defconfig                       | 1 +
 configs/orangepi_2_defconfig                   | 1 +
 configs/orangepi_lite_defconfig                | 1 +
 configs/orangepi_one_defconfig                 | 1 +
 configs/orangepi_pc2_defconfig                 | 1 +
 configs/orangepi_pc_defconfig                  | 1 +
 configs/orangepi_pc_plus_defconfig             | 1 +
 configs/orangepi_plus2e_defconfig              | 1 +
 configs/orangepi_plus_defconfig                | 1 +
 configs/orangepi_prime_defconfig               | 1 +
 configs/orangepi_win_defconfig                 | 1 +
 configs/orangepi_zero_defconfig                | 1 +
 configs/orangepi_zero_plus2_defconfig          | 1 +
 configs/parrot_r16_defconfig                   | 1 +
 configs/pine64_plus_defconfig                  | 1 +
 configs/polaroid_mid2407pxe03_defconfig        | 1 +
 configs/polaroid_mid2809pxe04_defconfig        | 1 +
 configs/pov_protab2_ips9_defconfig             | 1 +
 configs/q8_a13_tablet_defconfig                | 1 +
 configs/q8_a23_tablet_800x480_defconfig        | 1 +
 configs/q8_a33_tablet_1024x600_defconfig       | 1 +
 configs/q8_a33_tablet_800x480_defconfig        | 1 +
 configs/r7-tv-dongle_defconfig                 | 1 +
 configs/sandbox_defconfig                      | 1 -
 configs/sandbox_flattree_defconfig             | 1 -
 configs/sandbox_noblk_defconfig                | 1 -
 configs/sandbox_spl_defconfig                  | 1 -
 configs/sopine_baseboard_defconfig             | 1 +
 configs/sun8i_a23_evb_defconfig                | 1 +
 configs/sunxi_Gemei_G9_defconfig               | 1 +
 configs/tbs2910_defconfig                      | 1 +
 include/configs/MPC8610HPCD.h                  | 1 -
 include/configs/MPC8641HPCN.h                  | 1 -
 include/configs/advantech_dms-ba16.h           | 1 -
 include/configs/am3517_crane.h                 | 1 -
 include/configs/am3517_evm.h                   | 1 -
 include/configs/apalis_imx6.h                  | 3 ---
 include/configs/cgtqmx6eval.h                  | 1 -
 include/configs/colibri_imx6.h                 | 3 ---
 include/configs/cyrus.h                        | 1 -
 include/configs/ge_bx50v3.h                    | 1 -
 include/configs/gw_ventana.h                   | 1 -
 include/configs/mx6cuboxi.h                    | 1 -
 include/configs/nitrogen6x.h                   | 1 -
 include/configs/novena.h                       | 1 -
 include/configs/omap3_evm.h                    | 1 -
 include/configs/rpi.h                          | 1 -
 include/configs/sunxi-common.h                 | 1 -
 include/configs/tbs2910.h                      | 1 -
 include/configs/tegra-common-post.h            | 1 -
 include/configs/x86-common.h                   | 1 -
 157 files changed, 133 insertions(+), 28 deletions(-)
configs/A10-OLinuXino-Lime_defconfig +1 -0
index ec16a44..a809cb8 100644
@@ -22,3 +22,4 @@ CONFIG_SUN4I_EMAC=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A10s-OLinuXino-M_defconfig +1 -0
index af6f5bc..618883c 100644
@@ -19,3 +19,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN4I_EMAC=y
 CONFIG_AXP152_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A13-OLinuXinoM_defconfig +1 -0
index 530a60e..d8d1040 100644
@@ -21,3 +21,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUNXI_NO_PMIC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A13-OLinuXino_defconfig +1 -0
index 15c6879..111df03 100644
@@ -28,6 +28,7 @@ CONFIG_DFU_RAM=y
 CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/A20-OLinuXino-Lime2_defconfig +1 -0
index 1f2daa6..81a3997 100644
@@ -28,6 +28,7 @@ CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/A20-OLinuXino-Lime_defconfig +1 -0
index 7f63d4a..925a8be 100644
@@ -21,3 +21,4 @@ CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A20-OLinuXino_MICRO_defconfig +1 -0
index 89e87e7..a65a9fe 100644
@@ -24,3 +24,4 @@ CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A20-Olimex-SOM-EVB_defconfig +1 -0
index 6c87648..fe1a2b5 100644
@@ -26,3 +26,4 @@ CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A33-OLinuXino_defconfig +1 -0
index e959240..fafbeb2 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DCDC1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Ainol_AW1_defconfig +1 -0
index 0e5023a..af2d593 100644
@@ -22,3 +22,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Ampe_A76_defconfig +1 -0
index f3f599d..03f5139 100644
@@ -23,3 +23,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Auxtek-T003_defconfig +1 -0
index f152414..badfd94 100644
@@ -17,3 +17,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP152_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Auxtek-T004_defconfig +1 -0
index 3f24a06..48a8344 100644
@@ -15,3 +15,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP152_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Bananapi_M2_Ultra_defconfig +1 -0
index 4332eca..da3eb2b 100644
@@ -16,3 +16,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_FPGA is not set
 CONFIG_AXP_DLDO4_VOLT=2500
 CONFIG_AXP_ELDO3_VOLT=1200
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Bananapi_defconfig +1 -0
index fe75eef..84f7d98 100644
@@ -21,3 +21,4 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Bananapro_defconfig +1 -0
index df65922..dd96b2c 100644
@@ -24,3 +24,4 @@ CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_ALDO4_VOLT=2500
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/CHIP_defconfig +1 -0
index 49e280e..194af0e 100644
@@ -19,6 +19,7 @@ CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/CHIP_pro_defconfig +1 -0
index 013d908..c85a95d 100644
@@ -25,6 +25,7 @@ CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/CSQ_CS908_defconfig +1 -0
index a6fcbf5..348abb5 100644
@@ -19,3 +19,4 @@ CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Chuwi_V7_CW0825_defconfig +1 -0
index 684213e..7ece4f9 100644
@@ -22,6 +22,7 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_VIDEO_LCD_SPI_CS="PA0"
 CONFIG_VIDEO_LCD_SPI_SCLK="PA1"
 CONFIG_VIDEO_LCD_SPI_MOSI="PA2"
configs/Colombus_defconfig +1 -0
index 1359281..21e87e6 100644
@@ -28,3 +28,4 @@ CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Cubieboard2_defconfig +1 -0
index 02c503f..48cb448 100644
@@ -18,3 +18,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Cubieboard4_defconfig +1 -0
index 97cef1f..6f9fd2b 100644
@@ -19,3 +19,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP809_POWER=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Cubieboard_defconfig +1 -0
index a8e9c98..7c79807 100644
@@ -17,3 +17,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN4I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Cubietruck_defconfig +1 -0
index f9d56c8..a2ddf8d 100644
@@ -28,6 +28,7 @@ CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/Cubietruck_plus_defconfig +1 -0
index 1a59e93..34444ec 100644
@@ -26,3 +26,4 @@ CONFIG_AXP_DLDO4_VOLT=3300
 CONFIG_AXP_FLDO1_VOLT=1200
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Empire_electronix_d709_defconfig +1 -0
index 032056b..f83e33a 100644
@@ -24,3 +24,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Empire_electronix_m712_defconfig +1 -0
index 8437da3..5a7bc09 100644
@@ -23,3 +23,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Hummingbird_A31_defconfig +1 -0
index 6f9b103..45fd4f4 100644
@@ -20,3 +20,4 @@ CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Hyundai_A7HD_defconfig +1 -0
index b7bd437..0808ada 100644
@@ -23,3 +23,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Itead_Ibox_A20_defconfig +1 -0
index 4bae19f..0bd79ce 100644
@@ -18,3 +18,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Lamobo_R1_defconfig +1 -0
index cc29d60..3a7318f 100644
@@ -21,3 +21,4 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/LicheePi_Zero_defconfig +1 -0
index 887997b..bd754cb 100644
@@ -8,3 +8,4 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3s-licheepi-zero"
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_NETDEVICES is not set
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Linksprite_pcDuino3_Nano_defconfig +1 -0
index 80416cb..94a122a 100644
@@ -21,3 +21,4 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Linksprite_pcDuino3_defconfig +1 -0
index b9f89a0..1ec8de2 100644
@@ -18,3 +18,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Linksprite_pcDuino_defconfig +1 -0
index e33a9c1..06edc5e 100644
@@ -15,3 +15,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN4I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/MK808C_defconfig +1 -0
index e4a2dd7..790b161 100644
@@ -13,3 +13,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/MSI_Primo73_defconfig +1 -0
index bd4cc03..6f23d87 100644
@@ -17,3 +17,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/MSI_Primo81_defconfig +1 -0
index 08a7db2..ccdea4a 100644
@@ -22,6 +22,7 @@ CONFIG_SPL=y
 CONFIG_AXP_DLDO1_VOLT=3300
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_VIDEO_LCD_SSD2828_TX_CLK=27
 CONFIG_VIDEO_LCD_SSD2828_RESET="PA26"
 CONFIG_VIDEO_LCD_SPI_CS="PH9"
configs/Marsboard_A10_defconfig +1 -0
index 6b8bd1a..082c825 100644
@@ -14,3 +14,4 @@ CONFIG_SPL=y
 CONFIG_SUN4I_EMAC=y
 CONFIG_SUNXI_NO_PMIC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_A1000G_quad_defconfig +1 -0
index 5b1b5f5..d908e33 100644
@@ -22,3 +22,4 @@ CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_AXP_DLDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_A1000_defconfig +1 -0
index 0442360..466dcf7 100644
@@ -17,3 +17,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN4I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_I7_defconfig +1 -0
index b609697..3c33739 100644
@@ -20,3 +20,4 @@ CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_AXP_DLDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_M3_defconfig +1 -0
index 08e8c2d..b500611 100644
@@ -19,3 +19,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_M5_defconfig +1 -0
index 4c377e3..83ad132 100644
@@ -19,3 +19,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_M9_defconfig +1 -0
index dc7901f..d357566 100644
@@ -20,3 +20,4 @@ CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_AXP_DLDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Merrii_A80_Optimus_defconfig +1 -0
index 8bc751c..7bea3e2 100644
@@ -19,3 +19,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP809_POWER=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mini-X_defconfig +1 -0
index 811c941..67ae102 100644
@@ -15,3 +15,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Nintendo_NES_Classic_Edition_defconfig +1 -0
index 5f91c35..4d88ce6 100644
@@ -19,6 +19,7 @@ CONFIG_SPL=y
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_AXP_ELDO2_VOLT=1800
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/Orangepi_defconfig +1 -0
index b8c1ea4..a1108fc 100644
@@ -23,3 +23,4 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Orangepi_mini_defconfig +1 -0
index 19c35ef..ac2c88e 100644
@@ -25,3 +25,4 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinlinx_SinA31s_defconfig +1 -0
index 7f815a3..0cb8c13 100644
@@ -21,3 +21,4 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinlinx_SinA33_defconfig +1 -0
index d1b5b22..6ba5207 100644
@@ -24,6 +24,7 @@ CONFIG_CMD_DFU=y
 CONFIG_DFU_RAM=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/Sinovoip_BPI_M2_Plus_defconfig +1 -0
index 651a2ff..43ae6ca 100644
@@ -17,3 +17,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinovoip_BPI_M2_defconfig +1 -0
index a2cadbc..feec46e 100644
@@ -20,3 +20,4 @@ CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_AXP_ALDO2_VOLT=1800
 CONFIG_AXP_DLDO1_VOLT=3000
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinovoip_BPI_M3_defconfig +1 -0
index 45eadcb..8392836 100644
@@ -27,3 +27,4 @@ CONFIG_AXP_DLDO3_VOLT=2500
 CONFIG_AXP_SW_ON=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sunchip_CX-A99_defconfig +1 -0
index 0641b1f..2284bd3 100644
@@ -18,3 +18,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/UTOO_P66_defconfig +1 -0
index 99b15ea..dcfd570 100644
@@ -29,3 +29,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Wexler_TAB7200_defconfig +1 -0
index f80233a..3f04c39 100644
@@ -22,3 +22,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Wits_Pro_A20_DKT_defconfig +1 -0
index 8658ef6..739355a 100644
@@ -23,3 +23,4 @@ CONFIG_ETH_DESIGNWARE=y
 CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Wobo_i5_defconfig +1 -0
index 90f391f..e1746fb 100644
@@ -17,3 +17,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Yones_Toptech_BD1078_defconfig +1 -0
index 9612712..2d57784 100644
@@ -27,3 +27,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Yones_Toptech_BS1078_V2_defconfig +1 -0
index 3cbf41e..99481c9 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/ba10_tv_box_defconfig +1 -0
index ad066fd..083ead5 100644
@@ -19,3 +19,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN4I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/bananapi_m64_defconfig +1 -0
index 3908d42..4a08c1e 100644
@@ -15,3 +15,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/cgtqmx6eval_defconfig +1 -0
index 77dd227..814d959 100644
@@ -48,6 +48,7 @@ CONFIG_DFU_SF=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/colorfly_e708_q1_defconfig +1 -0
index c0ed30e..9e62d3b 100644
@@ -25,3 +25,4 @@ CONFIG_SPL=y
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_AXP_DLDO2_VOLT=1800
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/difrnce_dit4350_defconfig +1 -0
index 629507e..be16346 100644
@@ -23,3 +23,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/dms-ba16-1g_defconfig +1 -0
index 60db289..4a7ecc1 100644
@@ -33,6 +33,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_USB=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/dms-ba16_defconfig +1 -0
index 7a8c268..61f2068 100644
@@ -32,6 +32,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_USB=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/dserve_dsrv9703c_defconfig +1 -0
index c92fdb1..645bbbc 100644
@@ -22,3 +22,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/ga10h_v1_1_defconfig +1 -0
index 8e1c9f7..99ef75b 100644
@@ -26,3 +26,4 @@ CONFIG_SPL=y
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/gt90h_v4_defconfig +1 -0
index 8f6469d..a651fe5 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/gwventana_emmc_defconfig +1 -0
index a476dc2..4b7f179 100644
@@ -57,6 +57,7 @@ CONFIG_DM_SERIAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/gwventana_gw5904_defconfig +1 -0
index bd38e6d..719d1a0 100644
@@ -61,6 +61,7 @@ CONFIG_DM_SERIAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/gwventana_nand_defconfig +1 -0
index 296f015..701257f 100644
@@ -58,6 +58,7 @@ CONFIG_DM_SERIAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/h8_homlet_v2_defconfig +1 -0
index 368233a..cd599ad 100644
@@ -20,3 +20,4 @@ CONFIG_SPL=y
 CONFIG_AXP_DLDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/i12-tvbox_defconfig +1 -0
index 4245491..416d771 100644
@@ -17,3 +17,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/iNet_3F_defconfig +1 -0
index 231b2b9..0c3d226 100644
@@ -22,3 +22,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/iNet_3W_defconfig +1 -0
index a366abe..5c1dc32 100644
@@ -22,3 +22,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/iNet_86VS_defconfig +1 -0
index ed8650b..6beabda 100644
@@ -21,3 +21,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/iNet_D978_rev2_defconfig +1 -0
index 62e4f1b..907b6cd 100644
@@ -26,3 +26,4 @@ CONFIG_SPL=y
 CONFIG_AXP_DLDO1_VOLT=3300
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/icnova-a20-swac_defconfig +1 -0
index 6f79c58..f0c663d 100644
@@ -24,3 +24,4 @@ CONFIG_CMD_UNZIP=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet1_defconfig +1 -0
index d1bebc2..a8905ae 100644
@@ -23,3 +23,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet86dz_defconfig +1 -0
index 7940d97..a596e09 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet97fv2_defconfig +1 -0
index 4f1a7b5..6376f5f 100644
@@ -21,3 +21,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet98v_rev2_defconfig +1 -0
index 2afe3be..1b5dc9b 100644
@@ -23,3 +23,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet9f_rev03_defconfig +1 -0
index ae732fa..3265a44 100644
@@ -21,3 +21,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet_q972_defconfig +1 -0
index d436005..1d0fe8f 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/jesurun_q5_defconfig +1 -0
index 822d56b..6882144 100644
@@ -18,3 +18,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN4I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mixtile_loftq_defconfig +1 -0
index 6264b3a..00f6945 100644
@@ -20,3 +20,4 @@ CONFIG_RGMII=y
 CONFIG_SUN7I_GMAC=y
 CONFIG_AXP_ALDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mk802_a10s_defconfig +1 -0
index 69e9cfd..9b358a4 100644
@@ -16,3 +16,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP152_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mk802_defconfig +1 -0
index da9728a..d806916 100644
@@ -13,3 +13,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUNXI_NO_PMIC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mk802ii_defconfig +1 -0
index c55f1f3..286900d 100644
@@ -12,3 +12,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mx6qsabrelite_defconfig +1 -0
index a542799..69cf5bb 100644
@@ -37,6 +37,7 @@ CONFIG_DM_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/nanopi_m1_defconfig +1 -0
index 498496b..b1fbc4d 100644
@@ -14,3 +14,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_m1_plus_defconfig +1 -0
index d7a908d..abe93f6 100644
@@ -16,3 +16,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_neo2_defconfig +1 -0
index c0ac100..c7db07a 100644
@@ -14,3 +14,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_neo_air_defconfig +1 -0
index a73640e..0a3dbae 100644
@@ -16,3 +16,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_neo_defconfig +1 -0
index 8b55497..cc49aaf 100644
@@ -17,3 +17,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nitrogen6dl2g_defconfig +1 -0
index 5744ede..32db5ab 100644
@@ -35,6 +35,7 @@ CONFIG_SPI_FLASH_SST=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/nitrogen6dl_defconfig +1 -0
index dca89ec..4372d4f 100644
@@ -35,6 +35,7 @@ CONFIG_SPI_FLASH_SST=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/nitrogen6q2g_defconfig +1 -0
index a19d093..b747cdd 100644
@@ -35,6 +35,7 @@ CONFIG_SPI_FLASH_SST=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/nitrogen6q_defconfig +1 -0
index edf4b63..cb14c37 100644
@@ -35,6 +35,7 @@ CONFIG_SPI_FLASH_SST=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/nitrogen6s1g_defconfig +1 -0
index 0f75320..8303c52 100644
@@ -35,6 +35,7 @@ CONFIG_SPI_FLASH_SST=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/nitrogen6s_defconfig +1 -0
index 45a5acb..4d7db06 100644
@@ -35,6 +35,7 @@ CONFIG_SPI_FLASH_SST=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
configs/novena_defconfig +1 -0
index afacea7..fe6cf2f 100644
@@ -36,6 +36,7 @@ CONFIG_PCI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 # CONFIG_VIDEO_SW_CURSOR is not set
configs/orangepi_2_defconfig +1 -0
index dffba8c..7c9cc45 100644
@@ -19,3 +19,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SY8106A_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_lite_defconfig +1 -0
index 448a161..04910bd 100644
@@ -14,3 +14,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_one_defconfig +1 -0
index 97d0e06..2e5eeee 100644
@@ -15,3 +15,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_pc2_defconfig +1 -0
index 5a64ad3..9731e7a 100644
@@ -16,3 +16,4 @@ CONFIG_SPL=y
 CONFIG_SPL_SPI_SUNXI=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_pc_defconfig +1 -0
index af7568f..df834a2 100644
@@ -17,3 +17,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SY8106A_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_pc_plus_defconfig +1 -0
index 935e96d..2fd2611 100644
@@ -18,3 +18,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SY8106A_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_plus2e_defconfig +1 -0
index 3301ca0..89bb059 100644
@@ -19,3 +19,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SY8106A_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_plus_defconfig +1 -0
index 34c5750..b9b4207 100644
@@ -21,3 +21,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_SY8106A_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_prime_defconfig +1 -0
index dc8d59e..103936d 100644
@@ -14,3 +14,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_win_defconfig +1 -0
index 85d8fa4..a3e278f 100644
@@ -14,3 +14,4 @@ CONFIG_SPL=y
 CONFIG_SPL_SPI_SUNXI=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_zero_defconfig +1 -0
index c650ce8..934e3d2 100644
@@ -16,3 +16,4 @@ CONFIG_SPL=y
 CONFIG_SPL_SPI_SUNXI=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_zero_plus2_defconfig +1 -0
index e3776f6..57c63b9 100644
@@ -16,3 +16,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/parrot_r16_defconfig +1 -0
index 76e4e34..0dea72e 100644
@@ -20,6 +20,7 @@ CONFIG_SPL=y
 # CONFIG_SPL_PARTITION_UUIDS is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
configs/pine64_plus_defconfig +1 -0
index a509ca9..d0a957b 100644
@@ -14,3 +14,4 @@ CONFIG_SPL=y
 CONFIG_OF_LIST="sun50i-a64-pine64 sun50i-a64-pine64-plus"
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/polaroid_mid2407pxe03_defconfig +1 -0
index d48a507..da120ed 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/polaroid_mid2809pxe04_defconfig +1 -0
index 72fe096..7b31abc 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/pov_protab2_ips9_defconfig +1 -0
index d4af808..16ac1a6 100644
@@ -22,3 +22,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/q8_a13_tablet_defconfig +1 -0
index 5115739..321c3a6 100644
@@ -23,3 +23,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/q8_a23_tablet_800x480_defconfig +1 -0
index 1762fe4..bd95f9b 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/q8_a33_tablet_1024x600_defconfig +1 -0
index d42b597..51509d3 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/q8_a33_tablet_800x480_defconfig +1 -0
index 5b6dfe0..1349269 100644
@@ -24,3 +24,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP_DLDO1_VOLT=3300
 CONFIG_USB_MUSB_HOST=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/r7-tv-dongle_defconfig +1 -0
index 4817e6c..137614c 100644
@@ -15,3 +15,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_AXP152_POWER=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/sandbox_defconfig +0 -1
index 6a6e774..e880fa7 100644
@@ -170,7 +170,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
configs/sandbox_flattree_defconfig +0 -1
index c5ef69f..eaf29df 100644
@@ -160,7 +160,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
configs/sandbox_noblk_defconfig +0 -1
index 747d4b1..e335a2d 100644
@@ -169,7 +169,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
configs/sandbox_spl_defconfig +0 -1
index 6889206..17dba3f 100644
@@ -176,7 +176,6 @@ CONFIG_DM_USB=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
-CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
 CONFIG_CONSOLE_ROTATION=y
 CONFIG_CONSOLE_TRUETYPE=y
configs/sopine_baseboard_defconfig +1 -0
index 122bba3..7f1b0bb 100644
@@ -20,3 +20,4 @@ CONFIG_SPL=y
 CONFIG_SPL_SPI_SUNXI=y
 CONFIG_SUN8I_EMAC=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/sun8i_a23_evb_defconfig +1 -0
index 49ba431..32254ef 100644
@@ -16,3 +16,4 @@ CONFIG_SPL=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/sunxi_Gemei_G9_defconfig +1 -0
index 903def1..9dbf5d0 100644
@@ -19,3 +19,4 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_USB_EHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/tbs2910_defconfig +1 -0
index ac8f9c6..7cc2a05 100644
@@ -39,6 +39,7 @@ CONFIG_DM_THERMAL=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
 CONFIG_USB_GADGET=y
 CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
include/configs/MPC8610HPCD.h +0 -1
index 2014450..bea3405 100644
@@ -273,7 +273,6 @@
  ************************************************************/
 #define CONFIG_PCI_OHCI		1
 #define CONFIG_USB_OHCI_NEW		1
-#define CONFIG_SYS_USB_EVENT_POLL	1
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME	"ohci_pci"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
 #define CONFIG_SYS_OHCI_SWAP_REG_ACCESS	1
include/configs/MPC8641HPCN.h +0 -1
index 7ec36eb..02bd482 100644
@@ -352,7 +352,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  ************************************************************/
 #define CONFIG_PCI_OHCI			1
 #define CONFIG_USB_OHCI_NEW		1
-#define CONFIG_SYS_USB_EVENT_POLL		1
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"ohci_pci"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	15
 #define CONFIG_SYS_OHCI_SWAP_REG_ACCESS	1
include/configs/advantech_dms-ba16.h +0 -1
index f320792..fa3b62c 100644
@@ -59,7 +59,6 @@
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
 
 #define CONFIG_USBD_HS
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
include/configs/am3517_crane.h +0 -1
index eb768b9..aa0b3e0 100644
@@ -81,7 +81,6 @@
 #ifdef CONFIG_USB_MUSB_HCD
 
 #ifdef CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_USB_EVENT_POLL
 #define CONFIG_PREBOOT "usb start"
 #endif /* CONFIG_USB_KEYBOARD */
 
include/configs/am3517_evm.h +0 -1
index 829dd3ec..5ce3467 100644
@@ -74,7 +74,6 @@
 #ifdef CONFIG_USB_MUSB_HOST
 
 #ifdef CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_USB_EVENT_POLL
 #define CONFIG_PREBOOT "usb start"
 #endif /* CONFIG_USB_KEYBOARD */
 
include/configs/apalis_imx6.h +0 -3
index 8be586b..4d6397b 100644
@@ -105,9 +105,6 @@
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
 #define CONFIG_USB_KEYBOARD
-#ifdef CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_USB_EVENT_POLL
-#endif /* CONFIG_USB_KEYBOARD */
 /* Client */
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_USBD_HS
include/configs/cgtqmx6eval.h +0 -1
index cad1357..2491dda 100644
@@ -67,7 +67,6 @@
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
 
 #define CONFIG_USBD_HS
 
include/configs/colibri_imx6.h +0 -3
index 82812e5..3ea8ec8 100644
@@ -86,9 +86,6 @@
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
 #define CONFIG_USB_KEYBOARD
-#ifdef CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_USB_EVENT_POLL
-#endif /* CONFIG_USB_KEYBOARD */
 /* Client */
 #define CONFIG_USB_GADGET_VBUS_DRAW	2
 #define CONFIG_USBD_HS
include/configs/cyrus.h +0 -1
index a23da19..7d55b3f 100644
@@ -427,7 +427,6 @@
 #define CONFIG_USB_EHCI_FSL
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #define CONFIG_EHCI_IS_TDI
-#define CONFIG_SYS_USB_EVENT_POLL
  /* _VIA_CONTROL_EP  */
 #endif
 
include/configs/ge_bx50v3.h +0 -1
index f60a029..8bcf786 100644
@@ -71,7 +71,6 @@
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
 
 #define CONFIG_CI_UDC
 #define CONFIG_USBD_HS
include/configs/gw_ventana.h +0 -1
index 2227eea..1fdf1f8 100644
@@ -163,7 +163,6 @@
 #define CONFIG_USB_ETHER
 #define CONFIG_USB_ETH_CDC
 #define CONFIG_NETCONSOLE
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
 
 /* USB Mass Storage Gadget */
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
include/configs/mx6cuboxi.h +0 -1
index bc22f56..fed6f09 100644
@@ -47,7 +47,6 @@
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT	2
-#define CONFIG_SYS_USB_EVENT_POLL
 #define CONFIG_PREBOOT \
 	"if hdmidet; then " \
 		"usb start; "		       \
include/configs/nitrogen6x.h +0 -1
index 00b84f7..717e54f 100644
@@ -82,7 +82,6 @@
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
 
 /* Framebuffer and LCD */
 #define CONFIG_VIDEO_IPUV3
include/configs/novena.h +0 -1
index 1f1bf15..9812606 100644
@@ -133,7 +133,6 @@
 
 /* USB Configs */
 #ifdef CONFIG_CMD_USB
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
 #define CONFIG_USB_ETHER_SMSC95XX
include/configs/omap3_evm.h +0 -1
index 53bfc13..a2a5a07 100644
@@ -206,7 +206,6 @@
 #ifdef CONFIG_USB_MUSB_HCD
 
 #ifdef CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_USB_EVENT_POLL
 #define CONFIG_PREBOOT			"usb start"
 #endif /* CONFIG_USB_KEYBOARD */
 
include/configs/rpi.h +0 -1
index b31e2ac..7ddc674 100644
@@ -75,7 +75,6 @@
 #define CONFIG_USB_ETHER_SMSC95XX
 #define CONFIG_TFTP_TSIZE
 #define CONFIG_MISC_INIT_R
-#define CONFIG_SYS_USB_EVENT_POLL
 #endif
 
 /* Console UART */
include/configs/sunxi-common.h +0 -1
index ee669cb..da91117 100644
@@ -340,7 +340,6 @@ extern int soft_i2c_gpio_scl;
 
 #ifdef CONFIG_USB_KEYBOARD
 #define CONFIG_PREBOOT
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 #endif
 
 #define CONFIG_MISC_INIT_R
include/configs/tbs2910.h +0 -1
index 84ca1c4..f92eec3 100644
@@ -100,7 +100,6 @@
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
 #endif /* CONFIG_CMD_USB_MASS_STORAGE */
 #ifdef CONFIG_USB_KEYBOARD
-#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 #define CONFIG_PREBOOT \
 	"usb start; " \
 	"if hdmidet; then " \
include/configs/tegra-common-post.h +0 -1
index dd72e5b..743be6b 100644
@@ -41,7 +41,6 @@
 
 #ifdef CONFIG_USB_KEYBOARD
 #define STDIN_KBD_USB ",usbkbd"
-#define CONFIG_SYS_USB_EVENT_POLL
 #define CONFIG_PREBOOT			"usb start"
 #else
 #define STDIN_KBD_USB ""
include/configs/x86-common.h +0 -1
index 70a559b..11fa1d4 100644
@@ -131,7 +131,6 @@
  * USB configuration
  */
 #define CONFIG_USB_EHCI_PCI
-#define CONFIG_SYS_USB_EVENT_POLL
 
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
Signature · 1 line
2.9.2
author
#3 lore raw

PATCH v2 3/13 usb: kbd: kconfig: Set a default polling mechanism for USB keyboard

In reply to Bin Meng

The choice of "USB keyboard polling" cannot be optional as without one mechanism being set, it just doesn't work. Set the default one to CONFIG_SYS_USB_EVENT_POLL.

---

 drivers/usb/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/Kconfig +1 -1
index da3ec2f..acbac69 100644
@@ -75,7 +75,7 @@ if USB_KEYBOARD
 
 choice
 	prompt "USB keyboard polling"
-	optional
+	default SYS_USB_EVENT_POLL
 	---help---
 	  Enable a polling mechanism for USB keyboard.
 
Signature · 1 line
2.9.2
author
#4 lore raw

PATCH v2 4/13 usb: Only get 64 bytes device descriptor for full speed devices

In reply to Bin Meng

Full speed device endpoint 0 can have 8/16/32/64 bMaxPacketSize0. Other speed devices report fixed value per USB spec. So it only makes sense if we send a get device descriptor with 64 bytes to full speed devices.

While we are here, update the comment block to be within 80 cols.

---

 common/usb.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
common/usb.c +15 -14
index 0904259..2aaf932 100644
@@ -969,23 +969,24 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
 	dev->epmaxpacketin[0] = dev->descriptor.bMaxPacketSize0;
 	dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0;
 
-	if (do_read) {
+	if (do_read && dev->speed == USB_SPEED_FULL) {
 		int err;
 
 		/*
-		 * Validate we've received only at least 8 bytes, not that we've
-		 * received the entire descriptor. The reasoning is:
-		 * - The code only uses fields in the first 8 bytes, so that's all we
-		 *   need to have fetched at this stage.
-		 * - The smallest maxpacket size is 8 bytes. Before we know the actual
-		 *   maxpacket the device uses, the USB controller may only accept a
-		 *   single packet. Consequently we are only guaranteed to receive 1
-		 *   packet (at least 8 bytes) even in a non-error case.
+		 * Validate we've received only at least 8 bytes, not that
+		 * we've received the entire descriptor. The reasoning is:
+		 * - The code only uses fields in the first 8 bytes, so
+		 *   that's all we need to have fetched at this stage.
+		 * - The smallest maxpacket size is 8 bytes. Before we know
+		 *   the actual maxpacket the device uses, the USB controller
+		 *   may only accept a single packet. Consequently we are only
+		 *   guaranteed to receive 1 packet (at least 8 bytes) even in
+		 *   a non-error case.
 		 *
-		 * At least the DWC2 controller needs to be programmed with the number
-		 * of packets in addition to the number of bytes. A request for 64
-		 * bytes of data with the maxpacket guessed as 64 (above) yields a
-		 * request for 1 packet.
+		 * At least the DWC2 controller needs to be programmed with
+		 * the number of packets in addition to the number of bytes.
+		 * A request for 64 bytes of data with the maxpacket guessed
+		 * as 64 (above) yields a request for 1 packet.
 		 */
 		err = get_descriptor_len(dev, 64, 8);
 		if (err)
@@ -1008,7 +1009,7 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read)
 		dev->maxpacketsize = PACKET_SIZE_64;
 		break;
 	default:
-		printf("usb_new_device: invalid max packet size\n");
+		printf("usb_setup_descriptor: invalid max packet size\n");
 		return -EIO;
 	}
 
Signature · 1 line
2.9.2
author
#5 lore raw

PATCH v2 5/13 usb: Read device descriptor after device is addressed for xHCI

In reply to Bin Meng

For xHCI it is not possible to read a device descriptor before it has been assigned an address. That's why usb_setup_descriptor() was called with 'do_read' being false. But we really need try to read the device descriptor before starting any real communication with the default control endpoint.

---

 common/usb.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
common/usb.c +11 -0
index 2aaf932..e469534 100644
@@ -1051,6 +1051,17 @@ static int usb_prepare_device(struct usb_device *dev, int addr, bool do_read,
 
 	mdelay(10);	/* Let the SET_ADDRESS settle */
 
+	/*
+	 * If we haven't read device descriptor before, read it here
+	 * after device is assigned an address. This is only applicable
+	 * to xHCI so far.
+	 */
+	if (!do_read) {
+		err = usb_setup_descriptor(dev, true);
+		if (err)
+			return err;
+	}
+
 	return 0;
 }
 
Signature · 1 line
2.9.2
author
#6 lore raw

PATCH v2 6/13 usb: xhci: Fix max packet size for full speed device endpoint 0

In reply to Bin Meng

In xhci_check_maxpacket(), the control endpoint 0 max packet size is wrongly taken from the interface's endpoint descriptor. However the default endpoint 0 does not come with an endpoint descriptor hence is not included in the interface structure. Change to use epmaxpacketin[0] instead.

The other bug in this routine is that when setting max packet size to the xHC endpoint 0 context, it does not clear its previous value at all before programming a new one.

---

 drivers/usb/host/xhci.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/usb/host/xhci.c +3 -5
index 8aff5b5..cc65555 100644
@@ -546,16 +546,13 @@ int xhci_check_maxpacket(struct usb_device *udev)
 	int max_packet_size;
 	int hw_max_packet_size;
 	int ret = 0;
-	struct usb_interface *ifdesc;
-
-	ifdesc = &udev->config.if_desc[0];
 
 	out_ctx = ctrl->devs[slot_id]->out_ctx;
 	xhci_inval_cache((uintptr_t)out_ctx->bytes, out_ctx->size);
 
 	ep_ctx = xhci_get_ep_ctx(ctrl, out_ctx, ep_index);
 	hw_max_packet_size = MAX_PACKET_DECODED(le32_to_cpu(ep_ctx->ep_info2));
-	max_packet_size = usb_endpoint_maxp(&ifdesc->ep_desc[0]);
+	max_packet_size = udev->epmaxpacketin[0];
 	if (hw_max_packet_size != max_packet_size) {
 		debug("Max Packet Size for ep 0 changed.\n");
 		debug("Max packet size in usb_device = %d\n", max_packet_size);
@@ -567,7 +564,8 @@ int xhci_check_maxpacket(struct usb_device *udev)
 				ctrl->devs[slot_id]->out_ctx, ep_index);
 		in_ctx = ctrl->devs[slot_id]->in_ctx;
 		ep_ctx = xhci_get_ep_ctx(ctrl, in_ctx, ep_index);
-		ep_ctx->ep_info2 &= cpu_to_le32(~MAX_PACKET_MASK);
+		ep_ctx->ep_info2 &= cpu_to_le32(~((0xffff & MAX_PACKET_MASK)
+						<< MAX_PACKET_SHIFT));
 		ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet_size));
 
 		/*
Signature · 1 line
2.9.2
author
#7 lore raw

PATCH v2 7/13 usb: hub: Clear port reset before usb_hub_port_connect_change()

In reply to Bin Meng

During usb_hub_port_connect_change(), a port reset set feature request is issued to the port, and later a port reset clear feature is done to the same port before the function returns. However at the end of usb_scan_port(), we attempt to clear port reset again on a cached port status change variable, which should not be done.

Adjust the call to clear port reset to right before the call to usb_hub_port_connect_change().

---

 common/usb_hub.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
common/usb_hub.c +5 -5
index 70bc6e2..ce85ac6 100644
@@ -489,6 +489,11 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 		return 0;
 	}
 
+	if (portchange & USB_PORT_STAT_C_RESET) {
+		debug("port %d reset change\n", i + 1);
+		usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
+	}
+
 	/* A new USB device is ready at this point */
 	debug("devnum=%d port=%d: USB dev found\n", dev->devnum, i + 1);
 
@@ -543,11 +548,6 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 		       hub->overcurrent_count[i]);
 	}
 
-	if (portchange & USB_PORT_STAT_C_RESET) {
-		debug("port %d reset change\n", i + 1);
-		usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
-	}
-
 	/*
 	 * We're done with this device, so let's remove this device from
 	 * scanning list
Signature · 1 line
2.9.2
author
#8 lore raw

PATCH v2 8/13 usb: hub: Clear BH reset status change for a 3.0 hub

In reply to Bin Meng

USB 3.0 hubs report bit[5] in the port status change response as BH reset. The hub shall set the C_BH_PORT_RESET field for this port.

---

 common/usb_hub.c | 6 ++++++
 1 file changed, 6 insertions(+)
common/usb_hub.c +6 -0
index ce85ac6..dc115ad 100644
@@ -494,6 +494,12 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 		usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET);
 	}
 
+	if ((portchange & USB_SS_PORT_STAT_C_BH_RESET) &&
+	    usb_hub_is_superspeed(dev)) {
+		debug("port %d BH reset change\n", i + 1);
+		usb_clear_port_feature(dev, i + 1, USB_SS_PORT_FEAT_C_BH_RESET);
+	}
+
 	/* A new USB device is ready at this point */
 	debug("devnum=%d port=%d: USB dev found\n", dev->devnum, i + 1);
 
Signature · 1 line
2.9.2
author
#9 lore raw

PATCH v2 9/13 usb: Handle audio extension endpoint descriptor in usb_parse_config()

In reply to Bin Meng

Normal endpoint descriptor size is 7, but for audio extension it is
9. Handle that correctly when parsing endpoint descriptor.

---

 common/usb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
common/usb.c +3 -2
index e469534..35408ba 100644
@@ -437,12 +437,13 @@ static int usb_parse_config(struct usb_device *dev,
 			}
 			break;
 		case USB_DT_ENDPOINT:
-			if (head->bLength != USB_DT_ENDPOINT_SIZE) {
+			if (head->bLength != USB_DT_ENDPOINT_SIZE &&
+			    head->bLength != USB_DT_ENDPOINT_AUDIO_SIZE) {
 				printf("ERROR: Invalid USB EP length (%d)\n",
 					head->bLength);
 				break;
 			}
-			if (index + USB_DT_ENDPOINT_SIZE >
+			if (index + head->bLength >
 			    dev->config.desc.wTotalLength) {
 				puts("USB EP descriptor overflowed buffer!\n");
 				break;
Signature · 1 line
2.9.2
author
#10 lore raw

PATCH v2 10/13 usb: xhci: Honor endpoint's interval

In reply to Bin Meng

USB endpoint reports the period between consecutive requests to send or receive data as bInverval in its endpoint descriptor. So far this is ignored by xHCI driver and the 'Interval' field in xHC's endpoint context is always programmed to zero which means 1ms for low speed or full speed , or 125us for high speed or super speed. We should honor the interval by getting it from endpoint descriptor.

---

 drivers/usb/host/xhci.c | 196 ++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/xhci.h |   5 +-
 include/linux/usb/ch9.h |  20 +++++
 3 files changed, 219 insertions(+), 2 deletions(-)
drivers/usb/host/xhci.c +196 -0
index cc65555..25bbb12 100644
@@ -257,6 +257,173 @@ static unsigned int xhci_get_ep_index(struct usb_endpoint_descriptor *desc)
 	return index;
 }
 
+/*
+ * Convert bInterval expressed in microframes (in 1-255 range) to exponent of
+ * microframes, rounded down to nearest power of 2.
+ */
+static unsigned int xhci_microframes_to_exponent(unsigned int desc_interval,
+						 unsigned int min_exponent,
+						 unsigned int max_exponent)
+{
+	unsigned int interval;
+
+	interval = fls(desc_interval) - 1;
+	interval = clamp_val(interval, min_exponent, max_exponent);
+	if ((1 << interval) != desc_interval)
+		debug("rounding interval to %d microframes, "\
+		      "ep desc says %d microframes\n",
+		      1 << interval, desc_interval);
+
+	return interval;
+}
+
+static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,
+	struct usb_endpoint_descriptor *endpt_desc)
+{
+	if (endpt_desc->bInterval == 0)
+		return 0;
+
+	return xhci_microframes_to_exponent(endpt_desc->bInterval, 0, 15);
+}
+
+
+static unsigned int xhci_parse_frame_interval(struct usb_device *udev,
+	struct usb_endpoint_descriptor *endpt_desc)
+{
+	return xhci_microframes_to_exponent(endpt_desc->bInterval * 8, 3, 10);
+}
+
+/*
+ * Convert interval expressed as 2^(bInterval - 1) == interval into
+ * straight exponent value 2^n == interval.
+ */
+static unsigned int xhci_parse_exponent_interval(struct usb_device *udev,
+	struct usb_endpoint_descriptor *endpt_desc)
+{
+	unsigned int interval;
+
+	interval = clamp_val(endpt_desc->bInterval, 1, 16) - 1;
+	if (interval != endpt_desc->bInterval - 1)
+		debug("ep %#x - rounding interval to %d %sframes\n",
+		      endpt_desc->bEndpointAddress, 1 << interval,
+		      udev->speed == USB_SPEED_FULL ? "" : "micro");
+
+	if (udev->speed == USB_SPEED_FULL) {
+		/*
+		 * Full speed isoc endpoints specify interval in frames,
+		 * not microframes. We are using microframes everywhere,
+		 * so adjust accordingly.
+		 */
+		interval += 3;	/* 1 frame = 2^3 uframes */
+	}
+
+	return interval;
+}
+
+/*
+ * Return the polling or NAK interval.
+ *
+ * The polling interval is expressed in "microframes". If xHCI's Interval field
+ * is set to N, it will service the endpoint every 2^(Interval)*125us.
+ *
+ * The NAK interval is one NAK per 1 to 255 microframes, or no NAKs if interval
+ * is set to 0.
+ */
+static unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
+	struct usb_endpoint_descriptor *endpt_desc)
+{
+	unsigned int interval = 0;
+
+	switch (udev->speed) {
+	case USB_SPEED_HIGH:
+		/* Max NAK rate */
+		if (usb_endpoint_xfer_control(endpt_desc) ||
+		    usb_endpoint_xfer_bulk(endpt_desc)) {
+			interval = xhci_parse_microframe_interval(udev,
+								  endpt_desc);
+			break;
+		}
+		/* Fall through - SS and HS isoc/int have same decoding */
+
+	case USB_SPEED_SUPER:
+		if (usb_endpoint_xfer_int(endpt_desc) ||
+		    usb_endpoint_xfer_isoc(endpt_desc)) {
+			interval = xhci_parse_exponent_interval(udev,
+								endpt_desc);
+		}
+		break;
+
+	case USB_SPEED_FULL:
+		if (usb_endpoint_xfer_isoc(endpt_desc)) {
+			interval = xhci_parse_exponent_interval(udev,
+								endpt_desc);
+			break;
+		}
+		/*
+		 * Fall through for interrupt endpoint interval decoding
+		 * since it uses the same rules as low speed interrupt
+		 * endpoints.
+		 */
+
+	case USB_SPEED_LOW:
+		if (usb_endpoint_xfer_int(endpt_desc) ||
+		    usb_endpoint_xfer_isoc(endpt_desc)) {
+			interval = xhci_parse_frame_interval(udev, endpt_desc);
+		}
+		break;
+
+	default:
+		BUG();
+	}
+
+	return interval;
+}
+
+/*
+ * The "Mult" field in the endpoint context is only set for SuperSpeed isoc eps.
+ * High speed endpoint descriptors can define "the number of additional
+ * transaction opportunities per microframe", but that goes in the Max Burst
+ * endpoint context field.
+ */
+static u32 xhci_get_endpoint_mult(struct usb_device *udev,
+	struct usb_endpoint_descriptor *endpt_desc,
+	struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc)
+{
+	if (udev->speed < USB_SPEED_SUPER ||
+	    !usb_endpoint_xfer_isoc(endpt_desc))
+		return 0;
+
+	return ss_ep_comp_desc->bmAttributes;
+}
+
+/*
+ * Return the maximum endpoint service interval time (ESIT) payload.
+ * Basically, this is the maxpacket size, multiplied by the burst size
+ * and mult size.
+ */
+static u32 xhci_get_max_esit_payload(struct usb_device *udev,
+	struct usb_endpoint_descriptor *endpt_desc,
+	struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc)
+{
+	int max_burst;
+	int max_packet;
+
+	/* Only applies for interrupt or isochronous endpoints */
+	if (usb_endpoint_xfer_control(endpt_desc) ||
+	    usb_endpoint_xfer_bulk(endpt_desc))
+		return 0;
+
+	/* SuperSpeed Isoc ep with less than 48k per esit */
+	if (udev->speed >= USB_SPEED_SUPER)
+		return le16_to_cpu(ss_ep_comp_desc->wBytesPerInterval);
+
+	max_packet = usb_endpoint_maxp(endpt_desc);
+	max_burst = usb_endpoint_maxp_mult(endpt_desc);
+
+	/* A 0 in max burst means 1 transfer per ESIT */
+	return max_packet * max_burst;
+}
+
 /**
  * Issue a configure endpoint command or evaluate context command
  * and wait for it to finish.
@@ -324,6 +491,10 @@ static int xhci_set_configuration(struct usb_device *udev)
 	int slot_id = udev->slot_id;
 	struct xhci_virt_device *virt_dev = ctrl->devs[slot_id];
 	struct usb_interface *ifdesc;
+	u32 max_esit_payload;
+	unsigned int interval;
+	unsigned int mult;
+	unsigned int avg_trb_len;
 
 	out_ctx = virt_dev->out_ctx;
 	in_ctx = virt_dev->in_ctx;
@@ -357,10 +528,26 @@ static int xhci_set_configuration(struct usb_device *udev)
 	/* filling up ep contexts */
 	for (cur_ep = 0; cur_ep < num_of_ep; cur_ep++) {
 		struct usb_endpoint_descriptor *endpt_desc = NULL;
+		struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc = NULL;
 
 		endpt_desc = &ifdesc->ep_desc[cur_ep];
+		ss_ep_comp_desc = &ifdesc->ss_ep_comp_desc[cur_ep];
 		trb_64 = 0;
 
+		/*
+		 * Get values to fill the endpoint context, mostly from ep
+		 * descriptor. The average TRB buffer lengt for bulk endpoints
+		 * is unclear as we have no clue on scatter gather list entry
+		 * size. For Isoc and Int, set it to max available.
+		 * See xHCI 1.1 spec 4.14.1.1 for details.
+		 */
+		max_esit_payload = xhci_get_max_esit_payload(udev, endpt_desc,
+							     ss_ep_comp_desc);
+		interval = xhci_get_endpoint_interval(udev, endpt_desc);
+		mult = xhci_get_endpoint_mult(udev, endpt_desc,
+					      ss_ep_comp_desc);
+		avg_trb_len = max_esit_payload;
+
 		ep_index = xhci_get_ep_index(endpt_desc);
 		ep_ctx[ep_index] = xhci_get_ep_ctx(ctrl, in_ctx, ep_index);
 
@@ -372,6 +559,11 @@ static int xhci_set_configuration(struct usb_device *udev)
 		/*NOTE: ep_desc[0] actually represents EP1 and so on */
 		dir = (((endpt_desc->bEndpointAddress) & (0x80)) >> 7);
 		ep_type = (((endpt_desc->bmAttributes) & (0x3)) | (dir << 2));
+
+		ep_ctx[ep_index]->ep_info =
+			cpu_to_le32(EP_MAX_ESIT_PAYLOAD_HI(max_esit_payload) |
+			EP_INTERVAL(interval) | EP_MULT(mult));
+
 		ep_ctx[ep_index]->ep_info2 =
 			cpu_to_le32(ep_type << EP_TYPE_SHIFT);
 		ep_ctx[ep_index]->ep_info2 |=
@@ -386,6 +578,10 @@ static int xhci_set_configuration(struct usb_device *udev)
 				virt_dev->eps[ep_index].ring->enqueue;
 		ep_ctx[ep_index]->deq = cpu_to_le64(trb_64 |
 				virt_dev->eps[ep_index].ring->cycle_state);
+
+		ep_ctx[ep_index]->tx_info =
+			cpu_to_le32(EP_MAX_ESIT_PAYLOAD_LO(max_esit_payload) |
+			EP_AVG_TRB_LENGTH(avg_trb_len));
 	}
 
 	return xhci_configure_endpoints(udev, false);
drivers/usb/host/xhci.h +3 -2
index a497d9d..6deefbf 100644
@@ -663,8 +663,9 @@ struct xhci_ep_ctx {
 #define GET_MAX_PACKET(p)	((p) & 0x7ff)
 
 /* tx_info bitmasks */
-#define AVG_TRB_LENGTH_FOR_EP(p)	((p) & 0xffff)
-#define MAX_ESIT_PAYLOAD_FOR_EP(p)	(((p) & 0xffff) << 16)
+#define EP_AVG_TRB_LENGTH(p)		((p) & 0xffff)
+#define EP_MAX_ESIT_PAYLOAD_LO(p)	(((p) & 0xffff) << 16)
+#define EP_MAX_ESIT_PAYLOAD_HI(p)	((((p) >> 16) & 0xff) << 24)
 #define CTX_TO_MAX_ESIT_PAYLOAD(p)	(((p) >> 16) & 0xffff)
 
 /* deq bitmasks */
include/linux/usb/ch9.h +20 -0
index 0ad4782..264c971 100644
@@ -418,6 +418,12 @@ struct __packed usb_class_report_descriptor {
 #define USB_ENDPOINT_XFER_INT		3
 #define USB_ENDPOINT_MAX_ADJUSTABLE	0x80
 
+#define USB_ENDPOINT_MAXP_MASK		0x07ff
+#define USB_EP_MAXP_MULT_SHIFT		11
+#define USB_EP_MAXP_MULT_MASK		(3 << USB_EP_MAXP_MULT_SHIFT)
+#define USB_EP_MAXP_MULT(m)		\
+	(((m) & USB_EP_MAXP_MULT_MASK) >> USB_EP_MAXP_MULT_SHIFT)
+
 /* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */
 #define USB_ENDPOINT_INTRTYPE		0x30
 #define USB_ENDPOINT_INTR_PERIODIC	(0 << 4)
@@ -625,6 +631,20 @@ static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
 	return __le16_to_cpu(get_unaligned(&epd->wMaxPacketSize));
 }
 
+/**
+ * usb_endpoint_maxp_mult - get endpoint's transactional opportunities
+ * @epd: endpoint to be checked
+ *
+ * Return @epd's wMaxPacketSize[12:11] + 1
+ */
+static inline int
+usb_endpoint_maxp_mult(const struct usb_endpoint_descriptor *epd)
+{
+	int maxp = __le16_to_cpu(epd->wMaxPacketSize);
+
+	return USB_EP_MAXP_MULT(maxp) + 1;
+}
+
 static inline int usb_endpoint_interrupt_type(
 		const struct usb_endpoint_descriptor *epd)
 {
Signature · 1 line
2.9.2
author
#11 lore raw

PATCH v2 11/13 usb: xhci: Program max burst size for endpoint

In reply to Bin Meng

The 'Max Burst Size' indicates to the xHC the maximum number of consecutive USB transactions that should be executed per scheduling opportunity. This is a “zero-based” value, where 0 to 15 represents burst sizes of 1 to 16, but at present this is always set to zero. Let's program the required value according to real needs.

---

 drivers/usb/host/xhci.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/usb/host/xhci.c +20 -1
index 25bbb12..304f7ef 100644
@@ -396,6 +396,22 @@ static u32 xhci_get_endpoint_mult(struct usb_device *udev,
 	return ss_ep_comp_desc->bmAttributes;
 }
 
+static u32 xhci_get_endpoint_max_burst(struct usb_device *udev,
+	struct usb_endpoint_descriptor *endpt_desc,
+	struct usb_ss_ep_comp_descriptor *ss_ep_comp_desc)
+{
+	/* Super speed and Plus have max burst in ep companion desc */
+	if (udev->speed >= USB_SPEED_SUPER)
+		return ss_ep_comp_desc->bMaxBurst;
+
+	if (udev->speed == USB_SPEED_HIGH &&
+	    (usb_endpoint_xfer_isoc(endpt_desc) ||
+	     usb_endpoint_xfer_int(endpt_desc)))
+		return usb_endpoint_maxp_mult(endpt_desc) - 1;
+
+	return 0;
+}
+
 /*
  * Return the maximum endpoint service interval time (ESIT) payload.
  * Basically, this is the maxpacket size, multiplied by the burst size
@@ -494,6 +510,7 @@ static int xhci_set_configuration(struct usb_device *udev)
 	u32 max_esit_payload;
 	unsigned int interval;
 	unsigned int mult;
+	unsigned int max_burst;
 	unsigned int avg_trb_len;
 
 	out_ctx = virt_dev->out_ctx;
@@ -546,6 +563,8 @@ static int xhci_set_configuration(struct usb_device *udev)
 		interval = xhci_get_endpoint_interval(udev, endpt_desc);
 		mult = xhci_get_endpoint_mult(udev, endpt_desc,
 					      ss_ep_comp_desc);
+		max_burst = xhci_get_endpoint_max_burst(udev, endpt_desc,
+							ss_ep_comp_desc);
 		avg_trb_len = max_esit_payload;
 
 		ep_index = xhci_get_ep_index(endpt_desc);
@@ -571,7 +590,7 @@ static int xhci_set_configuration(struct usb_device *udev)
 			(get_unaligned(&endpt_desc->wMaxPacketSize)));
 
 		ep_ctx[ep_index]->ep_info2 |=
-			cpu_to_le32(((0 & MAX_BURST_MASK) << MAX_BURST_SHIFT) |
+			cpu_to_le32(MAX_BURST(max_burst)|
 			((3 & ERROR_COUNT_MASK) << ERROR_COUNT_SHIFT));
 
 		trb_64 = (uintptr_t)
Signature · 1 line
2.9.2
author
#12 lore raw

PATCH v2 12/13 usb: xhci: Set 'Error Count' to 0 for isoch endpoints

In reply to Bin Meng

Per xHCI spec, 'Error Count' should be set to 0 for isoch endpoints.

---

 drivers/usb/host/xhci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/usb/host/xhci.c +5 -1
index 304f7ef..c1ef025 100644
@@ -512,6 +512,7 @@ static int xhci_set_configuration(struct usb_device *udev)
 	unsigned int mult;
 	unsigned int max_burst;
 	unsigned int avg_trb_len;
+	unsigned int err_count = 0;
 
 	out_ctx = virt_dev->out_ctx;
 	in_ctx = virt_dev->in_ctx;
@@ -589,9 +590,12 @@ static int xhci_set_configuration(struct usb_device *udev)
 			cpu_to_le32(MAX_PACKET
 			(get_unaligned(&endpt_desc->wMaxPacketSize)));
 
+		/* Allow 3 retries for everything but isoc, set CErr = 3 */
+		if (!usb_endpoint_xfer_isoc(endpt_desc))
+			err_count = 3;
 		ep_ctx[ep_index]->ep_info2 |=
 			cpu_to_le32(MAX_BURST(max_burst)|
-			((3 & ERROR_COUNT_MASK) << ERROR_COUNT_SHIFT));
+			ERROR_COUNT(err_count));
 
 		trb_64 = (uintptr_t)
 				virt_dev->eps[ep_index].ring->enqueue;
Signature · 1 line
2.9.2
author
#13 lore raw

PATCH v2 13/13 usb: xhci: Set 'Average TRB Length' to 8 for control endpoints

In reply to Bin Meng

Update the codes to conform with xHCI spec 6.2.3.

---

 drivers/usb/host/xhci-mem.c | 6 ++++++
 drivers/usb/host/xhci.c     | 6 ++++++
 2 files changed, 12 insertions(+)
drivers/usb/host/xhci-mem.c +6 -0
index 3931149..8bdaac2 100644
@@ -838,6 +838,12 @@ void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl,
 	trb_64 = (uintptr_t)virt_dev->eps[0].ring->first_seg->trbs;
 	ep0_ctx->deq = cpu_to_le64(trb_64 | virt_dev->eps[0].ring->cycle_state);
 
+	/*
+	 * xHCI spec 6.2.3:
+	 * software shall set 'Average TRB Length' to 8 for control endpoints.
+	 */
+	ep0_ctx->tx_info = cpu_to_le32(EP_AVG_TRB_LENGTH(8));
+
 	/* Steps 7 and 8 were done in xhci_alloc_virt_device() */
 
 	xhci_flush_cache((uintptr_t)ep0_ctx, sizeof(struct xhci_ep_ctx));
drivers/usb/host/xhci.c +6 -0
index c1ef025..3972919 100644
@@ -602,6 +602,12 @@ static int xhci_set_configuration(struct usb_device *udev)
 		ep_ctx[ep_index]->deq = cpu_to_le64(trb_64 |
 				virt_dev->eps[ep_index].ring->cycle_state);
 
+		/*
+		 * xHCI spec 6.2.3:
+		 * 'Average TRB Length' should be 8 for control endpoints.
+		 */
+		if (usb_endpoint_xfer_control(endpt_desc))
+			avg_trb_len = 8;
 		ep_ctx[ep_index]->tx_info =
 			cpu_to_le32(EP_MAX_ESIT_PAYLOAD_LO(max_esit_payload) |
 			EP_AVG_TRB_LENGTH(avg_trb_len));
Signature · 1 line
2.9.2