lkml.org 
[lkml]   [2006]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: sdhci driver produces kernel oops on ejecting the card
--- Russell King <rmk+lkml@arm.linux.org.uk> wrote:

> So the
> only place for sane
> refcounting seems to be genhd.c, as per the patch
> below.
>
> Comments?
>
> diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x
> *.orig -x *.rej -x .git a/block/genhd.c
> b/block/genhd.c
> --- a/block/genhd.c Sat Feb 18 10:31:37 2006
> +++ b/block/genhd.c Fri Apr 7 15:22:21 2006
> @@ -262,6 +262,7 @@ static int exact_lock(dev_t dev,
> void *d
> */
> void add_disk(struct gendisk *disk)
> {
> + get_device(disk->driverfs_dev);
> disk->flags |= GENHD_FL_UP;
> blk_register_region(MKDEV(disk->major,
> disk->first_minor),
> disk->minors, NULL, exact_match, exact_lock,
> disk);
> @@ -507,6 +508,7 @@ static struct attribute *
> default_attrs[
> static void disk_release(struct kobject * kobj)
> {
> struct gendisk *disk = to_disk(kobj);
> + put_device(disk->driverfs_dev);
> kfree(disk->random);
> kfree(disk->part);
> free_disk_stats(disk);

I can confirm that this patch is working.
The 2.6.16-git20 kernel doesn't oops on
ejecting the card after the patch is applied.

Mikkel


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-04-07 22:32    [W:0.043 / U:3.268 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site