[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [sh_eth.c] Problem in dma_map_single()



On Fri, Apr 15, 2016 at 12:39:42PM +0900, Wonseok Ko wrote:
> ​Hi Konrad,​
> 
> Finally, I can use ethernet :D. It was my mistake. I thought the
> SET_NETDEV_DEV() makes ndev == pdev->dev, but it's not true.
> 
> So I changed the dma configuration from:
> 
> dma_coerce_mask_and_coherent(*&pdev->dev*, DMA_BIT_MASK(32));
> SET_NETDEV_DEV(ndev, &pdev->dev);
> 
> 
> to:
> 
> dma_coerce_mask_and_coherent(*&ndev->dev*, DMA_BIT_MASK(32));
> SET_NETDEV_DEV(ndev, &pdev->dev);
> 
> 
> and then sh_eth works.
> 
> However I wanted to set dma_mask in pdev, I just thought about the original
> data have a mask bit.
> Do you know how do I set dma_mask in pdev?

That is some weird propogation. Is the pdev->dev the same as ndev->dev?

> Thank you for your help!
> 
> Thanks,
> Wonseok.
> 
> 
> Thanks,
> Wonseok.
> 
> 2016-04-14 22:52 GMT+09:00 Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>:
> 
> > On Wed, Apr 13, 2016 at 02:18:09PM +0900, Wonseok Ko wrote:
> > > Hi Konrad,
> > >
> > > In dma_capable(), it checks that mask, size and address of device.
> > >
> > > Currently, it dosen't pass to first condition code as below:
> > >
> > > if (!dev->dma_mask)
> > >
> > >                 return 0;
> > >
> > > It shows the device doesn't have dma_mask bit. So I tried to set the
> > > dma_mask bit in sh_eth.c
> > >
> > > My approaches:
> > > 1. I tried to set a mask bit(dev->dma_mask) to use
> > > dma_coerce_mask_and_coherent()
> > > in sh_eth_drv_probe(), but it doesn't work.
> >
> > Are there any errors? What does dma_mask end up being?
> > > 2. forced set dev->dma_mask without kernel api. I passed to dma_capable()
> > > but driver cannot work.
> >
> > Aha, what did you set it to? Do you have a diff?
> > >
> > > sh_eth driver want to get valid DMA descriptor to set DMA descriptor
> > > address for Rx and Tx.
> >
> > Right, which it would plug in its driver registers so the card
> > can pick it up.
> > > I tried to set the some bits(such as dma_mask) to get valid dma address
> > > forcibly, in this configuration sh_eth cannot work.
> >
> > Uh, not sure I understand. Or are you repeating what you mentioned
> > earlier?
> > >
> > > My question is if I want to get valid dma address with xen swiotlb(suchas
> > > map_page, set_dma_mask and so on)?
> >
> > Well it all should work just fine - perhaps if you provide some
> > diff's and such I can help you along?
> >
> > >
> > >
> > >
> > >
> > > Thanks,
> > > Wonseok.
> > >
> > > 2016-04-13 2:10 GMT+09:00 Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx
> > >:
> > >
> > > > On Tue, Apr 12, 2016 at 04:54:55PM +0900, Wonseok Ko wrote:
> > > > > Hi,
> > > > >
> > > > > I'm trying to enable ethernet driver in Domain0 for R-Car H2, but it
> > > > > doesn't work. The root cause of the problem is that driver cannot
> > satisfy
> > > > > the condition of dma_capable(). I found the same problem in the
> > mailing
> > > >
> > > > So what can be done about making it dma_capable() ?
> > > >
> > > > > list, but the problem is still remaining I guess. previous mail: (
> > > > > http://lists.xen.org/archives/html/xen-devel/2014-10/msg03170.html)
> > > > >
> > > > > Does anyone give me advise?
> > > > >
> > > > > My environment as below:
> > > > > - dom0 linux version: 4.3
> > > > > - xen version: 4.6 commit(40d7a7454835c2f7c639c78f6c09e7b6f0e4a4e2)
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Wonseok.
> > > >
> > > > > _______________________________________________
> > > > > Xen-devel mailing list
> > > > > Xen-devel@xxxxxxxxxxxxx
> > > > > http://lists.xen.org/xen-devel
> > > >
> > > >
> >

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.