Hi Bhaskar,

You can not do DMA with a pseudo device. The call to ddi_dma_alloc_handle(9f) calls into the nexus driver above the device. The nexus driver for pseudo devices does not support DMA. What are you trying to accomplish with your pseudo device that
makes you think you need to do DMA?

max

Jayaraman, Bhaskar wrote:
Max yes I'm assigning smu_generic_dma_attr to tmp_dma_attr before making the 
call. I've tried a bunch of things like changing the attributes but I still 
keep getting the error. Would switching to DDI_DMA_FORCE_PHYSICAL be advised? 
Since I'm writing this driver for a pseudo device I'm sure IOMMU virtual 
addresses won't be used.
Bhaskar.

-----Original Message-----
From: m...@bruningsystems.com [mailto:m...@bruningsystems.com] Sent: Friday, November 13, 2009 4:01 PM
To: Jayaraman, Bhaskar
Cc: opensolaris-code@opensolaris.org
Subject: Re: [osol-code] DDI_DMA_BADATTR error!

Hi Bhaskar,

Jayaraman, Bhaskar wrote:
Hi I'm using an x86 vm which has an emulated IOMMU on it. The following are the 
attributes that I'm passing to ddi_dma_alloc_handle

static ddi_dma_attr_t smu_generic_dma_attr = {
        DMA_ATTR_V0,                                    /* dma_attr_version */
        (unsigned long long)0,                          /* low DMA address 
range */
        (unsigned long long)0xffffffff,  /* high DMA address range */
        (unsigned long long)0xffffffff, /* DMA counter register */
         8,   /* DMA address alignment */
        0x07, /* DMA burstsizes  */
        1, /* min DMA size */
        (unsigned long long)0xffffffff, /* max DMA size */
        (unsigned long long)0xffffffff, /* segment boundary */
        16, /* dma_attr_sglen */
        512, /* granularity of device */
        0 /* bus specific DMA flags */
};

The call I make is ddi_dma_alloc_handle (instance->dip, &tmp_dma_attr, 
DDI_DMA_DONTWAIT, 0, &acmd->cmd_dmahandle)
I assume you are assigning tmp_dma_attr to smu_generic_dma_attr before
making this call?  What happens if you pass &smu_generic_dma_attr instead
of &tmp_dma_attr?

max

In the 3rd parameter, I've tried using DDI_DMA_SLEEP as well but I still get 
the DDI_DMA_BADATTR error from the API.

I don't see where I'm going wrong in making the call.

Regards,
Bhaskar.

------------------------------------------------------------------------

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code



_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to