From: Ingo Molnar <mingo@elte.hu>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Adrian Bunk <bunk@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Natalie Protasevich <protasnb@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: 2.6.30-rc6: Reported regressions from 2.6.29
Date: Sun, 17 May 2009 08:32:34 +0200 [thread overview]
Message-ID: <20090517063234.GA1583@elte.hu> (raw)
In-Reply-To: <1242522109.2635.6.camel@poy>
* Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Sun, 2009-05-17 at 02:15 +0200, Kay Sievers wrote:
> > On Sun, May 17, 2009 at 02:01, Linus Torvalds
> > <torvalds@linux-foundation.org> wrote:
> >
> > > [ 10.428691] Error: Driver 'rtc_cmos' is already registered, aborting...
> > >
> > > but the driver doesn't really care whether that succeeded or not, but then
> > > the platform_driver_probe fails (because the thing is already in use), so
> > > then it ends up unregistering something that never got registered in the
> > > first place.
> > >
> > > I think this is strictly speaking a bug in driver_unregister(), which is
> > > too fragile. If you unregister a drivert that wasn't registered, we
> > > shouldn't oops.
> > >
> > > But we could certainly do it at the rtc-cmos.c level too, and just not
> > > unregister it if the registration failed. My gut feel is that we should
> > > aim for the core driver helpers to be less fragile, though - we'll always
> > > have driver bugs.
> >
> > In:
> > driver_remove_file()
> > we try to access the private part:
> > sysfs_remove_file(&drv->p->kobj, ...
> > and that is NULL, for an unregistered driver, I would expect.
> >
> > I'm looking into it.
>
> This makes the oops in the driver-core, caused by the rtc driver
> unregister, go away. The original issue is also fixed in the rtc driver
> itself.
>
> Thanks,
> Kay
>
>
> From: Kay Sievers <kay.sievers@vrfy.org>
> Subject: Driver Core: do not oops when driver_unregister() is called for unregistered drivers
>
> Handle the case someone tries to unregister a non-registered driver
> more gracefully.
>
> Error: Driver 'rtc_cmos' is already registered, aborting...
> BUG: unable to handle kernel NULL pointer dereference at 00000018
> [<c01e16ba>] sysfs_remove_file+0x1/0xf
>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
please also put in a proper Reported-by.
> ---
>
> driver.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -257,6 +257,8 @@ EXPORT_SYMBOL_GPL(driver_register);
> */
> void driver_unregister(struct device_driver *drv)
> {
> + if (!drv || !drv->p)
> + return;
I think it would be reasonable to also emit a:
WARN_ONCE(1, "unexpected driver unregister!\n");
here - as long as all such cases are a bug. As the imbalance (and a
bug) is really at the rtc-cmos driver level too and we should not
condone such pattern, silently.
( Not crashing in the driver core when we can avoid it is nice to
have too, of course. )
Ingo
next prev parent reply other threads:[~2009-05-17 6:33 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-16 19:14 2.6.30-rc6: Reported regressions from 2.6.29 Rafael J. Wysocki
2009-05-16 19:14 ` [Bug #13068] Lockdep warining in inotify_dev_queue_event Rafael J. Wysocki
2009-05-17 6:35 ` Ingo Molnar
2009-05-17 8:13 ` Sachin Sant
2009-05-17 10:25 ` Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13069] regression in 2.6.29-git3 on SH/Dreamcast Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13116] Can't boot with nosmp Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13118] iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49 Rafael J. Wysocki
2009-05-17 6:06 ` Jeff Chua
2009-05-17 10:26 ` Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13107] LTP 20080131 causes defunct processes w/2.6.30-rc1 Rafael J. Wysocki
2009-05-17 19:13 ` Linus Torvalds
2009-05-18 14:41 ` Oleg Nesterov
2009-05-18 17:54 ` Sukadev Bhattiprolu
2009-05-19 9:16 ` Ingo Molnar
2009-05-19 13:32 ` Oleg Nesterov
2009-05-16 19:20 ` [Bug #13109] High latency on /sys/class/thermal Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13122] reiserfs_delete_xattrs: Couldn't delete all xattrs (-13) Rafael J. Wysocki
2009-05-17 19:16 ` Linus Torvalds
2009-05-17 20:36 ` Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13119] Trouble with make-install from a NFS mount Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13125] active uvcvideo breaks over suspend Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13126] BUG: MAX_LOCKDEP_ENTRIES too low! when mounting rootfs Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13156] keyboard backlight brightness up/down keys doesn't work Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13148] resume after suspend-to-ram broken on Sony Vaio VGN-SR19VN when sony-laptop driver present Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13171] 2.6.30-rc2 + xorg-intel-2.7.0 + DRM_I915_KMS = corruption Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13179] CD-R: wodim intermittent failures Rafael J. Wysocki
2009-05-16 22:51 ` Robert Hancock
2009-05-16 19:20 ` [Bug #13180] 2.6.30-rc2: WARNING at i915_gem.c for i915_gem_idle Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13177] 2.6.30-rc2-git7 build problem Rafael J. Wysocki
2009-05-18 14:05 ` Martin Knoblauch
2009-05-16 19:20 ` [Bug #13245] possible circular locking dependency detected Rafael J. Wysocki
2009-05-17 3:22 ` Ming Lei
2009-05-17 10:26 ` Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13188] horizontal strips of the screen frozen Rafael J. Wysocki
2009-05-18 16:35 ` Justin Madru
2009-05-18 18:03 ` Rafael J. Wysocki
2009-05-18 18:04 ` Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13250] Side channel of Intel HDA chip doesn't work anymore, did work with 2.6.29 Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13293] Kernel BUG under network load with gianfar Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13285] INTELFB: Colors display incorrectly Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13296] Lockdep violation at cleanup_workqueue_thread during suspend Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13294] i915: drm: xorg leaks drm objects massively Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13297] kernel panic - not syncing : fatel exception in interupt Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13306] hibernate slow on _second_ run Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13298] modprobe ipmi_si hangs under 2.6.30-rc5 Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13319] Page allocation failures with b43 and p54usb Rafael J. Wysocki
2009-05-16 23:36 ` Andrew Morton
2009-05-17 23:16 ` Larry Finger
2009-05-18 6:31 ` Pekka Enberg
2009-05-21 13:21 ` Larry Finger
2009-05-16 19:20 ` [Bug #13318] AGP doesn't work anymore on nforce2 Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13324] panic when loading oprofile Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13323] 2.6.30-rc deadline scheduler performance regression for iozone over NFS Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13321] kernel crash with NULL pointer when boot Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13326] Null pointer dereference in rtc-cmos driver Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13327] Regression: 2.6.30-rc5 and rt2x00 / rt2500pci Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13325] 2.6.30-rc kills my box hard - and lockdep chains Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13328] b44: eth0: BUG! Timeout waiting for bit 00000002 of register 42c to clear Rafael J. Wysocki
2009-05-16 19:20 ` [Bug #13329] cifs_close: NULL pointer dereference Rafael J. Wysocki
2009-05-16 23:44 ` 2.6.30-rc6: Reported regressions from 2.6.29 Linus Torvalds
2009-05-17 0:01 ` Linus Torvalds
2009-05-17 0:15 ` Kay Sievers
2009-05-17 1:01 ` Kay Sievers
2009-05-17 2:13 ` Linus Torvalds
2009-05-17 15:33 ` Greg KH
2009-05-18 3:48 ` Greg KH
2009-05-17 6:32 ` Ingo Molnar [this message]
2009-05-17 0:32 ` Ozan Çağlayan
2009-05-17 2:06 ` Linus Torvalds
2009-05-17 7:33 ` Ingo Molnar
2009-05-17 10:34 ` Rafael J. Wysocki
2009-05-17 12:56 ` Stefan Richter
2009-05-17 13:59 ` Jeff Mahoney
2009-05-17 13:32 ` Frederic Weisbecker
2009-05-17 16:19 ` Borislav Petkov
2009-05-18 16:35 ` Bartlomiej Zolnierkiewicz
2009-05-19 6:05 ` Borislav Petkov
2009-05-20 1:14 ` Frederic Weisbecker
2009-05-18 14:57 ` Oleg Nesterov
2009-05-18 15:11 ` Ingo Molnar
2009-05-18 15:31 ` Oleg Nesterov
2009-05-18 15:32 ` Linus Torvalds
2009-05-18 15:45 ` Oleg Nesterov
2009-05-17 17:55 ` Alex Bennee
2009-05-22 16:40 ` Linus Torvalds
2009-05-23 0:10 ` Rafael J. Wysocki
2009-05-25 20:24 ` Frans Pop
2009-05-25 23:02 ` Rafael J. Wysocki
2009-05-26 15:30 ` Frans Pop
2009-05-26 18:48 ` Rafael J. Wysocki
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=20090517063234.GA1583@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=bunk@kernel.org \
--cc=gregkh@suse.de \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=protasnb@gmail.com \
--cc=rjw@sisk.pl \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).