mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
mmc: vub300: fix control-message timeouts
commit 8c8171929116cc23f74743d99251eedadf62341a upstream. USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 88095e7b473a ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver") Cc: stable@vger.kernel.org # 3.0 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20211025115608.5287-1-johan@kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b31aa41bf1
commit
0d76129cc8
@ -579,7 +579,7 @@ static void check_vub300_port_status(struct vub300_mmc_host *vub300)
|
||||
GET_SYSTEM_PORT_STATUS,
|
||||
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0x0000, 0x0000, &vub300->system_port_status,
|
||||
sizeof(vub300->system_port_status), HZ);
|
||||
sizeof(vub300->system_port_status), 1000);
|
||||
if (sizeof(vub300->system_port_status) == retval)
|
||||
new_system_port_status(vub300);
|
||||
}
|
||||
@ -1242,7 +1242,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
|
||||
SET_INTERRUPT_PSEUDOCODE,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR |
|
||||
USB_RECIP_DEVICE, 0x0000, 0x0000,
|
||||
xfer_buffer, xfer_length, HZ);
|
||||
xfer_buffer, xfer_length, 1000);
|
||||
kfree(xfer_buffer);
|
||||
if (retval < 0) {
|
||||
strncpy(vub300->vub_name,
|
||||
@ -1289,7 +1289,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
|
||||
SET_TRANSFER_PSEUDOCODE,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR |
|
||||
USB_RECIP_DEVICE, 0x0000, 0x0000,
|
||||
xfer_buffer, xfer_length, HZ);
|
||||
xfer_buffer, xfer_length, 1000);
|
||||
kfree(xfer_buffer);
|
||||
if (retval < 0) {
|
||||
strncpy(vub300->vub_name,
|
||||
@ -1994,7 +1994,7 @@ static void __set_clock_speed(struct vub300_mmc_host *vub300, u8 buf[8],
|
||||
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
|
||||
SET_CLOCK_SPEED,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0x00, 0x00, buf, buf_array_size, HZ);
|
||||
0x00, 0x00, buf, buf_array_size, 1000);
|
||||
if (retval != 8) {
|
||||
dev_err(&vub300->udev->dev, "SET_CLOCK_SPEED"
|
||||
" %dkHz failed with retval=%d\n", kHzClock, retval);
|
||||
@ -2016,14 +2016,14 @@ static void vub300_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
||||
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
|
||||
SET_SD_POWER,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0x0000, 0x0000, NULL, 0, HZ);
|
||||
0x0000, 0x0000, NULL, 0, 1000);
|
||||
/* must wait for the VUB300 u-proc to boot up */
|
||||
msleep(600);
|
||||
} else if ((ios->power_mode == MMC_POWER_UP) && !vub300->card_powered) {
|
||||
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
|
||||
SET_SD_POWER,
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0x0001, 0x0000, NULL, 0, HZ);
|
||||
0x0001, 0x0000, NULL, 0, 1000);
|
||||
msleep(600);
|
||||
vub300->card_powered = 1;
|
||||
} else if (ios->power_mode == MMC_POWER_ON) {
|
||||
@ -2285,14 +2285,14 @@ static int vub300_probe(struct usb_interface *interface,
|
||||
GET_HC_INF0,
|
||||
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0x0000, 0x0000, &vub300->hc_info,
|
||||
sizeof(vub300->hc_info), HZ);
|
||||
sizeof(vub300->hc_info), 1000);
|
||||
if (retval < 0)
|
||||
goto error5;
|
||||
retval =
|
||||
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);
|
||||
firmware_rom_wait_states, 0x0000, NULL, 0, 1000);
|
||||
if (retval < 0)
|
||||
goto error5;
|
||||
dev_info(&vub300->udev->dev,
|
||||
@ -2307,7 +2307,7 @@ static int vub300_probe(struct usb_interface *interface,
|
||||
GET_SYSTEM_PORT_STATUS,
|
||||
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||
0x0000, 0x0000, &vub300->system_port_status,
|
||||
sizeof(vub300->system_port_status), HZ);
|
||||
sizeof(vub300->system_port_status), 1000);
|
||||
if (retval < 0) {
|
||||
goto error4;
|
||||
} else if (sizeof(vub300->system_port_status) == retval) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user