linux/drivers/usb
Hans de Goede 5571ea3117 usb: typec: tcpm: Fix VDMs sometimes not being forwarded to alt-mode drivers
Commit a20dcf53ea ("usb: typec: tcpm: Respond Not_Supported if no
snk_vdo"), stops tcpm_pd_data_request() calling tcpm_handle_vdm_request()
when port->nr_snk_vdo is not set. But the VDM might be intended for an
altmode-driver, in which case nr_snk_vdo does not matter.

This change breaks the forwarding of connector hotplug (HPD) events
for displayport altmode on devices which don't set nr_snk_vdo.

tcpm_pd_data_request() is the only caller of tcpm_handle_vdm_request(),
so we can move the nr_snk_vdo check to inside it, at which point we
have already looked up the altmode device so we can check for this too.

Doing this check here also ensures that vdm_state gets set to
VDM_STATE_DONE if it was VDM_STATE_BUSY, even if we end up with
responding with PD_MSG_CTRL_NOT_SUPP later.

Note that tcpm_handle_vdm_request() was already sending
PD_MSG_CTRL_NOT_SUPP in some circumstances, after moving the nr_snk_vdo
check the same error-path is now taken when that check fails. So that
we have only one error-path for this and not two. Replace the
tcpm_queue_message(PD_MSG_CTRL_NOT_SUPP) used by the existing error-path
with the more robust tcpm_pd_handle_msg() from the (now removed) second
error-path.

Fixes: a20dcf53ea ("usb: typec: tcpm: Respond Not_Supported if no snk_vdo")
Cc: stable <stable@vger.kernel.org>
Cc: Kyle Tso <kyletso@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Kyle Tso <kyletso@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210816154632.381968-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-18 15:59:23 +02:00
..
atm usb: atm: cxacru: Fix typo in comment 2021-05-21 20:05:40 +02:00
c67x00 usb/c67x00: Replace tasklet with work 2021-01-26 18:36:37 +01:00
cdns3 usb: cdnsp: Fix the IMAN_IE_SET and IMAN_IE_CLEAR macro 2021-07-29 14:28:15 +08:00
chipidea Linux 5.13-rc7 2021-06-21 10:56:05 +02:00
class USB: usbtmc: Fix RCU stall warning 2021-07-27 15:52:37 +02:00
common usb: otg-fsm: Fix hrtimer list corruption 2021-07-27 16:31:31 +02:00
core Revert "USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem" 2021-07-21 11:36:34 +02:00
dwc2 usb: dwc2: gadget: Fix sending zero length packet in DDMA mode. 2021-07-21 09:50:55 +02:00
dwc3 Revert "usb: dwc3: gadget: Use list_replace_init() before traversing lists" 2021-08-10 09:12:32 +02:00
early
gadget usb: gadget: f_hid: idle uses the highest byte for duration 2021-07-28 08:24:39 +02:00
host usb: host: ohci-at91: suspend/resume ports after/before OHCI accesses 2021-07-27 16:31:17 +02:00
image
isp1760 usb: isp1760: Fix meaningless check in isp1763_run() 2021-06-15 15:40:58 +02:00
misc usb: ftdi-elan: remove redundant continue statement in a while-loop 2021-06-24 14:12:09 +02:00
mon
mtu3 usb: mtu3: use clock bulk to get clocks 2021-06-15 15:46:45 +02:00
musb usb: musb: Fix suspend and resume issues for PHYs on I2C and SPI 2021-07-27 16:31:02 +02:00
phy usb: phy: Fix page fault from usb_phy_uevent 2021-07-21 09:48:36 +02:00
renesas_usbhs usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() 2021-07-21 09:50:00 +02:00
roles usb: roles: add helper usb_role_string() 2021-05-27 09:17:18 +02:00
serial USB: serial: ftdi_sio: add device ID for Auto-M3 OP-COM v2 2021-08-05 09:47:25 +02:00
storage USB: usb-storage: Add LaCie Rugged USB3-FW to IGNORE_UAS 2021-07-21 09:15:45 +02:00
typec usb: typec: tcpm: Fix VDMs sometimes not being forwarded to alt-mode drivers 2021-08-18 15:59:23 +02:00
usbip Scheduler updates for this cycle are: 2021-04-28 13:33:57 -07:00
Kconfig
Makefile usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver 2020-12-29 12:36:13 +08:00
usb-skeleton.c