Skip to content

Commit 8c81719

Browse files
jhovoldstorulf
authored andcommitted
mmc: vub300: fix control-message timeouts
USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 88095e7 ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver") Cc: [email protected] # 3.0 Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 697542b commit 8c81719

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/mmc/host/vub300.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ static void check_vub300_port_status(struct vub300_mmc_host *vub300)
576576
GET_SYSTEM_PORT_STATUS,
577577
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
578578
0x0000, 0x0000, &vub300->system_port_status,
579-
sizeof(vub300->system_port_status), HZ);
579+
sizeof(vub300->system_port_status), 1000);
580580
if (sizeof(vub300->system_port_status) == retval)
581581
new_system_port_status(vub300);
582582
}
@@ -1241,7 +1241,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
12411241
SET_INTERRUPT_PSEUDOCODE,
12421242
USB_DIR_OUT | USB_TYPE_VENDOR |
12431243
USB_RECIP_DEVICE, 0x0000, 0x0000,
1244-
xfer_buffer, xfer_length, HZ);
1244+
xfer_buffer, xfer_length, 1000);
12451245
kfree(xfer_buffer);
12461246
if (retval < 0)
12471247
goto copy_error_message;
@@ -1284,7 +1284,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
12841284
SET_TRANSFER_PSEUDOCODE,
12851285
USB_DIR_OUT | USB_TYPE_VENDOR |
12861286
USB_RECIP_DEVICE, 0x0000, 0x0000,
1287-
xfer_buffer, xfer_length, HZ);
1287+
xfer_buffer, xfer_length, 1000);
12881288
kfree(xfer_buffer);
12891289
if (retval < 0)
12901290
goto copy_error_message;
@@ -1991,7 +1991,7 @@ static void __set_clock_speed(struct vub300_mmc_host *vub300, u8 buf[8],
19911991
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
19921992
SET_CLOCK_SPEED,
19931993
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1994-
0x00, 0x00, buf, buf_array_size, HZ);
1994+
0x00, 0x00, buf, buf_array_size, 1000);
19951995
if (retval != 8) {
19961996
dev_err(&vub300->udev->dev, "SET_CLOCK_SPEED"
19971997
" %dkHz failed with retval=%d\n", kHzClock, retval);
@@ -2013,14 +2013,14 @@ static void vub300_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
20132013
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
20142014
SET_SD_POWER,
20152015
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2016-
0x0000, 0x0000, NULL, 0, HZ);
2016+
0x0000, 0x0000, NULL, 0, 1000);
20172017
/* must wait for the VUB300 u-proc to boot up */
20182018
msleep(600);
20192019
} else if ((ios->power_mode == MMC_POWER_UP) && !vub300->card_powered) {
20202020
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
20212021
SET_SD_POWER,
20222022
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2023-
0x0001, 0x0000, NULL, 0, HZ);
2023+
0x0001, 0x0000, NULL, 0, 1000);
20242024
msleep(600);
20252025
vub300->card_powered = 1;
20262026
} else if (ios->power_mode == MMC_POWER_ON) {
@@ -2275,14 +2275,14 @@ static int vub300_probe(struct usb_interface *interface,
22752275
GET_HC_INF0,
22762276
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
22772277
0x0000, 0x0000, &vub300->hc_info,
2278-
sizeof(vub300->hc_info), HZ);
2278+
sizeof(vub300->hc_info), 1000);
22792279
if (retval < 0)
22802280
goto error5;
22812281
retval =
22822282
usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
22832283
SET_ROM_WAIT_STATES,
22842284
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2285-
firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
2285+
firmware_rom_wait_states, 0x0000, NULL, 0, 1000);
22862286
if (retval < 0)
22872287
goto error5;
22882288
dev_info(&vub300->udev->dev,
@@ -2297,7 +2297,7 @@ static int vub300_probe(struct usb_interface *interface,
22972297
GET_SYSTEM_PORT_STATUS,
22982298
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
22992299
0x0000, 0x0000, &vub300->system_port_status,
2300-
sizeof(vub300->system_port_status), HZ);
2300+
sizeof(vub300->system_port_status), 1000);
23012301
if (retval < 0) {
23022302
goto error4;
23032303
} else if (sizeof(vub300->system_port_status) == retval) {

0 commit comments

Comments
 (0)