Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt driver fixes from Greg KH:
"Here are some small USB and Thunderbolt driver fixes for reported
problems. Included in here are:

- thunderbolt driver memory leak fix

- thunderbolt display flicker fix

- usb dwc3 driver fix

- usb gadget uvc disconnect crash fix

- usb typec Kconfig build dependency fix

- usb typec small fixes

- usb-con-gpio bugfix

- usb-storage old driver bugfix

All of these have been in linux-next for a while with no reported
issues"

* tag 'usb-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request()
usb: dwc3: Properly handle processing of pending events
usb-storage: alauda: Fix uninit-value in alauda_check_media()
usb: common: usb-conn-gpio: Prevent bailing out if initial role is none
USB: Gadget: core: Help prevent panic during UVC unconfigure
usb: typec: mux: intel: Add dependency on USB_COMMON
usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe()
usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment
usb: typec: tcpm: Fix response to vsafe0V event
thunderbolt: Fix Thunderbolt 3 display flickering issue on 2nd hot plug onwards

+79 -14
+2
drivers/thunderbolt/tb.c
··· 1964 1964 1965 1965 pm_runtime_mark_last_busy(&tb->dev); 1966 1966 pm_runtime_put_autosuspend(&tb->dev); 1967 + 1968 + kfree(ev); 1967 1969 } 1968 1970 1969 1971 static void tb_queue_dp_bandwidth_request(struct tb *tb, u64 route, u8 port)
+3 -1
drivers/thunderbolt/tmu.c
··· 579 579 * uni-directional mode and we don't want to change it's TMU 580 580 * mode. 581 581 */ 582 - tb_switch_tmu_rate_write(sw, tmu_rates[TB_SWITCH_TMU_MODE_OFF]); 582 + ret = tb_switch_tmu_rate_write(sw, tmu_rates[TB_SWITCH_TMU_MODE_OFF]); 583 + if (ret) 584 + return ret; 583 585 584 586 tb_port_tmu_time_sync_disable(up); 585 587 ret = tb_port_tmu_time_sync_disable(down);
+5 -1
drivers/usb/common/usb-conn-gpio.c
··· 42 42 43 43 struct power_supply_desc desc; 44 44 struct power_supply *charger; 45 + bool initial_detection; 45 46 }; 46 47 47 48 /* ··· 87 86 dev_dbg(info->dev, "role %s -> %s, gpios: id %d, vbus %d\n", 88 87 usb_role_string(info->last_role), usb_role_string(role), id, vbus); 89 88 90 - if (info->last_role == role) { 89 + if (!info->initial_detection && info->last_role == role) { 91 90 dev_warn(info->dev, "repeated role: %s\n", usb_role_string(role)); 92 91 return; 93 92 } 93 + 94 + info->initial_detection = false; 94 95 95 96 if (info->last_role == USB_ROLE_HOST && info->vbus) 96 97 regulator_disable(info->vbus); ··· 261 258 device_set_wakeup_capable(&pdev->dev, true); 262 259 263 260 /* Perform initial detection */ 261 + info->initial_detection = true; 264 262 usb_conn_queue_dwork(info, 0); 265 263 266 264 return 0;
+8 -1
drivers/usb/dwc3/gadget.c
··· 4455 4455 u32 count; 4456 4456 4457 4457 if (pm_runtime_suspended(dwc->dev)) { 4458 + dwc->pending_events = true; 4459 + /* 4460 + * Trigger runtime resume. The get() function will be balanced 4461 + * after processing the pending events in dwc3_process_pending 4462 + * events(). 4463 + */ 4458 4464 pm_runtime_get(dwc->dev); 4459 4465 disable_irq_nosync(dwc->irq_gadget); 4460 - dwc->pending_events = true; 4461 4466 return IRQ_HANDLED; 4462 4467 } 4463 4468 ··· 4723 4718 { 4724 4719 if (dwc->pending_events) { 4725 4720 dwc3_interrupt(dwc->irq_gadget, dwc->ev_buf); 4721 + dwc3_thread_interrupt(dwc->irq_gadget, dwc->ev_buf); 4722 + pm_runtime_put(dwc->dev); 4726 4723 dwc->pending_events = false; 4727 4724 enable_irq(dwc->irq_gadget); 4728 4725 }
+9
drivers/usb/gadget/udc/core.c
··· 822 822 * usb_gadget_activate() is called. For example, user mode components may 823 823 * need to be activated before the system can talk to hosts. 824 824 * 825 + * This routine may sleep; it must not be called in interrupt context 826 + * (such as from within a gadget driver's disconnect() callback). 827 + * 825 828 * Returns zero on success, else negative errno. 826 829 */ 827 830 int usb_gadget_deactivate(struct usb_gadget *gadget) ··· 862 859 * 863 860 * This routine activates gadget which was previously deactivated with 864 861 * usb_gadget_deactivate() call. It calls usb_gadget_connect() if needed. 862 + * 863 + * This routine may sleep; it must not be called in interrupt context. 865 864 * 866 865 * Returns zero on success, else negative errno. 867 866 */ ··· 1643 1638 usb_gadget_disable_async_callbacks(udc); 1644 1639 if (gadget->irq) 1645 1640 synchronize_irq(gadget->irq); 1641 + mutex_unlock(&udc->connect_lock); 1642 + 1646 1643 udc->driver->unbind(gadget); 1644 + 1645 + mutex_lock(&udc->connect_lock); 1647 1646 usb_gadget_udc_stop_locked(udc); 1648 1647 mutex_unlock(&udc->connect_lock); 1649 1648
+9 -3
drivers/usb/storage/alauda.c
··· 318 318 rc = usb_stor_ctrl_transfer(us, us->recv_ctrl_pipe, 319 319 command, 0xc0, 0, 1, data, 2); 320 320 321 - usb_stor_dbg(us, "Media status %02X %02X\n", data[0], data[1]); 321 + if (rc == USB_STOR_XFER_GOOD) 322 + usb_stor_dbg(us, "Media status %02X %02X\n", data[0], data[1]); 322 323 323 324 return rc; 324 325 } ··· 455 454 static int alauda_check_media(struct us_data *us) 456 455 { 457 456 struct alauda_info *info = (struct alauda_info *) us->extra; 458 - unsigned char status[2]; 457 + unsigned char *status = us->iobuf; 458 + int rc; 459 459 460 - alauda_get_media_status(us, status); 460 + rc = alauda_get_media_status(us, status); 461 + if (rc != USB_STOR_XFER_GOOD) { 462 + status[0] = 0xF0; /* Pretend there's no media */ 463 + status[1] = 0; 464 + } 461 465 462 466 /* Check for no media or door open */ 463 467 if ((status[0] & 0x80) || ((status[0] & 0x1F) == 0x10)
+17 -1
drivers/usb/typec/altmodes/displayport.c
··· 60 60 61 61 enum dp_state state; 62 62 bool hpd; 63 + bool pending_hpd; 63 64 64 65 struct mutex lock; /* device lock */ 65 66 struct work_struct work; ··· 145 144 dp->state = DP_STATE_EXIT; 146 145 } else if (!(con & DP_CONF_CURRENTLY(dp->data.conf))) { 147 146 ret = dp_altmode_configure(dp, con); 148 - if (!ret) 147 + if (!ret) { 149 148 dp->state = DP_STATE_CONFIGURE; 149 + if (dp->hpd != hpd) { 150 + dp->hpd = hpd; 151 + dp->pending_hpd = true; 152 + } 153 + } 150 154 } else { 151 155 if (dp->hpd != hpd) { 152 156 drm_connector_oob_hotplug_event(dp->connector_fwnode); ··· 167 161 { 168 162 sysfs_notify(&dp->alt->dev.kobj, "displayport", "configuration"); 169 163 sysfs_notify(&dp->alt->dev.kobj, "displayport", "pin_assignment"); 164 + /* 165 + * If the DFP_D/UFP_D sends a change in HPD when first notifying the 166 + * DisplayPort driver that it is connected, then we wait until 167 + * configuration is complete to signal HPD. 168 + */ 169 + if (dp->pending_hpd) { 170 + drm_connector_oob_hotplug_event(dp->connector_fwnode); 171 + sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd"); 172 + dp->pending_hpd = false; 173 + } 170 174 171 175 return dp_altmode_notify(dp); 172 176 }
+1
drivers/usb/typec/mux/Kconfig
··· 29 29 tristate "Intel PMC mux control" 30 30 depends on ACPI 31 31 depends on INTEL_SCU_IPC 32 + select USB_COMMON 32 33 select USB_ROLE_SWITCH 33 34 help 34 35 Driver for USB muxes controlled by Intel PMC FW. Intel PMC FW can
+18 -7
drivers/usb/typec/mux/nb7vpq904m.c
··· 463 463 464 464 ret = nb7vpq904m_register_bridge(nb7); 465 465 if (ret) 466 - return ret; 466 + goto err_disable_gpio; 467 467 468 468 sw_desc.drvdata = nb7; 469 469 sw_desc.fwnode = dev->fwnode; 470 470 sw_desc.set = nb7vpq904m_sw_set; 471 471 472 472 nb7->sw = typec_switch_register(dev, &sw_desc); 473 - if (IS_ERR(nb7->sw)) 474 - return dev_err_probe(dev, PTR_ERR(nb7->sw), 475 - "Error registering typec switch\n"); 473 + if (IS_ERR(nb7->sw)) { 474 + ret = dev_err_probe(dev, PTR_ERR(nb7->sw), 475 + "Error registering typec switch\n"); 476 + goto err_disable_gpio; 477 + } 476 478 477 479 retimer_desc.drvdata = nb7; 478 480 retimer_desc.fwnode = dev->fwnode; ··· 482 480 483 481 nb7->retimer = typec_retimer_register(dev, &retimer_desc); 484 482 if (IS_ERR(nb7->retimer)) { 485 - typec_switch_unregister(nb7->sw); 486 - return dev_err_probe(dev, PTR_ERR(nb7->retimer), 487 - "Error registering typec retimer\n"); 483 + ret = dev_err_probe(dev, PTR_ERR(nb7->retimer), 484 + "Error registering typec retimer\n"); 485 + goto err_switch_unregister; 488 486 } 489 487 490 488 return 0; 489 + 490 + err_switch_unregister: 491 + typec_switch_unregister(nb7->sw); 492 + 493 + err_disable_gpio: 494 + gpiod_set_value(nb7->enable_gpio, 0); 495 + regulator_disable(nb7->vcc_supply); 496 + 497 + return ret; 491 498 } 492 499 493 500 static void nb7vpq904m_remove(struct i2c_client *client)
+7
drivers/usb/typec/tcpm/tcpm.c
··· 5349 5349 /* Do nothing, vbus drop expected */ 5350 5350 break; 5351 5351 5352 + case SNK_HARD_RESET_WAIT_VBUS: 5353 + /* Do nothing, its OK to receive vbus off events */ 5354 + break; 5355 + 5352 5356 default: 5353 5357 if (port->pwr_role == TYPEC_SINK && port->attached) 5354 5358 tcpm_set_state(port, SNK_UNATTACHED, tcpm_wait_for_discharge(port)); ··· 5398 5394 case SNK_ATTACH_WAIT: 5399 5395 case SNK_DEBOUNCED: 5400 5396 /*Do nothing, still waiting for VSAFE5V for connect */ 5397 + break; 5398 + case SNK_HARD_RESET_WAIT_VBUS: 5399 + /* Do nothing, its OK to receive vbus off events */ 5401 5400 break; 5402 5401 default: 5403 5402 if (port->pwr_role == TYPEC_SINK && port->auto_vbus_discharge_enabled)