public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: twl4030-irq: irq_desc->lock converted to raw_spinlock_t
@ 2009-12-16 18:18 Felipe Balbi
  2009-12-16 18:20 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2009-12-16 18:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tony Lindgren, Samuel Ortiz, Santosh Shilimkar, Balaji T K,
	Rajendra Nayak, Felipe Balbi, Thomas Gleixner, linux-omap

commit 239007b8440abff689632f50cdf0f2b9e895b534 converted
the spinlock_t to raw_spinlock_t. Unfortunately twl4030-irq
was left aside on the conversion.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Lindgre <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---

I'm not sure this is the expected fix since twl4030-irq handler
should be running in thread context. Currently mask/unmask/set_type
are deferred to a workqueue. Thomas, should this be done ? How
do you expect irq chips on slow busses to implement mask/unmask/set_type ?

 drivers/mfd/twl4030-irq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index 20d29ba..9df9a5a 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -568,12 +568,12 @@ static void twl4030_sih_do_edge(struct work_struct *work)
 
 		bytes[byte] &= ~(0x03 << off);
 
-		spin_lock_irq(&d->lock);
+		raw_spin_lock_irq(&d->lock);
 		if (d->status & IRQ_TYPE_EDGE_RISING)
 			bytes[byte] |= BIT(off + 1);
 		if (d->status & IRQ_TYPE_EDGE_FALLING)
 			bytes[byte] |= BIT(off + 0);
-		spin_unlock_irq(&d->lock);
+		raw_spin_unlock_irq(&d->lock);
 
 		edge_change &= ~BIT(i);
 	}
-- 
1.6.6.rc0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: twl4030-irq: irq_desc->lock converted to raw_spinlock_t
  2009-12-16 18:18 [PATCH] mfd: twl4030-irq: irq_desc->lock converted to raw_spinlock_t Felipe Balbi
@ 2009-12-16 18:20 ` Felipe Balbi
  2009-12-17  0:04   ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2009-12-16 18:20 UTC (permalink / raw)
  To: Balbi Felipe (Nokia-D/Helsinki)
  Cc: linux-kernel@vger.kernel.org, Tony Lindgren, Samuel Ortiz,
	Santosh Shilimkar, Balaji T K, Rajendra Nayak, Thomas Gleixner,
	linux-omap@vger.kernel.org

On Wed, Dec 16, 2009 at 07:18:50PM +0100, Balbi Felipe (Nokia-D/Helsinki) wrote:
>commit 239007b8440abff689632f50cdf0f2b9e895b534 converted
>the spinlock_t to raw_spinlock_t. Unfortunately twl4030-irq
>was left aside on the conversion.
>
>Cc: Thomas Gleixner <tglx@linutronix.de>
>Cc: Tony Lindgre <tony@atomide.com>

oops, my n is failing.

Tony Lindgren, below is better version:

========== cut here =================

 From 17edd64d8e813713da6fb9fa018ab5f79d94d159 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Wed, 16 Dec 2009 20:11:22 +0200
Subject: [PATCH] mfd: twl4030-irq: irq_desc->lock converted to raw_spinlock_t

commit 239007b8440abff689632f50cdf0f2b9e895b534 converted
the spinlock_t to raw_spinlock_t. Unfortunately twl4030-irq
was left aside on the conversion.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
---

I'm not sure this is the expected fix since twl4030-irq handler
should be running in thread context. Currently mask/unmask/set_type
are deferred to a workqueue. Thomas, should this be done ? How
do you expect irq chips on slow busses to implement mask/unmask/set_type ?

  drivers/mfd/twl4030-irq.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index 20d29ba..9df9a5a 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -568,12 +568,12 @@ static void twl4030_sih_do_edge(struct work_struct *work)
  
  		bytes[byte] &= ~(0x03 << off);
  
-		spin_lock_irq(&d->lock);
+		raw_spin_lock_irq(&d->lock);
  		if (d->status & IRQ_TYPE_EDGE_RISING)
  			bytes[byte] |= BIT(off + 1);
  		if (d->status & IRQ_TYPE_EDGE_FALLING)
  			bytes[byte] |= BIT(off + 0);
-		spin_unlock_irq(&d->lock);
+		raw_spin_unlock_irq(&d->lock);
  
  		edge_change &= ~BIT(i);
  	}
-- 
1.6.6.rc0


-- 
balbi

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: twl4030-irq: irq_desc->lock converted to raw_spinlock_t
  2009-12-16 18:20 ` Felipe Balbi
@ 2009-12-17  0:04   ` Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2009-12-17  0:04 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: linux-kernel@vger.kernel.org, Tony Lindgren, Samuel Ortiz,
	Santosh Shilimkar, Balaji T K, Rajendra Nayak,
	linux-omap@vger.kernel.org

On Wed, 16 Dec 2009, Felipe Balbi wrote:
> commit 239007b8440abff689632f50cdf0f2b9e895b534 converted
> the spinlock_t to raw_spinlock_t. Unfortunately twl4030-irq
> was left aside on the conversion.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: linux-omap@vger.kernel.org
> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
> ---
> 
> I'm not sure this is the expected fix since twl4030-irq handler
> should be running in thread context. Currently mask/unmask/set_type
> are deferred to a workqueue. Thomas, should this be done ? How
> do you expect irq chips on slow busses to implement mask/unmask/set_type ?

That does not matter whether this runs in thread context or not. We
changed the type of the lock from spinlock to raw_spinlock. So we need
to use the corresponding raw_spin_* functions for it independent of
the context. Your patch is completely correct.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
 
>  drivers/mfd/twl4030-irq.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> index 20d29ba..9df9a5a 100644
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -568,12 +568,12 @@ static void twl4030_sih_do_edge(struct work_struct
> *work)
>   		bytes[byte] &= ~(0x03 << off);
>  -		spin_lock_irq(&d->lock);
> +		raw_spin_lock_irq(&d->lock);
>  		if (d->status & IRQ_TYPE_EDGE_RISING)
>  			bytes[byte] |= BIT(off + 1);
>  		if (d->status & IRQ_TYPE_EDGE_FALLING)
>  			bytes[byte] |= BIT(off + 0);
> -		spin_unlock_irq(&d->lock);
> +		raw_spin_unlock_irq(&d->lock);
>   		edge_change &= ~BIT(i);
>  	}
> -- 
> 1.6.6.rc0
> 
> 
> -- 
> balbi
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-17  0:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-16 18:18 [PATCH] mfd: twl4030-irq: irq_desc->lock converted to raw_spinlock_t Felipe Balbi
2009-12-16 18:20 ` Felipe Balbi
2009-12-17  0:04   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox