dma process doesnt start - Linux

This is a discussion on dma process doesnt start - Linux ; I was writing a driver for a fpga pci card. The driver is working fine. Now if I wish to do dma then there is no activity shown by the card as well as the kernel. The datasheet for the ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: dma process doesnt start

  1. dma process doesnt start

    I was writing a driver for a fpga pci card. The driver is working
    fine. Now if I wish to do dma then there is no activity shown by the
    card as well as the kernel. The datasheet for the bridge on the card
    states that the GO bit in the control ststus bit should be given high
    and the bytecount should be specified. I did everything as mentioned in
    the manual. The interrupt handler is called ( since the card shares the
    interrupts with others). however the control status register shows that
    the 'go' bit is turned back to 0 and the register has all 0's in it.
    The manual states that once the dma is done the processor will be
    interrupted with a bit set ( done bit, errror bit or halt bit) in the
    control and status register. However nothing of this sort happens and
    the register goes to 0 .
    I debugged using my program on fpga and it shows me that the dma
    process doesnt start at all inspte of setting up the GO bit.
    Any ideas?
    Dh


  2. Re: dma process doesnt start

    I am not sure what you manual exactly says. But my experience is
    sometimes manual have some errors. I faced this while I was writing
    driver for a company. There were 2 bits to be held high but only
    one was given in the document. Cross questioning the engineers
    revealed the truth. Sometime the writing delays also play important
    role in such conditions.

    --Himanshu


    dhruvakshad@gmail.com wrote:
    > I was writing a driver for a fpga pci card. The driver is working
    > fine. Now if I wish to do dma then there is no activity shown by the
    > card as well as the kernel. The datasheet for the bridge on the card
    > states that the GO bit in the control ststus bit should be given high
    > and the bytecount should be specified. I did everything as mentioned in
    > the manual. The interrupt handler is called ( since the card shares the
    > interrupts with others). however the control status register shows that
    > the 'go' bit is turned back to 0 and the register has all 0's in it.
    > The manual states that once the dma is done the processor will be
    > interrupted with a bit set ( done bit, errror bit or halt bit) in the
    > control and status register. However nothing of this sort happens and
    > the register goes to 0 .
    > I debugged using my program on fpga and it shows me that the dma
    > process doesnt start at all inspte of setting up the GO bit.
    > Any ideas?
    > Dh
    >



    --
    ----------------------------------------
    Himanshu Chauhan
    MCA (Final Year)
    I.G. National Open University
    Jaipur (India)

    Mobile+91)-(98292)-(92757)
    Web: http://members.lycos.co.uk/hschauhan
    Email: hs.chauhan@gmail.com

    "Education is what remains after one
    has forgotten everything he learned
    in school." -- A. Einstein.
    ----------------------------------------

  3. Re: dma process doesnt start

    I allocated dma memory and then passed the physical address of the dma
    buffer to the card.


    struct priv{
    ........
    dma_addr_t phy_addr;
    struct pci_dev *pdev
    .......
    }

    np->bbuf= pci_alloc_consistent(pdev,4096,&np->phy_addr);

    The value np->phy_addr could it be passed as the physical address to
    the card for doing the dma ?

    iowrite32(np->phy_addr,DEST_ADDRESS);

    Does it look ok?
    Dh





    Himanshu Chauhan wrote:
    > I am not sure what you manual exactly says. But my experience is
    > sometimes manual have some errors. I faced this while I was writing
    > driver for a company. There were 2 bits to be held high but only
    > one was given in the document. Cross questioning the engineers
    > revealed the truth. Sometime the writing delays also play important
    > role in such conditions.
    >
    > --Himanshu
    >
    >
    > dhruvakshad@gmail.com wrote:
    > > I was writing a driver for a fpga pci card. The driver is working
    > > fine. Now if I wish to do dma then there is no activity shown by the
    > > card as well as the kernel. The datasheet for the bridge on the card
    > > states that the GO bit in the control ststus bit should be given high
    > > and the bytecount should be specified. I did everything as mentioned in
    > > the manual. The interrupt handler is called ( since the card shares the
    > > interrupts with others). however the control status register shows that
    > > the 'go' bit is turned back to 0 and the register has all 0's in it.
    > > The manual states that once the dma is done the processor will be
    > > interrupted with a bit set ( done bit, errror bit or halt bit) in the
    > > control and status register. However nothing of this sort happens and
    > > the register goes to 0 .
    > > I debugged using my program on fpga and it shows me that the dma
    > > process doesnt start at all inspte of setting up the GO bit.
    > > Any ideas?
    > > Dh
    > >

    >
    >
    > --
    > ----------------------------------------
    > Himanshu Chauhan
    > MCA (Final Year)
    > I.G. National Open University
    > Jaipur (India)
    >
    > Mobile+91)-(98292)-(92757)
    > Web: http://members.lycos.co.uk/hschauhan
    > Email: hs.chauhan@gmail.com
    >
    > "Education is what remains after one
    > has forgotten everything he learned
    > in school." -- A. Einstein.
    > ----------------------------------------



  4. Re: dma process doesnt start

    dhruvakshad@gmail.com wrote:
    > I allocated dma memory and then passed the physical address of the dma
    > buffer to the card.
    >
    >
    > struct priv{
    > .......
    > dma_addr_t phy_addr;
    > struct pci_dev *pdev
    > ......
    > }
    >
    > np->bbuf= pci_alloc_consistent(pdev,4096,&np->phy_addr);


    It seems ok to me except pci_alloc_consistent(pdev, 4096, &np->phy_addr)
    should have been pci_alloc_consisten(np->pdev, 4096, &np->phy_addr)
    I think you might have done this way.

    >
    > The value np->phy_addr could it be passed as the physical address to
    > the card for doing the dma ?
    >
    > iowrite32(np->phy_addr,DEST_ADDRESS);


    What are you exactly trying to do here? I can't make out. DEST_ADDRESS??
    writing physical address where?


    --Himanshu

    >
    > Does it look ok?
    > Dh
    >
    >
    >
    >
    >
    > Himanshu Chauhan wrote:
    >> I am not sure what you manual exactly says. But my experience is
    >> sometimes manual have some errors. I faced this while I was writing
    >> driver for a company. There were 2 bits to be held high but only
    >> one was given in the document. Cross questioning the engineers
    >> revealed the truth. Sometime the writing delays also play important
    >> role in such conditions.
    >>
    >> --Himanshu
    >>
    >>
    >> dhruvakshad@gmail.com wrote:
    >>> I was writing a driver for a fpga pci card. The driver is working
    >>> fine. Now if I wish to do dma then there is no activity shown by the
    >>> card as well as the kernel. The datasheet for the bridge on the card
    >>> states that the GO bit in the control ststus bit should be given high
    >>> and the bytecount should be specified. I did everything as mentioned in
    >>> the manual. The interrupt handler is called ( since the card shares the
    >>> interrupts with others). however the control status register shows that
    >>> the 'go' bit is turned back to 0 and the register has all 0's in it.
    >>> The manual states that once the dma is done the processor will be
    >>> interrupted with a bit set ( done bit, errror bit or halt bit) in the
    >>> control and status register. However nothing of this sort happens and
    >>> the register goes to 0 .
    >>> I debugged using my program on fpga and it shows me that the dma
    >>> process doesnt start at all inspte of setting up the GO bit.
    >>> Any ideas?
    >>> Dh
    >>>


    --
    ----------------------------------------
    Himanshu Chauhan
    MCA (Final Year)
    I.G. National Open University
    Jaipur (India)

    Mobile+91)-(98292)-(92757)
    Web: http://members.lycos.co.uk/hschauhan
    Email: hs.chauhan@gmail.com

    "Education is what remains after one
    has forgotten everything he learned
    in school." -- A. Einstein.
    ----------------------------------------

  5. Re: dma process doesnt start

    hi himanshu,
    Thanks a lot.I was giving in a wrong source address and hence it caused
    a whole lot of confusion.Its working now.
    Dh


    Himanshu Chauhan wrote:
    > dhruvakshad@gmail.com wrote:
    > > I allocated dma memory and then passed the physical address of the dma
    > > buffer to the card.
    > >
    > >
    > > struct priv{
    > > .......
    > > dma_addr_t phy_addr;
    > > struct pci_dev *pdev
    > > ......
    > > }
    > >
    > > np->bbuf= pci_alloc_consistent(pdev,4096,&np->phy_addr);

    >
    > It seems ok to me except pci_alloc_consistent(pdev, 4096, &np->phy_addr)
    > should have been pci_alloc_consisten(np->pdev, 4096, &np->phy_addr)
    > I think you might have done this way.
    >
    > >
    > > The value np->phy_addr could it be passed as the physical address to
    > > the card for doing the dma ?
    > >
    > > iowrite32(np->phy_addr,DEST_ADDRESS);

    >
    > What are you exactly trying to do here? I can't make out. DEST_ADDRESS??
    > writing physical address where?
    >
    >
    > --Himanshu
    >
    > >
    > > Does it look ok?
    > > Dh
    > >
    > >
    > >
    > >
    > >
    > > Himanshu Chauhan wrote:
    > >> I am not sure what you manual exactly says. But my experience is
    > >> sometimes manual have some errors. I faced this while I was writing
    > >> driver for a company. There were 2 bits to be held high but only
    > >> one was given in the document. Cross questioning the engineers
    > >> revealed the truth. Sometime the writing delays also play important
    > >> role in such conditions.
    > >>
    > >> --Himanshu
    > >>
    > >>
    > >> dhruvakshad@gmail.com wrote:
    > >>> I was writing a driver for a fpga pci card. The driver is working
    > >>> fine. Now if I wish to do dma then there is no activity shown by the
    > >>> card as well as the kernel. The datasheet for the bridge on the card
    > >>> states that the GO bit in the control ststus bit should be given high
    > >>> and the bytecount should be specified. I did everything as mentioned in
    > >>> the manual. The interrupt handler is called ( since the card shares the
    > >>> interrupts with others). however the control status register shows that
    > >>> the 'go' bit is turned back to 0 and the register has all 0's in it.
    > >>> The manual states that once the dma is done the processor will be
    > >>> interrupted with a bit set ( done bit, errror bit or halt bit) in the
    > >>> control and status register. However nothing of this sort happens and
    > >>> the register goes to 0 .
    > >>> I debugged using my program on fpga and it shows me that the dma
    > >>> process doesnt start at all inspte of setting up the GO bit.
    > >>> Any ideas?
    > >>> Dh
    > >>>

    >
    > --
    > ----------------------------------------
    > Himanshu Chauhan
    > MCA (Final Year)
    > I.G. National Open University
    > Jaipur (India)
    >
    > Mobile+91)-(98292)-(92757)
    > Web: http://members.lycos.co.uk/hschauhan
    > Email: hs.chauhan@gmail.com
    >
    > "Education is what remains after one
    > has forgotten everything he learned
    > in school." -- A. Einstein.
    > ----------------------------------------



  6. Re: dma process doesnt start

    Happy to be of some help. Anytime.

    --Himanshu


    dhruvakshad@gmail.com wrote:
    > hi himanshu,
    > Thanks a lot.I was giving in a wrong source address and hence it caused
    > a whole lot of confusion.Its working now.
    > Dh
    >
    >
    > Himanshu Chauhan wrote:
    >> dhruvakshad@gmail.com wrote:
    >>> I allocated dma memory and then passed the physical address of the dma
    >>> buffer to the card.
    >>>
    >>>
    >>> struct priv{
    >>> .......
    >>> dma_addr_t phy_addr;
    >>> struct pci_dev *pdev
    >>> ......
    >>> }
    >>>
    >>> np->bbuf= pci_alloc_consistent(pdev,4096,&np->phy_addr);

    >> It seems ok to me except pci_alloc_consistent(pdev, 4096, &np->phy_addr)
    >> should have been pci_alloc_consisten(np->pdev, 4096, &np->phy_addr)
    >> I think you might have done this way.
    >>
    >>> The value np->phy_addr could it be passed as the physical address to
    >>> the card for doing the dma ?
    >>>
    >>> iowrite32(np->phy_addr,DEST_ADDRESS);

    >> What are you exactly trying to do here? I can't make out. DEST_ADDRESS??
    >> writing physical address where?
    >>
    >>
    >> --Himanshu
    >>
    >>> Does it look ok?
    >>> Dh
    >>>
    >>>
    >>>
    >>>
    >>>
    >>> Himanshu Chauhan wrote:
    >>>> I am not sure what you manual exactly says. But my experience is
    >>>> sometimes manual have some errors. I faced this while I was writing
    >>>> driver for a company. There were 2 bits to be held high but only
    >>>> one was given in the document. Cross questioning the engineers
    >>>> revealed the truth. Sometime the writing delays also play important
    >>>> role in such conditions.
    >>>>
    >>>> --Himanshu
    >>>>
    >>>>
    >>>> dhruvakshad@gmail.com wrote:
    >>>>> I was writing a driver for a fpga pci card. The driver is working
    >>>>> fine. Now if I wish to do dma then there is no activity shown by the
    >>>>> card as well as the kernel. The datasheet for the bridge on the card
    >>>>> states that the GO bit in the control ststus bit should be given high
    >>>>> and the bytecount should be specified. I did everything as mentioned in
    >>>>> the manual. The interrupt handler is called ( since the card shares the
    >>>>> interrupts with others). however the control status register shows that
    >>>>> the 'go' bit is turned back to 0 and the register has all 0's in it.
    >>>>> The manual states that once the dma is done the processor will be
    >>>>> interrupted with a bit set ( done bit, errror bit or halt bit) in the
    >>>>> control and status register. However nothing of this sort happens and
    >>>>> the register goes to 0 .
    >>>>> I debugged using my program on fpga and it shows me that the dma
    >>>>> process doesnt start at all inspte of setting up the GO bit.
    >>>>> Any ideas?
    >>>>> Dh
    >>>>>



    --
    ----------------------------------------
    Himanshu Chauhan
    MCA (Final Year)
    I.G. National Open University
    Jaipur (India)

    Mobile+91)-(98292)-(92757)
    Web: http://members.lycos.co.uk/hschauhan
    Email: hs.chauhan@gmail.com

    "Education is what remains after one
    has forgotten everything he learned
    in school." -- A. Einstein.
    ----------------------------------------

+ Reply to Thread