linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: linuxppc-dev@ozlabs.org
Subject: [patch 09/15] powerpc: Convert feature_lock to raw_spinlock
Date: Thu, 18 Feb 2010 12:22:55 -0000	[thread overview]
Message-ID: <20100218122000.464157003@linutronix.de> (raw)
In-Reply-To: 20100218121904.620984825@linutronix.de

feature_lock needs to be a real spinlock in RT. Convert it to
raw_spinlock.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/powerpc/include/asm/pmac_feature.h      |    2 +-
 arch/powerpc/platforms/powermac/feature.c    |    6 +++---
 arch/powerpc/platforms/powermac/pfunc_base.c |   24 ++++++++++++------------
 3 files changed, 16 insertions(+), 16 deletions(-)

Index: linux-2.6-tip/arch/powerpc/include/asm/pmac_feature.h
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/include/asm/pmac_feature.h
+++ linux-2.6-tip/arch/powerpc/include/asm/pmac_feature.h
@@ -378,7 +378,7 @@ extern struct macio_chip* macio_find(str
  * Those are exported by pmac feature for internal use by arch code
  * only like the platform function callbacks, do not use directly in drivers
  */
-extern spinlock_t feature_lock;
+extern raw_spinlock_t feature_lock;
 extern struct device_node *uninorth_node;
 extern u32 __iomem *uninorth_base;
 
Index: linux-2.6-tip/arch/powerpc/platforms/powermac/feature.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/powermac/feature.c
+++ linux-2.6-tip/arch/powerpc/platforms/powermac/feature.c
@@ -59,10 +59,10 @@ extern struct device_node *k2_skiplist[2
  * We use a single global lock to protect accesses. Each driver has
  * to take care of its own locking
  */
-DEFINE_SPINLOCK(feature_lock);
+DEFINE_RAW_SPINLOCK(feature_lock);
 
-#define LOCK(flags)	spin_lock_irqsave(&feature_lock, flags);
-#define UNLOCK(flags)	spin_unlock_irqrestore(&feature_lock, flags);
+#define LOCK(flags)	raw_spin_lock_irqsave(&feature_lock, flags);
+#define UNLOCK(flags)	raw_spin_unlock_irqrestore(&feature_lock, flags);
 
 
 /*
Index: linux-2.6-tip/arch/powerpc/platforms/powermac/pfunc_base.c
===================================================================
--- linux-2.6-tip.orig/arch/powerpc/platforms/powermac/pfunc_base.c
+++ linux-2.6-tip/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -50,13 +50,13 @@ static int macio_do_gpio_write(PMF_STD_A
 		value = ~value;
 
 	/* Toggle the GPIO */
-	spin_lock_irqsave(&feature_lock, flags);
+	raw_spin_lock_irqsave(&feature_lock, flags);
 	tmp = readb(addr);
 	tmp = (tmp & ~mask) | (value & mask);
 	DBG("Do write 0x%02x to GPIO %s (%p)\n",
 	    tmp, func->node->full_name, addr);
 	writeb(tmp, addr);
-	spin_unlock_irqrestore(&feature_lock, flags);
+	raw_spin_unlock_irqrestore(&feature_lock, flags);
 
 	return 0;
 }
@@ -145,9 +145,9 @@ static int macio_do_write_reg32(PMF_STD_
 	struct macio_chip *macio = func->driver_data;
 	unsigned long flags;
 
-	spin_lock_irqsave(&feature_lock, flags);
+	raw_spin_lock_irqsave(&feature_lock, flags);
 	MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask));
-	spin_unlock_irqrestore(&feature_lock, flags);
+	raw_spin_unlock_irqrestore(&feature_lock, flags);
 	return 0;
 }
 
@@ -168,9 +168,9 @@ static int macio_do_write_reg8(PMF_STD_A
 	struct macio_chip *macio = func->driver_data;
 	unsigned long flags;
 
-	spin_lock_irqsave(&feature_lock, flags);
+	raw_spin_lock_irqsave(&feature_lock, flags);
 	MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask));
-	spin_unlock_irqrestore(&feature_lock, flags);
+	raw_spin_unlock_irqrestore(&feature_lock, flags);
 	return 0;
 }
 
@@ -223,12 +223,12 @@ static int macio_do_write_reg32_slm(PMF_
 	if (args == NULL || args->count == 0)
 		return -EINVAL;
 
-	spin_lock_irqsave(&feature_lock, flags);
+	raw_spin_lock_irqsave(&feature_lock, flags);
 	tmp = MACIO_IN32(offset);
 	val = args->u[0].v << shift;
 	tmp = (tmp & ~mask) | (val & mask);
 	MACIO_OUT32(offset, tmp);
-	spin_unlock_irqrestore(&feature_lock, flags);
+	raw_spin_unlock_irqrestore(&feature_lock, flags);
 	return 0;
 }
 
@@ -243,12 +243,12 @@ static int macio_do_write_reg8_slm(PMF_S
 	if (args == NULL || args->count == 0)
 		return -EINVAL;
 
-	spin_lock_irqsave(&feature_lock, flags);
+	raw_spin_lock_irqsave(&feature_lock, flags);
 	tmp = MACIO_IN8(offset);
 	val = args->u[0].v << shift;
 	tmp = (tmp & ~mask) | (val & mask);
 	MACIO_OUT8(offset, tmp);
-	spin_unlock_irqrestore(&feature_lock, flags);
+	raw_spin_unlock_irqrestore(&feature_lock, flags);
 	return 0;
 }
 
@@ -278,12 +278,12 @@ static int unin_do_write_reg32(PMF_STD_A
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&feature_lock, flags);
+	raw_spin_lock_irqsave(&feature_lock, flags);
 	/* This is fairly bogus in darwin, but it should work for our needs
 	 * implemeted that way:
 	 */
 	UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask));
-	spin_unlock_irqrestore(&feature_lock, flags);
+	raw_spin_unlock_irqrestore(&feature_lock, flags);
 	return 0;
 }
 

  parent reply	other threads:[~2010-02-18 12:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18 12:22 [patch 00/15] powerpc: raw_spinlock conversions Thomas Gleixner
2010-02-18 12:22 ` [patch 01/15] powerpc: Convert big_irq_lock to raw_spinlock Thomas Gleixner
2010-02-18 12:22 ` [patch 02/15] powerpc: Convert pmc_owner_lock " Thomas Gleixner
2010-02-18 12:22 ` [patch 03/15] powerpc: Convert die.lock " Thomas Gleixner
2010-02-18 12:22 ` [patch 04/15] powerpc: Convert native_tlbie_lock " Thomas Gleixner
2010-02-18 12:22 ` [patch 05/15] powerpc: Convert context_lock " Thomas Gleixner
2010-02-18 12:22 ` [patch 06/15] powerpc: Convert tlbivax_lock " Thomas Gleixner
2010-02-18 21:52   ` Kumar Gala
2010-02-18 12:22 ` [patch 07/15] powerpc: Convert beat_htab_lock " Thomas Gleixner
2010-02-18 12:22 ` [patch 08/15] powerpc: Convert beatic_irq_mask_lock " Thomas Gleixner
2010-02-18 12:22 ` Thomas Gleixner [this message]
2010-02-18 12:22 ` [patch 10/15] powerpc: Convert nv_lock " Thomas Gleixner
2010-02-18 12:23 ` [patch 11/15] powerpc: Convert pmac_pic_lock " Thomas Gleixner
2010-02-18 12:23 ` [patch 12/15] powerpc: Convert confirm_error_lock " Thomas Gleixner
2010-02-18 12:23 ` [patch 13/15] powerpc: Convert i8259_lock " Thomas Gleixner
2010-02-18 12:23 ` [patch 14/15] powerpc: Convert ipic_lock " Thomas Gleixner
2010-02-18 12:23 ` [patch 15/15] powerpc: Convert mpic locks " Thomas Gleixner
2010-02-18 12:41 ` [patch 00/15] powerpc: raw_spinlock conversions Geert Uytterhoeven
2010-02-18 15:31   ` Thomas Gleixner
2010-02-18 13:43 ` [PATCH] powerpc/qe: Convert qe_ic_lock to raw_spinlock Anton Vorontsov
2010-02-18 16:32   ` Thomas Gleixner
2010-02-18 22:01   ` Kumar Gala
2010-02-18 13:45 ` [PATCH] powerpc/85xx: Convert socrates_fpga_pic_lock " Anton Vorontsov
2010-02-18 16:33   ` Thomas Gleixner
2010-02-18 22:01   ` Kumar Gala
2010-02-18 13:57 ` [PATCH] powerpc/86xx: Convert gef_pic_lock " Anton Vorontsov
2010-02-18 16:35   ` Thomas Gleixner
2010-02-18 22:01   ` Kumar Gala
2010-02-18 13:57 ` [PATCH] powerpc/82xx: Convert pci_pic_lock " Anton Vorontsov
2010-02-18 16:35   ` Thomas Gleixner
2010-02-18 22:01   ` Kumar Gala

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=20100218122000.464157003@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linuxppc-dev@ozlabs.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).