From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wonseok Ko Subject: [sh_eth.c] Problem in dma_map_single() Date: Tue, 12 Apr 2016 16:54:55 +0900 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1356224798078529198==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============1356224798078529198== Content-Type: multipart/alternative; boundary=bcaec50407a020cfd3053044fab7 --bcaec50407a020cfd3053044fab7 Content-Type: text/plain; charset=UTF-8 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 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. --bcaec50407a020cfd3053044fab7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I'm trying to enable ether= net 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 list, but the problem is still r= emaining I guess. previous mail: (http://lists.xen.org/archives/html/xe= n-devel/2014-10/msg03170.html)

Does anyone give m= e advise?

My environment as below:
- dom0 linu= x version: 4.3
- xen version: 4.6 commit(40d7a7454835c2f7c639c78f6c09e7b6f0e4a4e2)


Thanks,
Wonseok.
--bcaec50407a020cfd3053044fab7-- --===============1356224798078529198== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============1356224798078529198==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Tue, 12 Apr 2016 17:35:24 +0100 Message-ID: <570D23CC.30908@arm.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wonseok Ko , xen-devel@lists.xen.org Cc: sstabellini@kernel.org List-Id: xen-devel@lists.xenproject.org KENDIFN0ZWZhbm8gYW5kIEtvbnJhZCkKCk9uIDEyLzA0LzIwMTYgMDg6NTQsIFdvbnNlb2sgS28g d3JvdGU6Cj4gSGksCj4KPiBJJ20gdHJ5aW5nIHRvIGVuYWJsZSBldGhlcm5ldCBkcml2ZXIgaW4g RG9tYWluMCBmb3IgUi1DYXIgSDIsIGJ1dCBpdAo+IGRvZXNuJ3Qgd29yay4gVGhlIHJvb3QgY2F1 c2Ugb2YgdGhlIHByb2JsZW0gaXMgdGhhdCBkcml2ZXIgY2Fubm90Cj4gc2F0aXNmeSB0aGUgY29u ZGl0aW9uIG9mIGRtYV9jYXBhYmxlKCkuIEkgZm91bmQgdGhlIHNhbWUgcHJvYmxlbSBpbiB0aGUK PiBtYWlsaW5nIGxpc3QsIGJ1dCB0aGUgcHJvYmxlbSBpcyBzdGlsbCByZW1haW5pbmcgSSBndWVz cy4gcHJldmlvdXMgbWFpbDoKPiAoaHR0cDovL2xpc3RzLnhlbi5vcmcvYXJjaGl2ZXMvaHRtbC94 ZW4tZGV2ZWwvMjAxNC0xMC9tc2cwMzE3MC5odG1sKQo+Cj4gRG9lcyBhbnlvbmUgZ2l2ZSBtZSBh ZHZpc2U/Cj4KPiBNeSBlbnZpcm9ubWVudCBhcyBiZWxvdzoKPiAtIGRvbTAgbGludXggdmVyc2lv bjogNC4zCj4gLSB4ZW4gdmVyc2lvbjogNC42IGNvbW1pdCg0MGQ3YTc0NTQ4MzVjMmY3YzYzOWM3 OGY2YzA5ZTdiNmYwZTRhNGUyKQo+Cj4KPiBUaGFua3MsCj4gV29uc2Vvay4KPgo+Cj4gX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KPiBYZW4tZGV2ZWwgbWFp bGluZyBsaXN0Cj4gWGVuLWRldmVsQGxpc3RzLnhlbi5vcmcKPiBodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwKPgoKLS0gCkp1bGllbiBHcmFsbAoKX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxA bGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Tue, 12 Apr 2016 13:10:33 -0400 Message-ID: <20160412171033.GB5771@char.us.oracle.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wonseok Ko Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org T24gVHVlLCBBcHIgMTIsIDIwMTYgYXQgMDQ6NTQ6NTVQTSArMDkwMCwgV29uc2VvayBLbyB3cm90 ZToKPiBIaSwKPiAKPiBJJ20gdHJ5aW5nIHRvIGVuYWJsZSBldGhlcm5ldCBkcml2ZXIgaW4gRG9t YWluMCBmb3IgUi1DYXIgSDIsIGJ1dCBpdAo+IGRvZXNuJ3Qgd29y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Wonseok Ko Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Wed, 13 Apr 2016 14:18:09 +0900 Message-ID: References: <20160412171033.GB5771@char.us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0788764512653556318==" Return-path: In-Reply-To: <20160412171033.GB5771@char.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============0788764512653556318== Content-Type: multipart/alternative; boundary=001a1141c8d44c58cd053056e797 --001a1141c8d44c58cd053056e797 Content-Type: text/plain; charset=UTF-8 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. 2. forced set dev->dma_mask without kernel api. I passed to dma_capable() but driver cannot work. sh_eth driver want to get valid DMA descriptor to set DMA descriptor address for Rx and Tx. I tried to set the some bits(such as dma_mask) to get valid dma address forcibly, in this configuration sh_eth cannot work. My question is if I want to get valid dma address with xen swiotlb(suchas map_page, set_dma_mask and so on)? Thanks, Wonseok. 2016-04-13 2:10 GMT+09:00 Konrad Rzeszutek Wilk : > 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 > > --001a1141c8d44c58cd053056e797 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Konrad,

In dma_capable(), it ch= ecks that mask, size and address of device.=C2=A0

Curr= ently, it dosen't pass to first condition code as below:

if (!dev->dma_mask)

=

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 return 0;

It shows the device doesn't have dma_mask bit. So I tried to s= et the dma_mask bit in sh_eth.c

My approaches:
1. I tried to set a mask bit(dev->dma_mask) to use=C2=A0dma_coerce_mask_and_coherent() in= =C2=A0sh_eth_drv_probe(= ), but it doesn't work.
2. forced set dev->dma_mask = without kernel api. I passed to dma_capable() but driver cannot work.
=

sh_eth driver want to get valid DMA descriptor to set DMA d= escriptor address for Rx and Tx.
I tried to set the some bits(such = as dma_mask) to get valid dma address forcibly, in this configuration sh_et= h cannot work.

My question is if I want to get valid d= ma address with xen swiotlb(suchas map_page, set_dma_mask and so on)?
=




Thanks,
Wonseok.

2016-04-13 2:10 GMT+09:00 Konrad Rzeszutek W= ilk <konrad.wilk@oracle.com>:
On Tue, Apr 12, 2016 at 04:54:55PM +0900, Wonseo= k 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 mailin= g

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


--001a1141c8d44c58cd053056e797-- --===============0788764512653556318== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============0788764512653556318==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wonseok Ko Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Thu, 14 Apr 2016 07:12:23 +0000 (UTC) Message-ID: References: <20160412171033.GB5771@char.us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8134938027751053443==" Return-path: In-Reply-To: <20160412171033.GB5771@char.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============8134938027751053443== Content-Type: multipart/alternative; boundary="----=_Part_9020_1703647250.1460617943346" ------=_Part_9020_1703647250.1460617943346 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Konrad, Did you read the reply? How do I fix it? Thanks,Wonseok Sent from Outlook Mobile On Tue, Apr 12, 2016 at 10:10 AM -0700, "Konrad Rzeszutek Wilk" wrote: 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 ------=_Part_9020_1703647250.1460617943346 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Hi Konrad,

Did you read the reply? How do I fix it?

Thanks,
Wonseok

Sent from Outlook Mobile




On Tue, Apr 12, 2016 at 10:10 AM -0700, "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com> wrote:

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

------=_Part_9020_1703647250.1460617943346-- --===============8134938027751053443== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============8134938027751053443==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Thu, 14 Apr 2016 09:52:44 -0400 Message-ID: <20160414135244.GA2569@char.us.oracle.com> References: <20160412171033.GB5771@char.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wonseok Ko Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org T24gV2VkLCBBcHIgMTMsIDIwMTYgYXQgMDI6MTg6MDlQTSArMDkwMCwgV29uc2VvayBLbyB3cm90 ZToKPiBIaSBLb25yYWQsCj4gCj4gSW4gZG1hX2NhcGFibGUoKSwgaXQgY2hlY2tzIHRoYXQgbWFz aywgc2l6ZSBhbmQgYWRkcmVzcyBvZiBkZXZpY2UuCj4gCj4gQ3VycmVudGx5LCBpdCBkb3Nlbid0 IHBhc3MgdG8gZmlyc3QgY29uZGl0aW9uIGNvZGUgYXMgYmVsb3c6Cj4gCj4gaWYgKCFkZXYtPmRt YV9tYXNrKQo+IAo+ICAgICAgICAgICAgICAgICByZXR1cm4gMDsKPiAKPiBJdCBzaG93cyB0aGUg ZGV2aWNlIGRvZXNuJ3QgaGF2ZSBkbWFfbWFzayBiaXQuIFNvIEkgdHJpZWQgdG8gc2V0IHRoZQo+ IGRtYV9tYXNrIGJpdCBpbiBzaF9ldGguYwo+IAo+IE15IGFwcHJvYWNoZXM6Cj4gMS4gSSB0cmll ZCB0byBzZXQgYSBtYXNrIGJpdChkZXYtPmRtYV9tYXNrKSB0byB1c2UKPiBkbWFfY29lcmNlX21h c2tfYW5kX2NvaGVyZW50KCkKPiBpbiBzaF9ldGhfZHJ2X3Byb2JlKCksIGJ1dCBpdCBkb2Vzbid0 IHdvcmsuCgpBcmUgdGhlcmUgYW55IGVycm9ycz8gV2hhdCBkb2VzIGRtYV9tYXNrIGVuZCB1cCBi ZWluZz8KPiAyLiBmb3JjZWQgc2V0IGRldi0+ZG1hX21hc2sgd2l0aG91dCBrZXJuZWwgYXBpLi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X19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18KPiA+ID4gWGVuLWRldmVsIG1haWxpbmcgbGlz dAo+ID4gPiBYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwo+ID4gPiBodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwKPiA+Cj4gPgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX18KWGVuLWRldmVsIG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9y ZwpodHRwOi8vbGlzdHMueGVuLm9yZy94ZW4tZGV2ZWwK From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wonseok Ko Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Fri, 15 Apr 2016 12:39:42 +0900 Message-ID: References: <20160412171033.GB5771@char.us.oracle.com> <20160414135244.GA2569@char.us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6655687755066490904==" Return-path: In-Reply-To: <20160414135244.GA2569@char.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============6655687755066490904== Content-Type: multipart/alternative; boundary=14dae93a0ffde5cabc05307dc26f --14dae93a0ffde5cabc05307dc26f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E2=80=8BHi Konrad,=E2=80=8B Finally, I can use ethernet :D. It was my mistake. I thought the SET_NETDEV_DEV() makes ndev =3D=3D 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? Thank you for your help! Thanks, Wonseok. Thanks, Wonseok. 2016-04-14 22:52 GMT+09:00 Konrad Rzeszutek Wilk : > 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(such= as > > 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 >: > > > > > 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 i= t > > > > 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 > > > > > > > --14dae93a0ffde5cabc05307dc26f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=E2=80=8BHi Konrad,=E2=80=8B

Final= ly, I can use ethernet :D. It was my mistake. I thought the SET_NETDEV_DEV(= ) makes ndev =3D=3D pdev->dev, but it's not true.=C2=A0

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-&g= t;dev, DMA_BIT_MASK(32)= );
SET_NETDEV_DEV(ndev, &pdev->dev);
=

and then sh_eth works.

Ho= wever I wanted to set dma_mask in pdev, I just thought about the original d= ata have a mask bit.
Do you know how do I set dma_mask in pdev?

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, Wonseo= k 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)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;=
>
> It shows the device doesn't have dma_mask bit. So I tried to set t= he
> 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(suc= has
> 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-Ca= r H2, but it
> > > doesn't work. The root cause of the problem is that driv= er 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 m= ail: (
> > > http://lists.xen.or= g/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(40d7a7454835c2f7c639c78f6c09e7b6f0= e4a4e2)
> > >
> > >
> > > Thanks,
> > > Wonseok.
> >
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.x= en.org
> > > http://lists.xen.org/xen-devel
> >
> >

--14dae93a0ffde5cabc05307dc26f-- --===============6655687755066490904== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============6655687755066490904==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Tue, 17 May 2016 17:10:11 -0400 Message-ID: <20160517211011.GE7179@char.us.oracle.com> References: <20160412171033.GB5771@char.us.oracle.com> <20160414135244.GA2569@char.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wonseok Ko Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org T24gRnJpLCBBcHIgMTUsIDIwMTYgYXQgMTI6Mzk6NDJQTSArMDkwMCwgV29uc2VvayBLbyB3cm90 ZToKPiDigItIaSBLb25yYWQs4oCLCj4gCj4gRmluYWxseSwgSSBjYW4gdXNlIGV0aGVybmV0IDpE LiBJdCB3YXMgbXkgbWlzdGFrZS4gSSB0aG91Z2h0IHRoZQo+IFNFVF9ORVRERVZfREVWKCkgbWFr ZXMgbmRldiA9PSBwZGV2LT5kZXYsIGJ1dCBpdCdzIG5vdCB0cnVlLgo+IAo+IFNvIEkgY2hhbmdl ZCB0aGUgZG1hIGNvbmZpZ3VyYXRpb24gZnJvbToKPiAKPiBkbWFfY29lcmNlX21hc2tfYW5kX2Nv aGVyZW50KComcGRldi0+ZGV2KiwgRE1BX0JJVF9NQVNLKDMyKSk7Cj4gU0VUX05FVERFVl9ERVYo bmRldiwgJnBkZXYtPmRldik7Cj4gCj4gCj4gdG86Cj4gCj4gZG1hX2NvZXJjZV9tYXNrX2FuZF9j b2hlcmVudCgqJm5kZXYtPmRldiosIERNQV9CSVRfTUFTSygzMikpOwo+IFNFVF9ORVRERVZfREVW KG5kZXYsICZwZGV2LT5kZXYpOwo+IAo+IAo+IGFuZCB0aGVuIHNoX2V0aCB3b3Jrcy4KPiAKPiBI b3dldmVyIEkgd2FudGVkIHRvIHNldCBkbWFfbWFzayBpbiBwZGV2L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d@z Thu Jan 1 00:00:00 1970 From: Wonseok Ko Subject: Re: [sh_eth.c] Problem in dma_map_single() Date: Tue, 24 May 2016 01:06:01 +0900 Message-ID: References: <20160412171033.GB5771@char.us.oracle.com> <20160414135244.GA2569@char.us.oracle.com> <20160517211011.GE7179@char.us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5819189742263541465==" Return-path: In-Reply-To: <20160517211011.GE7179@char.us.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============5819189742263541465== Content-Type: multipart/alternative; boundary=001a114df9c2f020270533849dfd --001a114df9c2f020270533849dfd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Konrad It's not same. I am attaching a macro as below. #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent =3D (pdev)) So that's why I was setting the dma mask to ndev. Thanks, Wonseok Ko Thanks, Wonseok. 2016-05-18 6:10 GMT+09:00 Konrad Rzeszutek Wilk : > On Fri, Apr 15, 2016 at 12:39:42PM +0900, Wonseok Ko wrote: > > =E2=80=8BHi Konrad,=E2=80=8B > > > > Finally, I can use ethernet :D. It was my mistake. I thought the > > SET_NETDEV_DEV() makes ndev =3D=3D 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 >: > > > > > 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 th= e > > > > 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 descripto= r > > > > 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 cann= ot > > > 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 > > > > > > > > > > > > > > --001a114df9c2f020270533849dfd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi, Konrad=C2=A0


It&#= 39;s not same. I am attaching a macro as below.

#define SET_NETDEV_DEV(net, pdev) =C2=A0 ((n= et)->dev.parent =3D (pdev))

So that's why I = was setting the dma mask to ndev.


Th= anks,

Wonseok Ko



Thanks,
Wonseok.

2016-05-18 6:10 GMT+09:00 Konrad Rzeszutek W= ilk <konrad.wilk@oracle.com>:
On Fri, Apr 15, 2016 at 12:39:42PM +0900, Wonseo= k Ko wrote:
> =E2=80=8BHi Konrad,=E2=80=8B
>
> Finally, I can use ethernet :D. It was my mist= ake. I thought the
> SET_NETDEV_DEV() makes ndev =3D=3D 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 ori= ginal
> 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 d= evice.
> > >
> > > Currently, it dosen't pass to first condition code as be= low:
> > >
> > > if (!dev->dma_mask)
> > >
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0return 0;
> > >
> > > It shows the device doesn't have dma_mask bit. So I trie= d 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 de= scriptor
> > > 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 mentione= d
> > earlier?
> > >
> > > My question is if I want to get valid dma address with xen s= wiotlb(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 wr= ote:
> > > > > Hi,
> > > > >
> > > > > I'm trying to enable ethernet driver in Domain= 0 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 p= roblem 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://li= sts.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(40d7a7454835c2f7c639c78f= 6c09e7b6f0e4a4e2)
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Wonseok.
> > > >
> > > > > _______________________________________________ > > > > > Xen-devel mailing list
> > > > > Xen-dev= el@lists.xen.org
> > > > > http://lists.xen.org/xen-devel
> > > >
> > > >
> >

--001a114df9c2f020270533849dfd-- --===============5819189742263541465== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============5819189742263541465==--