[PATCH] powerpc: Fix ide-pmac sysfs entry

Andrew Morton akpm at osdl.org
Mon May 15 17:08:10 EST 2006


Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:
>
> It looks like the generic ide code now wants ide_init_hwif_ports() to
> set the parent struct device into the ide_hw structure (new field ?).
> Without this, the mac ide code can cause the ide probing code to explode
> in flames in sysfs registration due to what looks like a stale pointer
> in there (happens when removing/re-inserting one of the hotswap media
> bays on some laptops).
> 

You don't sound very confident.

> ---
> 
> Andew: That's a 2.6.17 candidate 
> 
> Index: linux-work/drivers/ide/ppc/pmac.c
> ===================================================================
> --- linux-work.orig/drivers/ide/ppc/pmac.c	2006-04-19 15:04:47.000000000 +1000
> +++ linux-work/drivers/ide/ppc/pmac.c	2006-05-15 16:43:20.000000000 +1000
> @@ -553,6 +553,8 @@
>  
>  	if (irq != NULL)
>  		*irq = pmac_ide[ix].irq;
> +
> +	hw->dev = &pmac_ide[ix].mdev->ofdev.dev;
>  }
>  
>  #define PMAC_IDE_REG(x) ((void __iomem *)(IDE_DATA_REG+(x)))
>  

afaict things went bad in October last year.  hw_regs_t.dev was added here:

http://www.kernel.org/git/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=26a940e21752e0de8f068f77dad606a7d1986937

but that only converted one driver to initialse ->dev.

How come things didn't break then?  Did some later change cause the
problems?




More information about the Linuxppc-dev mailing list