Compare commits

...

1 Commits

Author SHA1 Message Date
Marvin 3e1e602910 Add boot delay and handshake retry logic
- Add 100ms delay before device initialization to allow USB power stabilization
- Implement retry logic (3 attempts) for initial handshake with 50ms between retries
- Warn on each failed handshake attempt

This addresses enumeration failures during system boot where the US-200
needs additional time to become ready after USB bus power-up.
2026-03-16 08:18:49 -03:00
1 changed files with 10 additions and 1 deletions

View File

@ -253,9 +253,18 @@ static int tascam_probe(struct usb_interface *intf, const struct usb_device_id *
goto free_card;
}
usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), VENDOR_REQ_MODE_CONTROL,
msleep(100);
for (int retry = 0; retry < 3; retry++) {
int handshake_result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), VENDOR_REQ_MODE_CONTROL,
RT_D2H_VENDOR_DEV, MODE_VAL_HANDSHAKE_READ, 0x0000,
tascam->scratch_buf, 1, USB_CTRL_TIMEOUT_MS);
if (handshake_result >= 0)
break;
dev_warn(&dev->dev, "Handshake failed (attempt %d/3), retrying...\n", retry + 1);
msleep(50);
}
usb_set_interface(dev, 0, 1);
usb_set_interface(dev, 1, 1);