[Letux-kernel] Fw: [PATCH] iommu/omap: Fix cache flushes on paging tables entries

H. Nikolaus Schaller hns at goldelico.com
Sat Aug 4 19:24:59 CEST 2018


> Am 04.08.2018 um 18:50 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> Hi,
> 
> i subscribed the linux-omap list to not produce duplicate patches.
> 
> I found this interesting, might fix some trouble.

Maybe significant trouble although it is not clear how much it
is used. But we have a lot of DMA so that it does not harm
to include it in our hacks branch. If it goes upstream (likely)
it will then disappear by some rebase...

BR and thanks,
Nikolaus


> It got an Acked-By:
> from a ti person.
> 
> Regards,
> Andreas
> 
> Begin forwarded message:
> 
> Date: Wed,  1 Aug 2018 16:50:26 +0200
> From: Ralf Goebel <ralf.goebel at imago-technologies.com>
> To: "'Suman Anna'" <s-anna at ti.com>, "'Joerg Roedel'" <joro at 8bytes.org>
> Cc: Ralf Goebel <ralf.goebel at imago-technologies.com>,
> linux-omap at vger.kernel.org,        "'KISHON VIJAY ABRAHAM'"
> <kishon at ti.com> Subject: [PATCH] iommu/omap: Fix cache flushes on
> paging tables entries
> 
> 
> The base address used for DMA operations did incorrectly include
> the offset for the table entry. The entry offset was then added
> again which lead to incorrect behavior.
> 
> The calculation of the base address is changed to point to the
> beginning of the table.
> 
> Signed-off-by: Ralf Goebel <ralf.goebel at imago-technologies.com>
> ---
> drivers/iommu/omap-iommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
> index af4a8e7fcd27..3b05117118c3 100644
> --- a/drivers/iommu/omap-iommu.c
> +++ b/drivers/iommu/omap-iommu.c
> @@ -550,7 +550,7 @@ static u32 *iopte_alloc(struct omap_iommu *obj, u32
> *iopgd,
> pte_ready:
> 	iopte = iopte_offset(iopgd, da);
> -	*pt_dma = virt_to_phys(iopte);
> +	*pt_dma = iopgd_page_paddr(iopgd);
> 	dev_vdbg(obj->dev,
> 		 "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n",
> 		 __func__, da, iopgd, *iopgd, iopte, *iopte);
> @@ -738,7 +738,7 @@ static size_t iopgtable_clear_entry_core(struct
> omap_iommu *obj, u32 da) }
> 		bytes *= nent;
> 		memset(iopte, 0, nent * sizeof(*iopte));
> -		pt_dma = virt_to_phys(iopte);
> +		pt_dma = iopgd_page_paddr(iopgd);
> 		flush_iopte_range(obj->dev, pt_dma, pt_offset, nent);
> 
> 		/*
> --
> 2.11.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> _______________________________________________
> http://projects.goldelico.com/p/gta04-kernel/
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180804/65286e6e/attachment.asc>


More information about the Letux-kernel mailing list