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

2013-08-18 Thread Ming Lei
Hi Dmitry,

On Sun, Aug 18, 2013 at 11:37 AM, Dmitry Torokhov
dmitry.torok...@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.torok...@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-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2013-08-18 Thread Greg Kroah-Hartman
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.torok...@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.torok...@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-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2013-08-17 Thread Ming Lei
Complete() will be run with interrupt enabled, so change to
spin_lock_irqsave().

Cc: Dmitry Torokhov dmitry.torok...@gmail.com
Cc: linux-in...@vger.kernel.org
Signed-off-by: Ming Lei ming@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

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2013-08-17 Thread Dmitry Torokhov
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.torok...@gmail.com

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

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html