Skip to contentSkip to conversation

mmc: vub3000: fix control-request direction

PATCH In review Johan Hovold 2 participants 2 messages May 21, 2021 – May 24, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: vub3000: fix control-request direction

The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation.

Fix the SET_ROM_WAIT_STATES request which erroneously used usb_rcvctrlpipe().

Fixes 88095e7b473a ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver")
---
 drivers/mmc/host/vub300.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/vub300.c +1 -1
index 739cf63ef6e2..4950d10d3a19 100644
@@ -2279,7 +2279,7 @@ static int vub300_probe(struct usb_interface *interface,
 	if (retval < 0)
 		goto error5;
 	retval =
-		usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
+		usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
 				SET_ROM_WAIT_STATES,
 				USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 				firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
Signature · 1 line
2.26.3
#1 lore raw
Quoted 11 lines · Johan Hovold

The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation.

Fix the SET_ROM_WAIT_STATES request which erroneously used usb_rcvctrlpipe().

Fixes 88095e7b473a ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver")

Applied for next, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/host/vub300.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/vub300.c +1 -2
index 739cf63ef6e2..4950d10d3a19 100644
@@ -2279,7 +2279,7 @@ static int vub300_probe(struct usb_interface *interface,
        if (retval < 0)
                goto error5;
        retval =
-               usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
+               usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
                                SET_ROM_WAIT_STATES,
                                USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                                firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
--

2.26.3