From: "Mark A. Greer" <mgreer@mvista.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: "Mark A. Greer" <mgreer@mvista.com>,
LM Sensors <lm-sensors@lm-sensors.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.6.16-mm1 1/3] rtc: m41t00 driver should use workqueue instead of tasklet
Date: Mon, 27 Mar 2006 17:22:14 -0700 [thread overview]
Message-ID: <20060328002214.GC21077@mag.az.mvista.com> (raw)
In-Reply-To: <20060327190358.742eafb3.khali@linux-fr.org>
Resend...
---
The m41t00 i2c/rtc driver currently uses a tasklet to schedule
interrupt-level writes to the rtc. This patch causes the driver
to use a workqueue instead.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
m41t00.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff -Nurp linux-2.6.16-mm1/drivers/i2c/chips/m41t00.c linux-2.6.16-mm1-wq/drivers/i2c/chips/m41t00.c
--- linux-2.6.16-mm1/drivers/i2c/chips/m41t00.c 2006-03-23 15:04:55.000000000 -0700
+++ linux-2.6.16-mm1-wq/drivers/i2c/chips/m41t00.c 2006-03-27 15:29:35.000000000 -0700
@@ -25,6 +25,7 @@
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/mutex.h>
+#include <linux/workqueue.h>
#include <asm/time.h>
#include <asm/rtc.h>
@@ -111,7 +112,7 @@ m41t00_get_rtc_time(void)
}
static void
-m41t00_set_tlet(ulong arg)
+m41t00_set(void *arg)
{
struct rtc_time tm;
ulong nowtime = *(ulong *)arg;
@@ -145,9 +146,9 @@ m41t00_set_tlet(ulong arg)
return;
}
-static ulong new_time;
-
-DECLARE_TASKLET_DISABLED(m41t00_tasklet, m41t00_set_tlet, (ulong)&new_time);
+static ulong new_time;
+static struct workqueue_struct *m41t00_wq;
+static DECLARE_WORK(m41t00_work, m41t00_set, &new_time);
int
m41t00_set_rtc_time(ulong nowtime)
@@ -155,9 +156,9 @@ m41t00_set_rtc_time(ulong nowtime)
new_time = nowtime;
if (in_interrupt())
- tasklet_schedule(&m41t00_tasklet);
+ queue_work(m41t00_wq, &m41t00_work);
else
- m41t00_set_tlet((ulong)&new_time);
+ m41t00_set(&new_time);
return 0;
}
@@ -189,6 +190,7 @@ m41t00_probe(struct i2c_adapter *adap, i
return rc;
}
+ m41t00_wq = create_singlethread_workqueue("m41t00");
save_client = client;
return 0;
}
@@ -206,7 +208,7 @@ m41t00_detach(struct i2c_client *client)
if ((rc = i2c_detach_client(client)) == 0) {
kfree(client);
- tasklet_kill(&m41t00_tasklet);
+ destroy_workqueue(m41t00_wq);
}
return rc;
}
next prev parent reply other threads:[~2006-03-28 0:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <440B4B6E.8080307@sh.cvut.cz>
[not found] ` <zt2d4LqL.1141645514.2993990.khali@localhost>
[not found] ` <20060307170107.GA5250@mag.az.mvista.com>
[not found] ` <20060318001254.GA14079@mag.az.mvista.com>
[not found] ` <20060323210856.f1bfd02b.khali@linux-fr.org>
[not found] ` <20060323203843.GA18912@mag.az.mvista.com>
2006-03-24 1:18 ` Mark A. Greer
2006-03-27 17:03 ` Jean Delvare
2006-03-28 0:22 ` Mark A. Greer [this message]
2006-03-24 1:21 ` [PATCH 2.6.16-mm1 2/3] rtc: m41t00 driver cleanup Mark A. Greer
2006-03-27 17:11 ` Jean Delvare
2006-03-27 22:35 ` Mark A. Greer
2006-03-28 0:23 ` Mark A. Greer
2006-03-24 1:24 ` [PATCH 2.6.16-mm1 3/3] rtc: add support for m41t81 & m41t85 chips to m41t00 driver Mark A. Greer
2006-03-26 22:58 ` Andrew Morton
2006-03-27 22:34 ` Mark A. Greer
2006-03-28 0:26 ` Mark A. Greer
2006-03-28 0:51 ` Andrew Morton
2006-03-28 12:21 ` Jean Delvare
2006-03-28 17:15 ` Mark A. Greer
2006-03-28 15:54 ` Jean Delvare
2006-03-28 18:11 ` Mark A. Greer
2006-03-28 18:30 ` Jean Delvare
2006-03-28 23:12 ` Mark A. Greer
2006-04-01 17:20 ` Jean Delvare
2006-04-03 18:01 ` Mark A. Greer
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=20060328002214.GC21077@mag.az.mvista.com \
--to=mgreer@mvista.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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
all inboxes | Powered by JetHome®