From: Andreas Oberritter <obi@linuxtv.org>
To: linux-media@vger.kernel.org
Cc: Trent Piepho <xyzzy@speakeasy.org>,
e9hack <e9hack@googlemail.com>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-dvb@linuxtv.org
Subject: Re: [BUG] changeset 9029 (http://linuxtv.org/hg/v4l-dvb/rev/aa3e5cc1d833)
Date: Tue, 17 Feb 2009 05:02:21 +0100 [thread overview]
Message-ID: <499A36CD.4070209@linuxtv.org> (raw)
In-Reply-To: <200902170140.53617@orion.escape-edv.de>
Oliver Endriss wrote:
> Trent Piepho wrote:
>> On Sun, 15 Feb 2009, Oliver Endriss wrote:
>>> e9hack wrote:
>>>> this change set is wrong. The affected functions cannot be called from an interrupt
>>>> context, because they may process large buffers. In this case, interrupts are disabled for
>>>> a long time. Functions, like dvb_dmx_swfilter_packets(), could be called only from a
>>>> tasklet. This change set does hide some strong design bugs in dm1105.c and au0828-dvb.c.
>>>>
>>>> Please revert this change set and do fix the bugs in dm1105.c and au0828-dvb.c (and other
>>>> files).
>>> @Mauro:
>>>
>>> This changeset _must_ be reverted! It breaks all kernels since 2.6.27
>>> for applications which use DVB and require a low interrupt latency.
>>>
>>> It is a very bad idea to call the demuxer to process data buffers with
>>> interrupts disabled!
>> I agree, this is bad. The demuxer is far too much work to be done with
>> IRQs off. IMHO, even doing it under a spin-lock is excessive. It should
>> be a mutex. Drivers should use a work-queue to feed the demuxer.
>
> Agreed, this would be the best solution.
>
> On the other hand, a workqueue handler would be scheduled later, so you
> need larger buffers in the driver. Some chipsets have very small
> buffers...
>
> Anway, this would be a major change. All drivers must be carefully
> modified and tested for an extended period.
>
> Meanwhile I had a look at the changeset, and I do not understand why
> spin_lock_irq... should be required everywhere.
>
> Afaics a driver may safely call dvb_dmx_swfilter_packets,
> dvb_dmx_swfilter_204 or dvb_dmx_swfilter from process context, tasklet
> or interrupt handler 'as is'.
>
> @Andreas:
> Could you please explain in more detail what bad things might happen?
To quote myself from the changelog: This fixes a deadlock discovered
by lockdep.
The lock is used in process context (e.g. DMX_START) and might also be
used from interrupt context (e.g. dvb_dmx_swfilter).
>From http://osdir.com/ml/kernel.janitors/2002-08/msg00022.html:
"spin_lock_irq disables local interrupts and then takes the spin_lock.
If you know you're in process context and other users may be in
interrupt context, this is the correct call to make.
spin_lock_irqsave saves local interrupt state into the flags variable,
disables interrupts, then takes the spin_lock. spin_unlock_irqrestore
restores the local state saved in the flags. Use this variant if you
don't know whether you're in interrupt or process context."
So, if the assumtions above are correct, then spin_lock_irq must be
used by all functions called from process context and
spin_lock_irqsave must be used by all functions called from an unknown
context.
Regards,
Andreas
next prev parent reply other threads:[~2009-02-17 4:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-02 1:46 [BUG] changeset 9029 (http://linuxtv.org/hg/v4l-dvb/rev/aa3e5cc1d833) e9hack
2009-02-02 3:38 ` Andy Walls
2009-02-15 12:36 ` Oliver Endriss
2009-02-15 14:07 ` [linux-dvb] " Andy Walls
2009-02-15 20:25 ` Andy Walls
2009-02-16 16:19 ` Trent Piepho
2009-02-16 16:33 ` [linux-dvb] " VDR User
2009-02-16 18:31 ` Mauro Carvalho Chehab
2009-02-16 19:13 ` [linux-dvb] " Steven Toth
2009-02-16 19:15 ` Steven Toth
2009-02-16 23:11 ` Andy Walls
2009-02-17 0:22 ` Trent Piepho
2009-02-17 15:16 ` Steven Toth
2009-02-17 16:47 ` Andreas Oberritter
2009-02-18 2:32 ` Trent Piepho
2009-02-18 15:07 ` Steven Toth
2009-02-18 20:45 ` Trent Piepho
2009-02-17 0:40 ` Oliver Endriss
2009-02-17 4:02 ` Andreas Oberritter [this message]
2009-02-18 2:04 ` [linux-dvb] " Oliver Endriss
2009-02-18 3:22 ` Trent Piepho
2009-02-18 16:47 ` Oliver Endriss
2009-02-18 12:51 ` Andreas Oberritter
2009-02-18 9:15 ` Trent Piepho
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=499A36CD.4070209@linuxtv.org \
--to=obi@linuxtv.org \
--cc=e9hack@googlemail.com \
--cc=linux-dvb@linuxtv.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=xyzzy@speakeasy.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