* [PATCH] mtdoops: fix a bit of spin lock usage
@ 2009-03-04 7:53 Adrian Hunter
2009-03-04 10:08 ` Artem Bityutskiy
2009-03-05 10:29 ` Artem Bityutskiy
0 siblings, 2 replies; 3+ messages in thread
From: Adrian Hunter @ 2009-03-04 7:53 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd Mailing List
- do not leave spin lock locked
- initialise spin lock
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
drivers/mtd/mtdoops.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 0a0dad6..3f63fad 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -358,8 +358,10 @@ mtdoops_console_write(struct console *co, const char *s, unsigned int count)
spin_lock_irqsave(&cxt->writecount_lock, flags);
/* Check ready status didn't change whilst waiting for the lock */
- if (!cxt->ready)
+ if (!cxt->ready) {
+ spin_unlock_irqrestore(&cxt->writecount_lock, flags);
return;
+ }
if (cxt->writecount == 0) {
u32 *stamp = cxt->oops_buf;
@@ -417,6 +419,7 @@ static int __init mtdoops_console_init(void)
cxt->mtd_index = -1;
cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE);
+ spin_lock_init(&cxt->writecount_lock);
if (!cxt->oops_buf) {
printk(KERN_ERR "Failed to allocate mtdoops buffer workspace\n");
--
1.5.6.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtdoops: fix a bit of spin lock usage
2009-03-04 7:53 [PATCH] mtdoops: fix a bit of spin lock usage Adrian Hunter
@ 2009-03-04 10:08 ` Artem Bityutskiy
2009-03-05 10:29 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2009-03-04 10:08 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linux-mtd Mailing List, David Woodhouse
On Wed, 2009-03-04 at 09:53 +0200, Adrian Hunter wrote:
> - do not leave spin lock locked
> - initialise spin lock
>
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
> ---
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtdoops: fix a bit of spin lock usage
2009-03-04 7:53 [PATCH] mtdoops: fix a bit of spin lock usage Adrian Hunter
2009-03-04 10:08 ` Artem Bityutskiy
@ 2009-03-05 10:29 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2009-03-05 10:29 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd Mailing List, Adrian Hunter
On Wed, 2009-03-04 at 09:53 +0200, Adrian Hunter wrote:
> - do not leave spin lock locked
> - initialise spin lock
>
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
> ---
David, would you please push this patch?
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-05 10:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-04 7:53 [PATCH] mtdoops: fix a bit of spin lock usage Adrian Hunter
2009-03-04 10:08 ` Artem Bityutskiy
2009-03-05 10:29 ` Artem Bityutskiy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.