From: Nishanth Aravamudan <nacc@us.ibm.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] Re: [PATCH] 18/34: ieee1394/video1394: replace
Date: Mon, 21 Feb 2005 17:46:23 +0000 [thread overview]
Message-ID: <20050221174623.GA2656@us.ibm.com> (raw)
In-Reply-To: <20050215002049.GH9231@conscoop.ottawa.on.ca>
[-- Attachment #1: Type: text/plain, Size: 2353 bytes --]
On Tue, Feb 15, 2005 at 05:03:40PM -0500, Jody McIntyre wrote:
> On Tue, Feb 15, 2005 at 10:18:11AM -0800, Nishanth Aravamudan wrote:
>
> > I am not sure if you have seen some of the discussion (under the
> > subject: "[RFC UPDATE PATCH] add wait_event_*_lock() functions and
> > comments") on LKML regarding these macros. Does Arnd's proposal to fix
> > video1394 seem reasonable? I can throw up a patch, if you'd like to
> > test.
>
> I just read it now. Arnd's suggestion looks like it will work. I
> thought of something similar while reading the thread and his code looks
> correct. If you have time to make a patch, I'll find some video1394
> users to test it.
If someone could test the following, I think it implements exactly what
Arnd suggested...
Thanks,
Nish
--- 2.6.11-rc4-v/drivers/ieee1394/video1394.c 2005-02-21 09:44:31.000000000 -0800
+++ 2.6.11-rc4/drivers/ieee1394/video1394.c 2005-02-21 09:38:37.000000000 -0800
@@ -699,6 +699,17 @@ static void initialize_dma_it_ctx(struct
reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1<<d->ctx);
}
+static inline unsigned video1394_buffer_state(struct dma_iso_ctx *d,
+ unsigned int buffer)
+{
+ unsigned long flags;
+ unsigned int ret;
+ spin_lock_irqsave(&d->lock, flags);
+ ret = d->buffer_status[buffer];
+ spin_unlock_irqrestore(&d->lock, flags);
+ return ret;
+}
+
static int __video1394_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
@@ -952,24 +963,12 @@ static int __video1394_ioctl(struct file
return -EINTR;
}
-#if 1
- while (d->buffer_status[v.buffer]!=
- VIDEO1394_BUFFER_READY) {
- spin_unlock_irqrestore(&d->lock, flags);
- interruptible_sleep_on(&d->waitq);
- spin_lock_irqsave(&d->lock, flags);
- if (signal_pending(current)) {
- spin_unlock_irqrestore(&d->lock,flags);
- return -EINTR;
- }
- }
-#else
- if (wait_event_interruptible(d->waitq,
- d->buffer_status[v.buffer]
- == VIDEO1394_BUFFER_READY)
- == -ERESTARTSYS)
+ spin_unlock_irqrestore(&d->lock, flags);
+ wait_event_interruptible(d->waitq,
+ video1394_buffer_state(d, v.buffer) == VIDEO1394_BUFFER_READY);
+ if (signal_pending(current)) {
return -EINTR;
-#endif
+ spin_lock_irqsave(&d->lock, flags);
d->buffer_status[v.buffer]=VIDEO1394_BUFFER_FREE;
break;
default:
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2005-02-21 17:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-15 0:20 [KJ] Re: [PATCH] 18/34: ieee1394/video1394: replace Jody McIntyre
2005-02-15 0:32 ` Nishanth Aravamudan
2005-02-15 0:42 ` Jody McIntyre
2005-02-15 0:50 ` Nishanth Aravamudan
2005-02-15 1:34 ` Jody McIntyre
2005-02-15 1:43 ` Nishanth Aravamudan
2005-02-15 18:18 ` Nishanth Aravamudan
2005-02-15 22:03 ` Jody McIntyre
2005-02-21 17:46 ` Nishanth Aravamudan [this message]
2005-02-22 17:29 ` Jody McIntyre
2005-02-22 17:37 ` Nishanth Aravamudan
2005-03-03 22:07 ` Jody McIntyre
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=20050221174623.GA2656@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=kernel-janitors@vger.kernel.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 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.