[PATCH v2 3/3] dma: Add Freescale eDMA engine driver support

Vinod Koul vinod.koul at intel.com
Mon Aug 5 11:45:51 EDT 2013


On Mon, Aug 05, 2013 at 09:53:45AM +0200, Lothar Waßmann wrote:
> Hi,
> 
> Jingchang Lu writes:
> > Add Freescale enhanced direct memory(eDMA) controller support.
> > The eDMA controller deploys DMAMUXs routing DMA request sources(slot)
> > to eDMA channels.
> > This module can be found on Vybrid and LS-1 SoCs.
> > 
> [...]
> > +static struct fsl_edma_desc *fsl_edma_alloc_desc(struct fsl_edma_chan *fsl_chan,
> > +		int sg_len)
> > +{
> > +	struct fsl_edma_desc *fsl_desc;
> > +	int size, i;
> > +
> > +	size = sizeof(struct fsl_edma_desc);
> > +	size += sizeof(struct fsl_edma_sw_tcd) * sg_len;
> > +	fsl_desc = kzalloc(size, GFP_KERNEL);
> > +	if (!fsl_desc)
> > +		return NULL;
> > +
> > +	fsl_desc->echan = fsl_chan;
> > +	fsl_desc->n_tcds = sg_len;
> > +	for (i = 0; i < sg_len; i++) {
> > +		fsl_desc->tcd[i].vtcd = dma_pool_alloc(fsl_chan->tcd_pool,
> > +					GFP_ATOMIC, &fsl_desc->tcd[i].ptcd);
> >
> Why is this called with GFP_ATOMIC while fsl_desc above is being
> allocated with GFP_KERNEL?
Both need to be GFP_ATOMIC, better they need to be GFP_NOWAIT.

~Vinod



More information about the linux-arm-kernel mailing list