diff mbox

[v1,26/49] input: cm109: prepare for enabling irq in complete()

Message ID 1376756714-25479-27-git-send-email-ming.lei@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ming Lei Aug. 17, 2013, 4:24 p.m. UTC
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(-)

Comments

Dmitry Torokhov Aug. 18, 2013, 3:37 a.m. UTC | #1
Hi Ming,

On Sun, Aug 18, 2013 at 12:24:51AM +0800, Ming Lei wrote:
> Complete() will be run with interrupt enabled, so change to
> spin_lock_irqsave().

I think cm109 needs some love in it's URB handling, but this patch does
not change anything, so:

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Or do you want me to pick it up for my tree?

Thanks.
Ming Lei Aug. 18, 2013, 2:10 p.m. UTC | #2
Hi Dmitry,

On Sun, Aug 18, 2013 at 11:37 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Ming,
>
> On Sun, Aug 18, 2013 at 12:24:51AM +0800, Ming Lei wrote:
>> Complete() will be run with interrupt enabled, so change to
>> spin_lock_irqsave().
>
> I think cm109 needs some love in it's URB handling, but this patch does
> not change anything, so:
>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Thank you.

>
> Or do you want me to pick it up for my tree?

IMO, it might be easier to merge these patches via one tree, so

Greg, would you like to manage all these patches via your tree?

If not, I have to push these patches on each subsystem, then you
need to pick it up for your input tree...


Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH Aug. 18, 2013, 6:05 p.m. UTC | #3
On Sun, Aug 18, 2013 at 10:10:15PM +0800, Ming Lei wrote:
> Hi Dmitry,
> 
> On Sun, Aug 18, 2013 at 11:37 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > Hi Ming,
> >
> > On Sun, Aug 18, 2013 at 12:24:51AM +0800, Ming Lei wrote:
> >> Complete() will be run with interrupt enabled, so change to
> >> spin_lock_irqsave().
> >
> > I think cm109 needs some love in it's URB handling, but this patch does
> > not change anything, so:
> >
> > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Thank you.
> 
> >
> > Or do you want me to pick it up for my tree?
> 
> IMO, it might be easier to merge these patches via one tree, so
> 
> Greg, would you like to manage all these patches via your tree?

Yes, I can take them all.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)