mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: MMU: fix wrong dma_flush_range in arm_create_pte()
@ 2018-08-15 13:46 Sascha Hauer
  2018-08-15 13:49 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2018-08-15 13:46 UTC (permalink / raw)
  To: Barebox List

Since 7ba0f2d299 arm_create_pte() flushes the page table entries itself
and it's no longer done in arch_remap_range(). Unfortunately it does
not flush the modified 1st level page table entry, but instead the base
of the page table. Fix it up.

Fixes: 7ba0f2d299 ARM: mmu: fix cache flushing when replacing a section with a PTE

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 88ee11cb48..f6c44e3e25 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -151,7 +151,7 @@ static u32 *arm_create_pte(unsigned long virt, uint32_t flags)
 	dma_flush_range(table, PTRS_PER_PTE * sizeof(u32));
 
 	ttb[ttb_idx] = (unsigned long)table | PMD_TYPE_TABLE;
-	dma_flush_range(ttb, sizeof(u32));
+	dma_flush_range(&ttb[ttb_idx], sizeof(u32));
 
 	return table;
 }
-- 
2.18.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: MMU: fix wrong dma_flush_range in arm_create_pte()
  2018-08-15 13:46 [PATCH] ARM: MMU: fix wrong dma_flush_range in arm_create_pte() Sascha Hauer
@ 2018-08-15 13:49 ` Sascha Hauer
  2018-08-15 16:55   ` Andrey Smirnov
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2018-08-15 13:49 UTC (permalink / raw)
  To: Barebox List

On Wed, Aug 15, 2018 at 03:46:59PM +0200, Sascha Hauer wrote:
> Since 7ba0f2d299 arm_create_pte() flushes the page table entries itself
> and it's no longer done in arch_remap_range(). Unfortunately it does
> not flush the modified 1st level page table entry, but instead the base
> of the page table. Fix it up.
> 
> Fixes: 7ba0f2d299 ARM: mmu: fix cache flushing when replacing a section with a PTE

Since the patch breaking it was the reason for creating v2018.07.1, this
will be a reason for creating v2018.07.2 (and also v2018.08.1)

I noticed misbehaviour when trying to sue network on a i.MX53 based
board, here we got tronsmission timeouts. These are fixed with this patch

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: MMU: fix wrong dma_flush_range in arm_create_pte()
  2018-08-15 13:49 ` Sascha Hauer
@ 2018-08-15 16:55   ` Andrey Smirnov
  2018-08-16  7:21     ` Sascha Hauer
  2018-08-16 21:30     ` Giorgio Dal Molin
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Smirnov @ 2018-08-15 16:55 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

On Wed, Aug 15, 2018 at 6:49 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> On Wed, Aug 15, 2018 at 03:46:59PM +0200, Sascha Hauer wrote:
> > Since 7ba0f2d299 arm_create_pte() flushes the page table entries itself
> > and it's no longer done in arch_remap_range(). Unfortunately it does
> > not flush the modified 1st level page table entry, but instead the base
> > of the page table. Fix it up.
> >
> > Fixes: 7ba0f2d299 ARM: mmu: fix cache flushing when replacing a section with a PTE
>
> Since the patch breaking it was the reason for creating v2018.07.1, this
> will be a reason for creating v2018.07.2 (and also v2018.08.1)
>
> I noticed misbehaviour when trying to sue network on a i.MX53 based
> board, here we got tronsmission timeouts. These are fixed with this patch
>

Heh, you beat me to it by a couple of hours! I came up with the same
patch debugging networking (and various others) issues on i.MX51 last
night and was about to submit it.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: MMU: fix wrong dma_flush_range in arm_create_pte()
  2018-08-15 16:55   ` Andrey Smirnov
@ 2018-08-16  7:21     ` Sascha Hauer
  2018-08-16 21:30     ` Giorgio Dal Molin
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2018-08-16  7:21 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Barebox List

On Wed, Aug 15, 2018 at 09:55:32AM -0700, Andrey Smirnov wrote:
> On Wed, Aug 15, 2018 at 6:49 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >
> > On Wed, Aug 15, 2018 at 03:46:59PM +0200, Sascha Hauer wrote:
> > > Since 7ba0f2d299 arm_create_pte() flushes the page table entries itself
> > > and it's no longer done in arch_remap_range(). Unfortunately it does
> > > not flush the modified 1st level page table entry, but instead the base
> > > of the page table. Fix it up.
> > >
> > > Fixes: 7ba0f2d299 ARM: mmu: fix cache flushing when replacing a section with a PTE
> >
> > Since the patch breaking it was the reason for creating v2018.07.1, this
> > will be a reason for creating v2018.07.2 (and also v2018.08.1)
> >
> > I noticed misbehaviour when trying to sue network on a i.MX53 based
> > board, here we got tronsmission timeouts. These are fixed with this patch
> >
> 
> Heh, you beat me to it by a couple of hours! I came up with the same
> patch debugging networking (and various others) issues on i.MX51 last
> night and was about to submit it.

So I guess I can take this as a Tested-by ;)

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: MMU: fix wrong dma_flush_range in arm_create_pte()
  2018-08-15 16:55   ` Andrey Smirnov
  2018-08-16  7:21     ` Sascha Hauer
@ 2018-08-16 21:30     ` Giorgio Dal Molin
  1 sibling, 0 replies; 5+ messages in thread
From: Giorgio Dal Molin @ 2018-08-16 21:30 UTC (permalink / raw)
  To: Andrey Smirnov, barebox


[-- Attachment #1.1.1: Type: text/plain, Size: 1358 bytes --]

Hi,

On 8/15/18 6:55 PM, Andrey Smirnov wrote:
> On Wed, Aug 15, 2018 at 6:49 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>>
>> On Wed, Aug 15, 2018 at 03:46:59PM +0200, Sascha Hauer wrote:
>>> Since 7ba0f2d299 arm_create_pte() flushes the page table entries itself
>>> and it's no longer done in arch_remap_range(). Unfortunately it does
>>> not flush the modified 1st level page table entry, but instead the base
>>> of the page table. Fix it up.
>>>
>>> Fixes: 7ba0f2d299 ARM: mmu: fix cache flushing when replacing a section with a PTE
>>
>> Since the patch breaking it was the reason for creating v2018.07.1, this
>> will be a reason for creating v2018.07.2 (and also v2018.08.1)
>>
>> I noticed misbehaviour when trying to sue network on a i.MX53 based
>> board, here we got tronsmission timeouts. These are fixed with this patch
>>
> 
> Heh, you beat me to it by a couple of hours! I came up with the same
> patch debugging networking (and various others) issues on i.MX51 last
> night and was about to submit it.
> 
> Thanks,
> Andrey Smirnov
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

I can also confirm this network problem on an imx7d soc.

Tomorrow I will test the patch.

giorgio


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-16 21:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-15 13:46 [PATCH] ARM: MMU: fix wrong dma_flush_range in arm_create_pte() Sascha Hauer
2018-08-15 13:49 ` Sascha Hauer
2018-08-15 16:55   ` Andrey Smirnov
2018-08-16  7:21     ` Sascha Hauer
2018-08-16 21:30     ` Giorgio Dal Molin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox