From: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>,
Larry Finger <Larry.Finger@lwfinger.net>,
"Hin-Tak Leung" <htl10@users.sourceforge.net>,
sidhayn@gmail.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] rtl8187: Fix kernel oops when device is removed when LEDS enabled (Bugzilla #14539)
Date: Wed, 4 Nov 2009 22:14:54 -0200 [thread overview]
Message-ID: <200911042214.54230.herton@mandriva.com.br> (raw)
In-Reply-To: <20091104164938.GG12965@tuxdriver.com>
Em Qua 04 Nov 2009, às 14:49:38, John W. Linville escreveu:
> On Wed, Nov 04, 2009 at 04:30:19PM +0100, Christian Lamparter wrote:
> > On Wednesday 04 November 2009 16:11:33 John W. Linville wrote:
>
> > > This seems like a band-aid. If anything, the original order would
> > > seem to make more sense.
> >
> > really?
> >
> > take this code from led-class.c
> >
> > void led_classdev_unregister(struct led_classdev *led_cdev)
> > {
> > device_remove_file(led_cdev->dev, &dev_attr_max_brightness);
> > device_remove_file(led_cdev->dev, &dev_attr_brightness);
> > #ifdef CONFIG_LEDS_TRIGGERS
> > device_remove_file(led_cdev->dev, &dev_attr_trigger);
> > down_write(&led_cdev->trigger_lock);
> > if (led_cdev->trigger)
> > led_trigger_set(led_cdev, NULL);
> > up_write(&led_cdev->trigger_lock);
> > #endif
> >
> > device_unregister(led_cdev->dev);
> >
> > down_write(&leds_list_lock);
> > list_del(&led_cdev->node);
> > up_write(&leds_list_lock);
> > }
> >
> > as you can see the led is switched-off right before the device is unregistered.
> > but rtl8187, p54 & ar9170 led-triggers are timed & asynchronous. So
> > we really need a cancel_delayed_work_sync after the unregister routine
> > finished... else the timed trigger might fire when the device/module
> > is _faded_ from memory.
>
> OK, I got it...the unregister can queue-up more work. Thanks for
> the explanation.
Hi, I checked here and the code above in led_classdev_unregister is the same in
2.6.31, so I think the patch from Larry should also be applied/sent to 2.6.31.x
stable, as the bug could happen there too.
>
> John
>
--
[]'s
Herton
next prev parent reply other threads:[~2009-11-05 0:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 6:00 [PATCH] rtl8187: Fix kernel oops when device is removed when LEDS enabled (Bugzilla #14539) Larry Finger
2009-11-04 15:11 ` John W. Linville
2009-11-04 15:30 ` Christian Lamparter
2009-11-04 16:49 ` John W. Linville
2009-11-05 0:14 ` Herton Ronaldo Krzesinski [this message]
2009-11-05 2:34 ` Larry Finger
2009-11-05 4:55 ` Richard Farina
2009-11-05 5:16 ` Larry Finger
2009-11-04 15:54 ` Larry Finger
2009-11-04 16:54 ` John W. Linville
2009-11-04 18:13 ` Larry Finger
2009-11-04 18:47 ` John W. Linville
2009-11-05 4:57 ` Richard Farina
2009-11-05 6:00 ` Larry Finger
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=200911042214.54230.herton@mandriva.com.br \
--to=herton@mandriva.com.br \
--cc=Larry.Finger@lwfinger.net \
--cc=chunkeey@googlemail.com \
--cc=htl10@users.sourceforge.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=sidhayn@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).