public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: rabin@rab.in (Rabin Vincent)
To: linux-arm-kernel@lists.infradead.org
Subject: [Bug] VCHIQ functional test broken
Date: Fri, 14 Apr 2017 09:41:04 +0200	[thread overview]
Message-ID: <20170414074104.GA8704@laptop> (raw)
In-Reply-To: <20170413222915.GF17774@n2100.armlinux.org.uk>

On Thu, Apr 13, 2017 at 11:29:15PM +0100, Russell King - ARM Linux wrote:
> > 00a19f3e25c0c40e0ec77f52d4841d23ad269169 is the first bad commit
> > commit 00a19f3e25c0c40e0ec77f52d4841d23ad269169
> > Author: Rabin Vincent <rabinv@axis.com>
> > Date:   Tue Nov 8 09:21:19 2016 +0100
> > 
> >     ARM: 8627/1: avoid cache flushing in flush_dcache_page()
> >     
> >     When the data cache is PIPT or VIPT non-aliasing, and cache operations
> >     are broadcast by the hardware, we can always postpone the flush in
> >     flush_dcache_page().  A similar change was done for ARM64 in commit
> >     b5b6c9e9149d ("arm64: Avoid cache flushing in flush_dcache_page()").
> >     
> >     Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> >     Signed-off-by: Rabin Vincent <rabinv@axis.com>
> >     Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > 
> > It seems that staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm
> > relies on the behavior of flush_dcache_page before this patch get
> > applied. Any advices to fix this issues are appreciated.
> 
> Any ideas why this causes a problem for this driver?  From what I can see,
> it doesn't make use of flush_dcache_page().

The driver's create_pagelist() uses get_free_pages(), and
get_free_pages() calls flush_dcache_page().

The problem is that the driver fails to flush the pages which it
acquires via get_free_pages().  It's clear that the driver needs to do
it, since there is a flush in the is_vmalloc_addr() path in the same
function.  The driver probably worked earlier because of the unecessary
flush in flush_dcache_page() which existed before this patch, but the
purpose of that flush was not DMA coherency and it was never guaranteed
that it would flush all the way to the point that devices could see the
data.

See radeon_ttm_tt_pin_userptr() in drivers/gpu/drm/radeon/radeon_ttm.c
for an example of how a driver can ensure cache coherency using the DMA
mapping API if it intends to DMA from/to pages acquired by
get_free_pages().

The rest of the driver should also be converted to the DMA mapping API
instead of abusing the API's private functions (dmac_map_area etc.)

  reply	other threads:[~2017-04-14  7:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <331235003.222371.1491934205807@email.1und1.de>
2017-04-13 17:41 ` [Bug] VCHIQ functional test broken Stefan Wahren
2017-04-13 22:29   ` Russell King - ARM Linux
2017-04-14  7:41     ` Rabin Vincent [this message]
2017-04-14  8:32       ` Stefan Wahren
2017-04-20 18:27       ` Eric Anholt
2017-04-20 19:58         ` Rabin Vincent
2017-04-20 21:20           ` Eric Anholt
2017-04-24 16:12           ` Stefan Wahren
2017-04-24 16:40             ` Russell King - ARM Linux
2017-04-24 17:42               ` Stefan Wahren
2017-04-24 18:59                 ` Russell King - ARM Linux
2017-04-24 19:35                   ` Stefan Wahren
2017-05-13  9:07                     ` Stefan Wahren
2017-05-13  9:30                       ` Russell King - ARM Linux
2017-05-15 14:29                         ` Phil Elwell
2017-05-15 14:54                           ` Stefan Wahren
2017-05-15 15:05                             ` Phil Elwell

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=20170414074104.GA8704@laptop \
    --to=rabin@rab.in \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox