Re: [PATCH] 460EX on-chip SATA driver<kernel 2.6.33> <resubmission : 02>

From: Benjamin Herrenschmidt
Date: Wed Apr 07 2010 - 03:42:23 EST


On Tue, 2010-04-06 at 11:16 -0400, Jeff Garzik wrote:
> > +static irqreturn_t dma_dwc_interrupt(int irq, void *hsdev_instance)
> > +{
> > + int chan;
> > + u32 tfr_reg, err_reg;
> > +
> > + struct sata_dwc_device *hsdev =
> > + (struct sata_dwc_device *) hsdev_instance;
> > + struct ata_host *host = (struct ata_host *) hsdev->host;
> > + struct ata_port *ap;
> > + struct sata_dwc_device_port *hsdevp;
> > + u8 tag = 0;
> > + unsigned int port = 0;
> > + struct sata_dwc_host_priv *hp;
> > + hp = kmalloc(sizeof(*hp), GFP_KERNEL);
>
> 1) interrupt is not GFP_KERNEL
>
> 2) you must failure kmalloc failure
>
> 3) it is not clear to me where you initialize this structure???

And why the heck would you want to allocate it at interrupt time ? ? ?

BTW. Stefan mentioned earlier that they had some fixes for that driver
in the Denx tree. Are those fixes now included in that variant ?

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/