All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, Oliver Neukum <oliver@neukum.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Ming Lei <ming.lei@canonical.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org
Subject: [PATCH v1 26/49] input: cm109: prepare for enabling irq in complete()
Date: Sun, 18 Aug 2013 00:24:51 +0800	[thread overview]
Message-ID: <1376756714-25479-27-git-send-email-ming.lei@canonical.com> (raw)
In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com>

Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 drivers/input/misc/cm109.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index 082684e..cac4e37 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -340,6 +340,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
 	struct cm109_dev *dev = urb->context;
 	const int status = urb->status;
 	int error;
+	unsigned long flags;
 
 	dev_dbg(&dev->intf->dev, "### URB IRQ: [0x%02x 0x%02x 0x%02x 0x%02x] keybit=0x%02x\n",
 	     dev->irq_data->byte[0],
@@ -379,7 +380,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
 
  out:
 
-	spin_lock(&dev->ctl_submit_lock);
+	spin_lock_irqsave(&dev->ctl_submit_lock, flags);
 
 	dev->irq_urb_pending = 0;
 
@@ -403,7 +404,7 @@ static void cm109_urb_irq_callback(struct urb *urb)
 				__func__, error);
 	}
 
-	spin_unlock(&dev->ctl_submit_lock);
+	spin_unlock_irqrestore(&dev->ctl_submit_lock, flags);
 }
 
 static void cm109_urb_ctl_callback(struct urb *urb)
@@ -411,6 +412,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)
 	struct cm109_dev *dev = urb->context;
 	const int status = urb->status;
 	int error;
+	unsigned long flags;
 
 	dev_dbg(&dev->intf->dev, "### URB CTL: [0x%02x 0x%02x 0x%02x 0x%02x]\n",
 	     dev->ctl_data->byte[0],
@@ -421,7 +423,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)
 	if (status)
 		dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
 
-	spin_lock(&dev->ctl_submit_lock);
+	spin_lock_irqsave(&dev->ctl_submit_lock, flags);
 
 	dev->ctl_urb_pending = 0;
 
@@ -442,7 +444,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)
 		}
 	}
 
-	spin_unlock(&dev->ctl_submit_lock);
+	spin_unlock_irqrestore(&dev->ctl_submit_lock, flags);
 }
 
 static void cm109_toggle_buzzer_async(struct cm109_dev *dev)
-- 
1.7.9.5


  parent reply	other threads:[~2013-08-17 16:29 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-17 16:24 [PATCH v1 00/49] USB: prepare for enabling irq in complete() Ming Lei
2013-08-17 16:24 ` [PATCH v1 23/49] hid: usbhid: " Ming Lei
2013-08-22 12:19   ` Ming Lei
2013-08-26 11:44   ` Jiri Kosina
2013-08-17 16:24 ` Ming Lei [this message]
2013-08-18  3:37   ` [PATCH v1 26/49] input: cm109: " Dmitry Torokhov
2013-08-18 14:10     ` Ming Lei
2013-08-18 18:05       ` Greg Kroah-Hartman
2013-08-17 16:24 ` [PATCH v1 27/49] ISDN: hfcsusb: " Ming Lei
2013-08-17 16:24 ` [PATCH v1 28/49] USBNET: cdc-phonet: " Ming Lei
2013-08-17 16:24 ` [PATCH v1 32/49] wireless: ath9k: " Ming Lei
2013-08-17 16:24   ` Ming Lei
2013-08-17 16:24 ` [PATCH v1 33/49] wireless: zd1211rw: " Ming Lei
2013-08-17 16:24 ` [PATCH v1 34/49] wireless: ath: carl9170: " Ming Lei
2013-08-17 16:25 ` [PATCH v1 35/49] wireless: libertas: " Ming Lei
2013-08-17 16:25   ` Ming Lei
2013-08-17 16:25 ` [PATCH v1 36/49] wireless: libertas_tf: " Ming Lei
2013-08-17 16:25 ` [PATCH v1 37/49] media: usb: cx231xx: " Ming Lei
2013-08-22 11:33   ` Hans Verkuil
2013-08-17 16:25 ` [PATCH v1 38/49] media: usb: em28xx: " Ming Lei
2013-08-22 12:24   ` Hans Verkuil
2013-08-17 16:25 ` [PATCH v1 39/49] media: usb: sn9x102: " Ming Lei
2013-08-22 12:24   ` Hans Verkuil
2013-08-17 16:25 ` [PATCH v1 40/49] media: usb: tlg2300: " Ming Lei
2013-08-22 12:24   ` Hans Verkuil
2013-08-17 16:25 ` [PATCH v1 41/49] media: usb: tm6000: " Ming Lei
2013-08-22 12:24   ` Hans Verkuil
2013-08-17 16:25 ` [PATCH v1 42/49] media: dvb-core: " Ming Lei
2013-08-22 12:32   ` Hans Verkuil
2013-08-17 16:25 ` [PATCH v1 43/49] media: usb: em28xx: " Ming Lei
2013-08-22 12:24   ` Hans Verkuil
     [not found] ` <1376756714-25479-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-08-17 16:24   ` [PATCH v1 29/49] USBNET: hso: " Ming Lei
2013-08-17 16:24   ` [PATCH v1 30/49] USBNET: kaweth: " Ming Lei
2013-08-17 16:24   ` [PATCH v1 31/49] USBNET: rtl8150: " Ming Lei
2013-08-17 16:25   ` [PATCH v1 44/49] sound: usb: midi: " Ming Lei
     [not found]     ` <1376756714-25479-45-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-08-19 13:47       ` Takashi Iwai
2013-08-17 16:25   ` [PATCH v1 45/49] sound: usb: caiaq: " Ming Lei
     [not found]     ` <1376756714-25479-46-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-08-19 13:48       ` Takashi Iwai
     [not found] ` <1376756714-25479-25-git-send-email-ming.lei@canonical.com>
2013-08-22 12:23   ` [PATCH v1 24/49] BT: btusb: " Ming Lei

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=1376756714-25479-27-git-send-email-ming.lei@canonical.com \
    --to=ming.lei@canonical.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=stern@rowland.harvard.edu \
    /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.