[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080805201403.GA13557@anvil.corenet.prv>
Date: Tue, 5 Aug 2008 16:14:03 -0400
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: "Alfred E. Heggestad" <aeh@...org>
Cc: Oliver Neukum <oliver@...kum.org>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] input: driver for USB VoIP phones with CM109 chipset #2
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@...l.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists