public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@googlemail.com>
To: linux-omap-open-source@linux.omap.com
Subject: CONFIG_PREEMPT_RT patch on OSK
Date: Sat, 18 Nov 2006 08:47:30 +0100	[thread overview]
Message-ID: <455EBA92.5050804@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]

Hi,

after Tony updated to -rc6 (thanks!) I tried latest
CONFIG_PREEMPT_RT patch on OSK. For more details see [1].

First, I applied our clocksource patch [2], then preempt rt
patch [3]. This doesn't apply totally cleanly, it fails in
arch/arm/plat-omap/gpio.c which seems to be different in
mainline and our git. Fixing this and converting some OMAP
specific spinlocks to raw_spinlocks (is this correct?) not
in mainline, system boots. Resulting OMAP specific patch in
attachment, apply it on top of [2] & [3].

Result:

- System boots
- Can play MP3 via NFS, however Oops after MP3 finished [4]

Still not perfect, but a starting point :)

Maybe this is interesting for other people as well,

Dirk

[1] rt.wiki.kernel.org

[2]
http://linux.omap.com/pipermail/linux-omap-open-source/2006-November/008370.html

[3]
http://people.redhat.com/mingo/realtime-preempt/patch-2.6.19-rc6-rt3 



[4] Oops after madplay finishes:

kernel BUG at kernel/rtmutex.c:672!
Unable to handle kernel NULL pointer dereference at virtual
address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 817 [#1]
PC is at __bug+0x44/0x58
LR is at rt_up+0x4c/0x6c


[-- Attachment #2: omap_patch-2.6.19-rc6-rt3 --]
[-- Type: text/plain, Size: 8267 bytes --]

Index: linux-osk/arch/arm/mach-omap2/gpmc.c
===================================================================
--- linux-osk.orig/arch/arm/mach-omap2/gpmc.c
+++ linux-osk/arch/arm/mach-omap2/gpmc.c
@@ -61,7 +61,7 @@
 
 static struct resource	gpmc_mem_root;
 static struct resource	gpmc_cs_mem[GPMC_CS_NUM];
-static spinlock_t	gpmc_mem_lock = SPIN_LOCK_UNLOCKED;
+static raw_spinlock_t	gpmc_mem_lock = SPIN_LOCK_UNLOCKED;
 static unsigned		gpmc_cs_map;
 
 static void __iomem *gpmc_base =
Index: linux-osk/arch/arm/plat-omap/debug-leds.c
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/debug-leds.c
+++ linux-osk/arch/arm/plat-omap/debug-leds.c
@@ -34,7 +34,7 @@
  * one, or both.
  */
 
-static spinlock_t			lock;
+static raw_spinlock_t			lock;
 static struct h2p2_dbg_fpga __iomem	*fpga;
 static u16				led_state, hw_led_state;
 
Index: linux-osk/arch/arm/plat-omap/dma.c
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/dma.c
+++ linux-osk/arch/arm/plat-omap/dma.c
@@ -62,7 +62,7 @@ struct omap_dma_lch {
 
 static int dma_chan_count;
 
-static spinlock_t dma_chan_lock;
+static raw_spinlock_t dma_chan_lock;
 static struct omap_dma_lch dma_chan[OMAP_LOGICAL_DMA_CH_COUNT];
 
 static const u8 omap1_dma_irq[OMAP_LOGICAL_DMA_CH_COUNT] = {
Index: linux-osk/arch/arm/plat-omap/dmtimer.c
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/dmtimer.c
+++ linux-osk/arch/arm/plat-omap/dmtimer.c
@@ -129,7 +129,7 @@ static struct clk *dm_source_clocks[3];
 #endif
 
 static const int dm_timer_count = ARRAY_SIZE(dm_timers);
-static spinlock_t dm_timer_lock;
+static raw_spinlock_t dm_timer_lock;
 
 static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg)
 {
Index: linux-osk/arch/arm/plat-omap/dsp/fifo.h
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/dsp/fifo.h
+++ linux-osk/arch/arm/plat-omap/dsp/fifo.h
@@ -22,7 +22,7 @@
  */
 
 struct fifo_struct {
-	spinlock_t lock;
+	raw_spinlock_t lock;
 	char *buf;
 	size_t sz;
 	size_t cnt;
Index: linux-osk/arch/arm/plat-omap/dsp/ipbuf.h
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/dsp/ipbuf.h
+++ linux-osk/arch/arm/plat-omap/dsp/ipbuf.h
@@ -79,7 +79,7 @@ extern struct ipbuf_sys *ipbuf_sys_da, *
 #define dsp_mem_disable_ipbuf()	dsp_mem_disable(ipbcfg.base)
 
 struct ipblink {
-	spinlock_t lock;
+	raw_spinlock_t lock;
 	u16 top;
 	u16 tail;
 };
Index: linux-osk/arch/arm/plat-omap/dsp/mblog.c
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/dsp/mblog.c
+++ linux-osk/arch/arm/plat-omap/dsp/mblog.c
@@ -116,7 +116,7 @@ struct mblogent {
 };
 
 static struct {
-	spinlock_t lock;
+	raw_spinlock_t lock;
 	int wp;
 	unsigned long cnt, cnt_ad, cnt_da;
 	struct mblogent ent[MBLOG_DEPTH];
Index: linux-osk/arch/arm/plat-omap/dsp/proclist.h
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/dsp/proclist.h
+++ linux-osk/arch/arm/plat-omap/dsp/proclist.h
@@ -27,8 +27,10 @@ struct proc_list {
 	struct file *file;
 };
 
-static __inline__ void proc_list_add(spinlock_t *lock, struct list_head *list,
-				     struct task_struct *tsk, struct file *file)
+static __inline__ void proc_list_add(raw_spinlock_t *lock,
+                                     struct list_head *list,
+                                     struct task_struct *tsk,
+                                     struct file *file)
 {
 	struct proc_list *new;
 
@@ -40,8 +42,10 @@ static __inline__ void proc_list_add(spi
 	spin_unlock(lock);
 }
 
-static __inline__ void proc_list_del(spinlock_t *lock, struct list_head *list,
-				     struct task_struct *tsk, struct file *file)
+static __inline__ void proc_list_del(raw_spinlock_t *lock,
+                                     struct list_head *list,
+				     struct task_struct *tsk,
+                                     struct file *file)
 {
 	struct proc_list *pl;
 
@@ -64,7 +68,8 @@ static __inline__ void proc_list_del(spi
 	spin_unlock(lock);
 }
 
-static __inline__ void proc_list_flush(spinlock_t *lock, struct list_head *list)
+static __inline__ void proc_list_flush(raw_spinlock_t *lock,
+                                       struct list_head *list)
 {
 	struct proc_list *pl;
 
Index: linux-osk/arch/arm/plat-omap/dsp/task.c
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/dsp/task.c
+++ linux-osk/arch/arm/plat-omap/dsp/task.c
@@ -118,7 +118,7 @@ struct taskdev {
 	unsigned int usecount;
 	char name[TNM_LEN];
 	struct file_operations fops;
-	spinlock_t proc_list_lock;
+	raw_spinlock_t proc_list_lock;
 	struct list_head proc_list;
 	struct dsptask *task;
 
@@ -133,7 +133,7 @@ struct taskdev {
 	/* write stuff */
 	wait_queue_head_t write_wait_q;
 	struct mutex write_mutex;
-	spinlock_t wsz_lock;
+	raw_spinlock_t wsz_lock;
 	size_t wsz;
 
 	/* tctl stuff */
Index: linux-osk/arch/arm/plat-omap/gpio.c
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/gpio.c
+++ linux-osk/arch/arm/plat-omap/gpio.c
@@ -137,7 +137,7 @@ struct gpio_bank {
 	u32 saved_fallingdetect;
 	u32 saved_risingdetect;
 #endif
-	spinlock_t lock;
+	raw_spinlock_t lock;
 };
 
 #define METHOD_MPUIO		0
Index: linux-osk/arch/arm/plat-omap/mcbsp.c
===================================================================
--- linux-osk.orig/arch/arm/plat-omap/mcbsp.c
+++ linux-osk/arch/arm/plat-omap/mcbsp.c
@@ -61,7 +61,7 @@ struct omap_mcbsp {
 	struct completion            tx_dma_completion;
 	struct completion            rx_dma_completion;
 
-	spinlock_t                   lock;
+	raw_spinlock_t                   lock;
 };
 
 static struct omap_mcbsp mcbsp[OMAP_MAX_MCBSP_COUNT];
Index: linux-osk/drivers/input/touchscreen/ads7846.c
===================================================================
--- linux-osk.orig/drivers/input/touchscreen/ads7846.c
+++ linux-osk/drivers/input/touchscreen/ads7846.c
@@ -100,7 +100,7 @@ struct ads7846 {
 	u16			debounce_tol;
 	u16			debounce_rep;
 
-	spinlock_t		lock;
+	raw_spinlock_t		lock;
 	struct hrtimer		timer;
 	unsigned		pendown:1;	/* P: lock */
 	unsigned		pending:1;	/* P: lock */
@@ -454,7 +454,7 @@ static void ads7846_rx(void *ads)
 			ts->spi->dev.bus_id, ts->tc.ignore, Rt);
 #endif
 		hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
-			      HRTIMER_REL);
+			      HRTIMER_MODE_REL);
 		return;
 	}
 
@@ -473,7 +473,8 @@ static void ads7846_rx(void *ads)
 		ads7846_sync_events(ts);
 	}
 
-	hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD), HRTIMER_REL);
+	hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
+                                            HRTIMER_MODE_REL);
 }
 
 static int ads7846_debounce(void *ads, int data_idx, int *val)
@@ -609,7 +610,7 @@ static irqreturn_t ads7846_irq(int irq, 
 			disable_irq(ts->spi->irq);
 			ts->pending = 1;
 			hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY),
-					HRTIMER_REL);
+					HRTIMER_MODE_REL);
 		}
 	}
 	spin_unlock_irqrestore(&ts->lock, flags);
@@ -747,7 +748,7 @@ static int __devinit ads7846_probe(struc
 	ts->input = input_dev;
 	ts->hwmon = hwmon;
 
-	hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_REL);
+	hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	ts->timer.function = ads7846_timer;
 
 	spin_lock_init(&ts->lock);
Index: linux-osk/sound/arm/omap/omap-alsa-dma.c
===================================================================
--- linux-osk.orig/sound/arm/omap/omap-alsa-dma.c
+++ linux-osk/sound/arm/omap/omap-alsa-dma.c
@@ -56,6 +56,7 @@
 #include <linux/sysrq.h>
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
+#include <linux/spinlock_types.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -114,7 +115,7 @@
 
 /**************************** DATA STRUCTURES *****************************************/
 
-static spinlock_t dma_list_lock = SPIN_LOCK_UNLOCKED;
+static raw_spinlock_t dma_list_lock = RAW_SPIN_LOCK_UNLOCKED(dma_list_lock);
 
 static char nr_linked_channels = 1;
 


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2006-11-18  7:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-18  7:47 Dirk Behme [this message]
2006-11-30 18:12 ` CONFIG_PREEMPT_RT patch on OSK Eduardo Valentin
2006-11-30 19:43   ` Dirk Behme

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=455EBA92.5050804@gmail.com \
    --to=dirk.behme@googlemail.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /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