From: Jean Delvare <khali@linux-fr.org>
To: Trent Piepho <xyzzy@speakeasy.org>
Cc: Andy Walls <awalls@radix.net>, linux-media@vger.kernel.org
Subject: Re: General protection fault on rmmod cx8800
Date: Mon, 2 Mar 2009 22:52:35 +0100 [thread overview]
Message-ID: <20090302225235.5d6d47ce@hyperion.delvare> (raw)
In-Reply-To: <Pine.LNX.4.58.0903021241380.24268@shell2.speakeasy.net>
Hi Trent,
On Mon, 2 Mar 2009 13:12:24 -0800 (PST), Trent Piepho wrote:
> On Mon, 2 Mar 2009, Jean Delvare wrote:
> > On Mon, 2 Mar 2009 17:03:49 +0100, Jean Delvare wrote:
> > > As far as I can see the key difference between bttv-input and
> > > cx88-input is that bttv-input only uses a simple self-rearming timer,
> > > while cx88-input uses a timer and a separate workqueue. The timer runs
> > > the workqueue, which rearms the timer, etc. When you flush the timer,
> > > the separate workqueue can be still active. I presume this is what
> > > happens on my system. I guess the reason for the separate workqueue is
> > > that the processing may take some time and we don't want to hurt the
> > > system's performance?
> > >
> > > So we need to flush both the event workqueue (with
> > > flush_scheduled_work) and the separate workqueue (with
> > > flush_workqueue), at the same time, otherwise the active one may rearm
>
> What are the two work queues are you talking about? I don't see any actual
> work queues created. Just one work function that is scheduled on the
> system work queue. The timer is a softirq and doesn't run on a work queue.
Sorry, I misread the code. There's only one work queue involved (the
system one). Reading the timer code again now, I admit I am curious how
I managed to misread it to that degree...
The key point remains though: we'd need to delete the timer and flush
the system workqueue at the exact same time, which is not possible, or
to add some sort of signaling between the work and the timer. Or use
delayed_work.
> > Switching to delayed_work seems to do the trick (note this is a 2.6.28
> > patch):
>
> Makes the most sense to me. I was just about to make a patch to do the
> same thing when I got your email. Though I was going to patch the v4l-dvb
> sources to avoid porting work.
It was easier for me to test on an upstream kernel. The porting should
be fairly easy, I can take care of it. The difficult part will be to
handle the compatibility with kernels < 2.6.20 because delayed_work was
introduced in 2.6.20. Probably "compatibility" here will simply mean
that the bug I've hit will only be fixed for kernels >= 2.6.20. Which
once again raises the question of whether we really want to keep
supporting these old kernels.
--
Jean Delvare
next prev parent reply other threads:[~2009-03-02 21:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-15 20:41 General protection fault on rmmod cx8800 Jean Delvare
2009-03-02 12:39 ` Jean Delvare
2009-03-02 14:16 ` Andy Walls
2009-03-02 16:03 ` Jean Delvare
2009-03-02 19:05 ` Jean Delvare
2009-03-02 21:12 ` Trent Piepho
2009-03-02 21:52 ` Jean Delvare [this message]
2009-03-03 9:40 ` Trent Piepho
2009-03-03 9:49 ` Trent Piepho
2009-03-03 12:16 ` Jean Delvare
2009-03-03 20:14 ` Trent Piepho
2009-03-03 21:33 ` Jean Delvare
2009-03-02 22:33 ` Andy Walls
2009-03-02 20:09 ` Andy Walls
2009-03-05 5:09 ` 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=20090302225235.5d6d47ce@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=awalls@radix.net \
--cc=linux-media@vger.kernel.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