From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Alfred E. Heggestad" <aeh@db.org>
Cc: Oliver Neukum <oliver@neukum.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: driver for USB VoIP phones with CM109 chipset #2
Date: Tue, 5 Aug 2008 16:14:03 -0400 [thread overview]
Message-ID: <20080805201403.GA13557@anvil.corenet.prv> (raw)
In-Reply-To: <4898A8C2.2080307@db.org>
On Tue, Aug 05, 2008 at 09:23:46PM +0200, Alfred E. Heggestad wrote:
> Aug 5 21:11:13 io kernel: cm109: cm109_urb_ctl_callback: buzzer_pending=0, ctl_urb_pending=1
> Aug 5 21:11:13 io kernel: uhci_hcd 0000:00:1f.2: reserve dev 2 ep83-INT, period 32, phase 16, 14 us
>
Ok, so urb_irq is pending here...
> ;;;
> ;;; Press 'TAB' in shell to force Bell/Buzzer
> ;;;
>
> Aug 5 21:11:22 io kernel: cm109: cm109_toggle_buzzer_async: ctl_urb_pending=0 buzzer_pending=0
> Aug 5 21:11:22 io kernel: cm109: cm109_submit_buzz_toggle: buzzer_state=1
> Aug 5 21:11:22 io kernel: cm109: cm109_urb_ctl_callback: buzzer_pending=0, ctl_urb_pending=1
> Aug 5 21:11:22 io kernel: cm109: cm109_urb_ctl_callback: usb_submit_urb (urb_irq) failed -22 <--- note -EINVAL
And we trying to re-submit it.... How about the patch below?
Input: cm109 - fix issue with submitting urb_irq
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/misc/cm109.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index d1ef394..a97f038 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -106,10 +106,11 @@ struct cm109_dev {
dma_addr_t ctl_req_dma;
struct urb *urb_ctl;
/*
- * The 2 bitfields below are protected by ctl_submit_lock.
+ * The 3 bitfields below are protected by ctl_submit_lock.
* They have to be separate since they are accessed from IRQ
* context.
*/
+ unsigned irq_urb_pending:1; /* irq_urb is in flight */
unsigned ctl_urb_pending:1; /* ctl_urb is in flight */
unsigned buzzer_pending:1; /* need to issue buzz command */
spinlock_t ctl_submit_lock;
@@ -332,6 +333,8 @@ static void cm109_urb_irq_callback(struct urb *urb)
spin_lock(&dev->ctl_submit_lock);
+ dev->irq_urb_pending = 0;
+
if (likely(!dev->shutting_down)) {
if (dev->buzzer_state)
@@ -380,7 +383,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)
dev->buzzer_pending = 0;
dev->ctl_urb_pending = 1;
cm109_submit_buzz_toggle(dev);
- } else {
+ } else if (likely(!dev->irq_urb_pending)) {
/* ask for key data */
error = usb_submit_urb(dev->urb_irq, GFP_ATOMIC);
if (error)
--
Dmitry
next prev parent reply other threads:[~2008-08-05 20:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-27 12:24 [PATCH] input: driver for USB VoIP phones with CM109 chipset #2 Oliver Neukum
2008-06-28 15:03 ` Alfred E. Heggestad
2008-06-30 11:06 ` Oliver Neukum
2008-07-25 14:14 ` Dmitry Torokhov
2008-07-26 15:55 ` Alfred E. Heggestad
2008-07-26 18:45 ` Oliver Neukum
2008-08-03 22:04 ` Alfred E. Heggestad
2008-08-04 11:56 ` Oliver Neukum
2008-08-04 20:34 ` Alfred E. Heggestad
2008-08-04 22:08 ` Oliver Neukum
2008-08-05 19:23 ` Alfred E. Heggestad
2008-08-05 20:14 ` Dmitry Torokhov [this message]
2008-08-05 21:19 ` Alfred E. Heggestad
2008-08-18 17:47 ` Dmitry Torokhov
2008-07-29 5:47 ` Dmitry Torokhov
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=20080805201403.GA13557@anvil.corenet.prv \
--to=dmitry.torokhov@gmail.com \
--cc=aeh@db.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver@neukum.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).