Skip to contentSkip to conversation

Fix UCB1x00 driver to use sched_setscheduler

PATCH In review Satoru Takeuchi 3 participants 5 messages May 11, 2007 – May 14, 2007 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix UCB1x00 driver to use sched_setscheduler

Fix Touchscreen driver for UCB1x00-based touchscreens to use sched_setscheduler() instead of setting the fields of task_struct directly.

drivers/mfd/ucb1x00-ts.c +3 -2
Index: linux-2.6.21-fix-ucb-drivers/drivers/mfd/ucb1x00-ts.c
===================================================================
@@ -214,8 +214,9 @@ static int ucb1x00_thread(void *_ts)
 	 * We could run as a real-time thread.  However, thus far
 	 * this doesn't seem to be necessary.
 	 */
-//	tsk->policy = SCHED_FIFO;
-//	tsk->rt_priority = 1;
+//	struct sched_param param = { .sched_priority = 1 };
+//
+//	sched_setscheduler(tsk, SCHED_FIFO, &param);
 
 	valid = 0;
 
#1 lore raw

Hi!

Quoted 4 lines

Fix Touchscreen driver for UCB1x00-based touchscreens to use sched_setscheduler() instead of setting the fields of task_struct directly.

Looks ok to me.
Pavel

Quoted 16 lines

Index: linux-2.6.21-fix-ucb-drivers/drivers/mfd/ucb1x00-ts.c
===================================================================

drivers/mfd/ucb1x00-ts.c +3 -2
@@ -214,8 +214,9 @@ static int ucb1x00_thread(void *_ts)
 	 * We could run as a real-time thread.  However, thus far
 	 * this doesn't seem to be necessary.
 	 */
-//	tsk->policy = SCHED_FIFO;
-//	tsk->rt_priority = 1;
+//	struct sched_param param = { .sched_priority = 1 };
+//
+//	sched_setscheduler(tsk, SCHED_FIFO, &param);
 
 	valid = 0;
 
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
In reply to Satoru Takeuchi
Quoted 10 lines · Satoru Takeuchi

Fix Touchscreen driver for UCB1x00-based touchscreens to use sched_setscheduler() instead of setting the fields of task_struct directly.

Index: linux-2.6.21-fix-ucb-drivers/drivers/mfd/ucb1x00-ts.c
===================================================================

drivers/mfd/ucb1x00-ts.c static int ucb1x00_thread(void *_ts) · line 219

Quoted 8 lines
drivers/mfd/ucb1x00-ts.c +3 -2
@@ -214,8 +214,9 @@ static int ucb1x00_thread(void *_ts)
 	 * We could run as a real-time thread.  However, thus far
 	 * this doesn't seem to be necessary.
 	 */
-//	tsk->policy = SCHED_FIFO;
-//	tsk->rt_priority = 1;
+//	struct sched_param param = { .sched_priority = 1 };
+//
+//	sched_setscheduler(tsk, SCHED_FIFO, &param);

Can we please remove the unused code completely instead of replacing it by more commented out code ?

tglx

#3 lore raw

At Sat, 12 May 2007 15:10:27 +0200,

Quoted 7 lines · Thomas Gleixner
Quoted 5 lines · Satoru Takeuchi

Fix Touchscreen driver for UCB1x00-based touchscreens to use sched_setscheduler() instead of setting the fields of task_struct directly.

Quoted 16 lines

drivers/mfd/ucb1x00-ts.c static int ucb1x00_thread(void *_ts) · line 219

Quoted 13 lines

Index: linux-2.6.21-fix-ucb-drivers/drivers/mfd/ucb1x00-ts.c
===================================================================

drivers/mfd/ucb1x00-ts.c +3 -2
@@ -214,8 +214,9 @@ static int ucb1x00_thread(void *_ts)
 	 * We could run as a real-time thread.  However, thus far
 	 * this doesn't seem to be necessary.
 	 */
-//	tsk->policy = SCHED_FIFO;
-//	tsk->rt_priority = 1;
+//	struct sched_param param = { .sched_priority = 1 };
+//
+//	sched_setscheduler(tsk, SCHED_FIFO, &param);

Can we please remove the unused code completely instead of replacing it by more commented out code ?

It's OK to me, but I'm not the driver writer and doesn't know how important are those comments. If removing them is better for driver writers too, here is the patch.

Thanks,

Satoru

---
Remove unnecesary comments on driver for UCB1x00-based touchscreens.

drivers/mfd/ucb1x00-ts.c +1 -8
Index: linux-2.6.21-fix-ucb-drivers/drivers/mfd/ucb1x00-ts.c
===================================================================
@@ -199,7 +199,7 @@ static inline int ucb1x00_ts_pen_down(st
 }
 
 /*
- * This is a RT kernel thread that handles the ADC accesses
+ * This is a kernel thread that handles the ADC accesses
  * (mainly so we can use semaphores in the UCB1200 core code
  * to serialise accesses to the ADC).
  */
@@ -210,13 +210,6 @@ static int ucb1x00_thread(void *_ts)
 	DECLARE_WAITQUEUE(wait, tsk);
 	int valid;
 
-	/*
-	 * We could run as a real-time thread.  However, thus far
-	 * this doesn't seem to be necessary.
-	 */
-//	tsk->policy = SCHED_FIFO;
-//	tsk->rt_priority = 1;
-
 	valid = 0;
 
 	add_wait_queue(&ts->irq_wait, &wait);
#4 lore raw

Hi!

Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

Index: linux-2.6.21-fix-ucb-drivers/drivers/mfd/ucb1x00-ts.c
===================================================================

drivers/mfd/ucb1x00-ts.c +0 -0
@@ -214,8 +214,9 @@ static int ucb1x00_thread(void *_ts)
 	 * We could run as a real-time thread.  However, thus far
 	 * this doesn't seem to be necessary.
 	 */
Quoted 8 lines

drivers/mfd/ucb1x00-ts.c static int ucb1x00_thread(void *_ts) · line 219

Quoted 5 lines
drivers/mfd/ucb1x00-ts.c +3 -2
-//	tsk->policy = SCHED_FIFO;
-//	tsk->rt_priority = 1;
+//	struct sched_param param = { .sched_priority = 1 };
+//
+//	sched_setscheduler(tsk, SCHED_FIFO, &param);

Can we please remove the unused code completely instead of replacing it by more commented out code ?

Quoted 3 lines

It's OK to me, but I'm not the driver writer and doesn't know how important are those comments. If removing them is better for driver writers too, here is the patch.

I doubt anyone cares either way. Feel free to add my ACK to either "remove" or "fix" version.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html