From: Arseniy Lartsev <ars3n@yandex.ru>
To: linux-kernel@vger.kernel.org
Subject: PROBLEM: USB ACM device does not work
Date: Sun, 28 Jun 2009 22:29:26 +0400 [thread overview]
Message-ID: <200906282229.35713.ars3n@yandex.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 1497 bytes --]
I've got a piece of hardware (this one:
http://masterkit.ru/main/set.php?num=1153) which acts like an USB ACM
device and is handeled by the cdc_acm module. /dev/ttyACM0 does appear
but any attempt to write something to the device with a simple
"echo something >/dev/ttyACM0" fails with "Invalid argument" error.
The reason is that the driver calls usb_submit_urb in acm_start_wb()
but doesn't set interval in the urb structure, so it remains zero and
causes usb_submit_urb to return -EINVAL. Reading from device also does
not work due to the same problem in acm_rx_tasklet().
After setting urb interval to 128, this particular device works fine
for me (though I'm not sure that it's a right solution in general).
Corresponding patch (against 2.6.30) is:
--- linux-2.6.30.orig/drivers/usb/class/cdc-acm.c
+++ linux-2.6.30/drivers/usb/class/cdc-acm.c
@@ -182,6 +182,7 @@ static int acm_start_wb(struct acm *acm,
wb->urb->transfer_dma = wb->dmah;
wb->urb->transfer_buffer_length = wb->len;
wb->urb->dev = acm->dev;
+ wb->urb->interval = 128;
if ((rc = usb_submit_urb(wb->urb, GFP_ATOMIC)) < 0) {
dbg("usb_submit_urb(write bulk) failed: %d", rc);
@@ -453,6 +454,7 @@ urbs:
acm_read_bulk, rcv);
rcv->urb->transfer_dma = buf->dma;
rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+ rcv->urb->interval = 128;
/* This shouldn't kill the driver as unsuccessful URBs are returned to the
free-urbs-pool and resubmited ASAP */
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 315 bytes --]
next reply other threads:[~2009-06-28 19:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-28 18:29 Arseniy Lartsev [this message]
2009-06-28 20:20 ` PROBLEM: USB ACM device does not work Oliver Neukum
2009-06-28 20:37 ` Arseniy Lartsev
2009-06-28 20:58 ` Oliver Neukum
2009-06-29 11:43 ` Arseniy Lartsev
2009-06-29 13:07 ` Oliver Neukum
2009-06-29 13:35 ` Arseniy Lartsev
2009-06-30 7:22 ` Oliver Neukum
2009-06-30 20:09 ` Arseniy Lartsev
2009-06-30 21:01 ` Alan Stern
2009-07-01 9:01 ` Arseniy Lartsev
2009-07-01 10:56 ` Oliver Neukum
2009-07-01 11:24 ` Arseniy Lartsev
2009-07-01 11:37 ` Oliver Neukum
2009-07-01 12:27 ` [PATCH] cdc-acm: work around some broken devices Arseniy Lartsev
2009-07-01 13:56 ` Greg KH
2009-07-01 14:03 ` Oliver Neukum
2009-07-01 14:34 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200906282229.35713.ars3n@yandex.ru \
--to=ars3n@yandex.ru \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.