Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1650450 > unrolled thread
| Started by | Ruxandra Ioana Radulescu <ruxandra.radulescu@nxp.com> |
|---|---|
| First post | 2017-05-25 14:40 +0200 |
| Last post | 2017-05-29 16:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
RE: [PATCH 1/2] staging: fsl-dpaa2/eth: Fix address translations Ruxandra Ioana Radulescu <ruxandra.radulescu@nxp.com> - 2017-05-25 14:40 +0200
Re: [PATCH 1/2] staging: fsl-dpaa2/eth: Fix address translations Laurentiu Tudor <laurentiu.tudor@nxp.com> - 2017-05-29 16:00 +0200
| From | Ruxandra Ioana Radulescu <ruxandra.radulescu@nxp.com> |
|---|---|
| Date | 2017-05-25 14:40 +0200 |
| Subject | RE: [PATCH 1/2] staging: fsl-dpaa2/eth: Fix address translations |
| Message-ID | <tL0dz-8eA-7@gated-at.bofh.it> |
> -----Original Message-----
> From: Laurentiu Tudor
> Sent: Wednesday, May 24, 2017 3:34 PM
> To: Ruxandra Ioana Radulescu <ruxandra.radulescu@nxp.com>;
> gregkh@linuxfoundation.org
> Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org;
> agraf@suse.de; arnd@arndb.de; linux-arm-kernel@lists.infradead.org;
> iommu@lists.linux-foundation.org; Bogdan Purcareata
> <bogdan.purcareata@nxp.com>; stuyoder@gmail.com; Nipun Gupta
> <nipun.gupta@nxp.com>
> Subject: Re: [PATCH 1/2] staging: fsl-dpaa2/eth: Fix address translations
>
> Hi Ioana,
>
> Debatable nit inline.
>
> On 05/24/2017 03:13 PM, Ioana Radulescu wrote:
> > Use the correct mechanisms for translating a DMA-mapped IOVA
> > address into a virtual one. Without this fix, once SMMU is
> > enabled on Layerscape platforms, the Ethernet driver throws
> > IOMMU translation faults.
> >
> > Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> > Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
> > ---
> > drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 25
> +++++++++++++++++++------
> > drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 1 +
> > 2 files changed, 20 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
> b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
> > index 6f9eed66c64d..3fee0d6f17e0 100644
> > --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
> > +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
> > @@ -37,6 +37,7 @@
> > #include <linux/interrupt.h>
> > #include <linux/msi.h>
> > #include <linux/kthread.h>
> > +#include <linux/iommu.h>
> >
> > #include "../../fsl-mc/include/mc.h"
> > #include "../../fsl-mc/include/mc-sys.h"
> > @@ -54,6 +55,16 @@ MODULE_DESCRIPTION("Freescale DPAA2 Ethernet
> Driver");
> >
> > const char dpaa2_eth_drv_version[] = "0.1";
> >
> > +static void *dpaa2_iova_to_virt(struct iommu_domain *domain,
>
> if you pass a "struct dpaa2_eth_priv *priv" instead of "iommu_domain"
> you can move the priv->iommu_domain reference in the function and
> slightly simplify the call sites.
Fair point, but I'd prefer keeping this function independent of the
Ethernet driver's private data structure. This way, if other (future)
DPAA2 drivers will need a similar function, we can just move it
to a common area instead of duplicating the code.
Thanks,
Ioana
[toc] | [next] | [standalone]
| From | Laurentiu Tudor <laurentiu.tudor@nxp.com> |
|---|---|
| Date | 2017-05-29 16:00 +0200 |
| Message-ID | <tMtnd-ED-69@gated-at.bofh.it> |
| In reply to | #1650450 |
On 05/25/2017 03:31 PM, Ruxandra Ioana Radulescu wrote:
>> -----Original Message-----
>> From: Laurentiu Tudor
>> Sent: Wednesday, May 24, 2017 3:34 PM
>> To: Ruxandra Ioana Radulescu <ruxandra.radulescu@nxp.com>;
>> gregkh@linuxfoundation.org
>> Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org;
>> agraf@suse.de; arnd@arndb.de; linux-arm-kernel@lists.infradead.org;
>> iommu@lists.linux-foundation.org; Bogdan Purcareata
>> <bogdan.purcareata@nxp.com>; stuyoder@gmail.com; Nipun Gupta
>> <nipun.gupta@nxp.com>
>> Subject: Re: [PATCH 1/2] staging: fsl-dpaa2/eth: Fix address translations
>>
>> Hi Ioana,
>>
>> Debatable nit inline.
>>
>> On 05/24/2017 03:13 PM, Ioana Radulescu wrote:
>>> Use the correct mechanisms for translating a DMA-mapped IOVA
>>> address into a virtual one. Without this fix, once SMMU is
>>> enabled on Layerscape platforms, the Ethernet driver throws
>>> IOMMU translation faults.
>>>
>>> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
>>> Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
>>> ---
>>> drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 25
>> +++++++++++++++++++------
>>> drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 1 +
>>> 2 files changed, 20 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
>> b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
>>> index 6f9eed66c64d..3fee0d6f17e0 100644
>>> --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
>>> +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
>>> @@ -37,6 +37,7 @@
>>> #include <linux/interrupt.h>
>>> #include <linux/msi.h>
>>> #include <linux/kthread.h>
>>> +#include <linux/iommu.h>
>>>
>>> #include "../../fsl-mc/include/mc.h"
>>> #include "../../fsl-mc/include/mc-sys.h"
>>> @@ -54,6 +55,16 @@ MODULE_DESCRIPTION("Freescale DPAA2 Ethernet
>> Driver");
>>>
>>> const char dpaa2_eth_drv_version[] = "0.1";
>>>
>>> +static void *dpaa2_iova_to_virt(struct iommu_domain *domain,
>>
>> if you pass a "struct dpaa2_eth_priv *priv" instead of "iommu_domain"
>> you can move the priv->iommu_domain reference in the function and
>> slightly simplify the call sites.
>
> Fair point, but I'd prefer keeping this function independent of the
> Ethernet driver's private data structure. This way, if other (future)
> DPAA2 drivers will need a similar function, we can just move it
> to a common area instead of duplicating the code.
Understood. Fine by me then.
---
Best Regards, Laurentiu
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web