* [PATCH][2.5][CHECKER] rtc locking
@ 2003-03-03 4:19 Zwane Mwaikambo
2003-03-03 4:21 ` Zwane Mwaikambo
2003-03-03 4:27 ` William Lee Irwin III
0 siblings, 2 replies; 4+ messages in thread
From: Zwane Mwaikambo @ 2003-03-03 4:19 UTC (permalink / raw)
To: Linux Kernel
Index: linux-2.5.62-numaq/drivers/char/rtc.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.62/drivers/char/rtc.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 rtc.c
--- linux-2.5.62-numaq/drivers/char/rtc.c 18 Feb 2003 00:15:30 -0000 1.1.1.1
+++ linux-2.5.62-numaq/drivers/char/rtc.c 3 Mar 2003 03:57:09 -0000
@@ -746,13 +746,15 @@
#else
unsigned char tmp;
- spin_lock_irq(&rtc_task_lock);
+ spin_lock_irq(&rtc_lock);
+ spin_lock(&rtc_task_lock);
if (rtc_callback != task) {
- spin_unlock_irq(&rtc_task_lock);
+ spin_unlock(&rtc_task_lock);
+ spin_unlock_irq(rtc_lock);
return -ENXIO;
}
rtc_callback = NULL;
- spin_lock(&rtc_lock);
+
/* disable controls */
tmp = CMOS_READ(RTC_CONTROL);
tmp &= ~RTC_PIE;
@@ -765,8 +767,8 @@
del_timer(&rtc_irq_timer);
}
rtc_status &= ~RTC_IS_OPEN;
- spin_unlock(&rtc_lock);
- spin_unlock_irq(&rtc_task_lock);
+ spin_unlock(&rtc_task_lock);
+ spin_unlock_irq(&rtc_lock);
return 0;
#endif
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][2.5][CHECKER] rtc locking
2003-03-03 4:19 [PATCH][2.5][CHECKER] rtc locking Zwane Mwaikambo
@ 2003-03-03 4:21 ` Zwane Mwaikambo
2003-03-03 4:27 ` William Lee Irwin III
1 sibling, 0 replies; 4+ messages in thread
From: Zwane Mwaikambo @ 2003-03-03 4:21 UTC (permalink / raw)
To: Linux Kernel
oops missing ampersand
Index: linux-2.5.62-numaq/drivers/char/rtc.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.62/drivers/char/rtc.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 rtc.c
--- linux-2.5.62-numaq/drivers/char/rtc.c 18 Feb 2003 00:15:30 -0000 1.1.1.1
+++ linux-2.5.62-numaq/drivers/char/rtc.c 3 Mar 2003 04:21:09 -0000
@@ -746,13 +746,15 @@
#else
unsigned char tmp;
- spin_lock_irq(&rtc_task_lock);
+ spin_lock_irq(&rtc_lock);
+ spin_lock(&rtc_task_lock);
if (rtc_callback != task) {
- spin_unlock_irq(&rtc_task_lock);
+ spin_unlock(&rtc_task_lock);
+ spin_unlock_irq(&rtc_lock);
return -ENXIO;
}
rtc_callback = NULL;
- spin_lock(&rtc_lock);
+
/* disable controls */
tmp = CMOS_READ(RTC_CONTROL);
tmp &= ~RTC_PIE;
@@ -765,8 +767,8 @@
del_timer(&rtc_irq_timer);
}
rtc_status &= ~RTC_IS_OPEN;
- spin_unlock(&rtc_lock);
- spin_unlock_irq(&rtc_task_lock);
+ spin_unlock(&rtc_task_lock);
+ spin_unlock_irq(&rtc_lock);
return 0;
#endif
}
--
function.linuxpower.ca
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][2.5][CHECKER] rtc locking
2003-03-03 4:19 [PATCH][2.5][CHECKER] rtc locking Zwane Mwaikambo
2003-03-03 4:21 ` Zwane Mwaikambo
@ 2003-03-03 4:27 ` William Lee Irwin III
2003-03-03 4:35 ` Zwane Mwaikambo
1 sibling, 1 reply; 4+ messages in thread
From: William Lee Irwin III @ 2003-03-03 4:27 UTC (permalink / raw)
To: Zwane Mwaikambo; +Cc: Linux Kernel
On Sun, Mar 02, 2003 at 11:19:57PM -0500, Zwane Mwaikambo wrote:
> Index: linux-2.5.62-numaq/drivers/char/rtc.c
[... good patch]
Do you think some kind of API safety (e.g. removing *_lock_irq() in
favor of *_lock_irqsave()) would be worthwhile for catching these kinds
of errors?
-- wli
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][2.5][CHECKER] rtc locking
2003-03-03 4:27 ` William Lee Irwin III
@ 2003-03-03 4:35 ` Zwane Mwaikambo
0 siblings, 0 replies; 4+ messages in thread
From: Zwane Mwaikambo @ 2003-03-03 4:35 UTC (permalink / raw)
To: William Lee Irwin III; +Cc: Linux Kernel
On Sun, 2 Mar 2003, William Lee Irwin III wrote:
> On Sun, Mar 02, 2003 at 11:19:57PM -0500, Zwane Mwaikambo wrote:
> > Index: linux-2.5.62-numaq/drivers/char/rtc.c
> [... good patch]
>
> Do you think some kind of API safety (e.g. removing *_lock_irq() in
> favor of *_lock_irqsave()) would be worthwhile for catching these kinds
> of errors?
I think it may be worth checking *_lock_irq users period, however iirc
there is a speed argument wrt using _lock_irq since we don't save flags.
Zwane
--
function.linuxpower.ca
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-03-03 4:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-03 4:19 [PATCH][2.5][CHECKER] rtc locking Zwane Mwaikambo
2003-03-03 4:21 ` Zwane Mwaikambo
2003-03-03 4:27 ` William Lee Irwin III
2003-03-03 4:35 ` Zwane Mwaikambo
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®