Skip to contentSkip to conversation

RFKILL: fix input layer initialisation

PATCH In review Dmitry Baryshkov 4 participants 4 messages Oct 22, 2008 – Oct 28, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RFKILL: fix input layer initialisation

Initialise correctly last fields, so tasks can be actually executed. On some architectures the initial jiffies value is not zero, so later all rfkill incorrectly decides that rfkill_*.last is in future.

---
 net/rfkill/rfkill-input.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
net/rfkill/rfkill-input.c +5 -0
index e5b6955..cd93f48 100644
@@ -255,6 +255,11 @@ static struct input_handler rfkill_handler = {
 
 static int __init rfkill_handler_init(void)
 {
+	unsigned long last_run = jiffies - msecs_to_jiffies(500);
+	rfkill_wlan.last = last_run;
+	rfkill_bt.last = last_run;
+	rfkill_uwb.last = last_run;
+	rfkill_wimax.last = last_run;
 	return input_register_handler(&rfkill_handler);
 }
 
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 14 lines · Dmitry Baryshkov

Initialise correctly last fields, so tasks can be actually executed. On some architectures the initial jiffies value is not zero, so later all rfkill incorrectly decides that rfkill_*.last is in future.

---
 net/rfkill/rfkill-input.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
net/rfkill/rfkill-input.c +0 -0
index e5b6955..cd93f48 100644

net/rfkill/rfkill-input.c static struct input_handler rfkill_handler = { · line 264

Quoted 10 lines
net/rfkill/rfkill-input.c +5 -0
@@ -255,6 +255,11 @@ static struct input_handler rfkill_handler = {
 
 static int __init rfkill_handler_init(void)
 {
+	unsigned long last_run = jiffies - msecs_to_jiffies(500);
+	rfkill_wlan.last = last_run;
+	rfkill_bt.last = last_run;
+	rfkill_uwb.last = last_run;
+	rfkill_wimax.last = last_run;
 	return input_register_handler(&rfkill_handler);
 }

I believe Dmitry Torokhov recently moved the rfkill structures for wlan, bt, etc into an array which allowed for easy looping through all structures. That would make updating all entries easier (and less prone to errors when a new structure is added).

Could you rebase thise patch on top of that one?
Thanks,

Ivo

A message that is not in the archive (sent off-list or not yet received): 200810221905.58169.IvDoorn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#3 lore raw

2008/10/22 Ivo van Doorn <[email protected]>:

Quoted 16 lines · Dmitry Baryshkov
Quoted 15 lines

Initialise correctly last fields, so tasks can be actually executed. On some architectures the initial jiffies value is not zero, so later all rfkill incorrectly decides that rfkill_*.last is in future.

---
 net/rfkill/rfkill-input.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
net/rfkill/rfkill-input.c +0 -0
index e5b6955..cd93f48 100644
@@ -255,6 +255,11 @@ static struct input_handler rfkill_handler = {
 
Quoted 14 lines

net/rfkill/rfkill-input.c static struct input_handler rfkill_handler = { · line 264

Quoted 9 lines
net/rfkill/rfkill-input.c +5 -0
 static int __init rfkill_handler_init(void)
 {
+     unsigned long last_run = jiffies - msecs_to_jiffies(500);
+     rfkill_wlan.last = last_run;
+     rfkill_bt.last = last_run;
+     rfkill_uwb.last = last_run;
+     rfkill_wimax.last = last_run;
      return input_register_handler(&rfkill_handler);
 }

I believe Dmitry Torokhov recently moved the rfkill structures for wlan, bt, etc into an array which allowed for easy looping through all structures. That would make updating all entries easier (and less prone to errors when a new structure is added).

I can't find the patch in question. Could you please point me to it?

Quoted 3 lines

Could you rebase thise patch on top of that one?
Thanks,

Signature · 6 lines
With best wishes
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to Dmitry Baryshkov
Quoted 14 lines · Dmitry Baryshkov

Initialise correctly last fields, so tasks can be actually executed. On some architectures the initial jiffies value is not zero, so later all rfkill incorrectly decides that rfkill_*.last is in future.

---
 net/rfkill/rfkill-input.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
net/rfkill/rfkill-input.c +0 -0
index e5b6955..cd93f48 100644

net/rfkill/rfkill-input.c static struct input_handler rfkill_handler = { · line 264

Quoted 10 lines
net/rfkill/rfkill-input.c +5 -0
@@ -255,6 +255,11 @@ static struct input_handler rfkill_handler = {
 
 static int __init rfkill_handler_init(void)
 {
+	unsigned long last_run = jiffies - msecs_to_jiffies(500);
+	rfkill_wlan.last = last_run;
+	rfkill_bt.last = last_run;
+	rfkill_uwb.last = last_run;
+	rfkill_wimax.last = last_run;
 	return input_register_handler(&rfkill_handler);
 }

This is not needed for wireless-testing's rfkill-input.

It is needed on 2.6.28, since AFAIK the stuff in wireless-testing is not going to be sent for 2.6.28.

A similar patch to this was sent not a month ago, I think. One of the two needs to be merged for 2.6.28.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh