From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Wonseok Ko <magicyaba@gmail.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [sh_eth.c] Problem in dma_map_single()
Date: Tue, 17 May 2016 17:10:11 -0400 [thread overview]
Message-ID: <20160517211011.GE7179@char.us.oracle.com> (raw)
In-Reply-To: <CACFf9OEOWuj4bVvNObHmktiohXVsqpCPHCSFAL4hNBiE+qd3bw@mail.gmail.com>
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@oracle.com>:
>
> > 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@oracle.com
> > >:
> > >
> > > > 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@lists.xen.org
> > > > > http://lists.xen.org/xen-devel
> > > >
> > > >
> >
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-05-17 21:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 7:54 [sh_eth.c] Problem in dma_map_single() Wonseok Ko
2016-04-12 16:35 ` Julien Grall
2016-04-12 17:10 ` Konrad Rzeszutek Wilk
2016-04-13 5:18 ` Wonseok Ko
2016-04-14 13:52 ` Konrad Rzeszutek Wilk
2016-04-15 3:39 ` Wonseok Ko
2016-05-17 21:10 ` Konrad Rzeszutek Wilk [this message]
2016-05-23 16:06 ` Wonseok Ko
2016-04-14 7:12 ` Wonseok Ko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160517211011.GE7179@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=magicyaba@gmail.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.