From: phil@raspberrypi.org (Phil Elwell)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] staging: vc04_services: Fix bulk cache maintenance
Date: Wed, 10 May 2017 09:42:43 +0100 [thread overview]
Message-ID: <bd72cc29-140e-dfd7-eac5-01ccc8b844b1@raspberrypi.org> (raw)
In-Reply-To: <139394270.264573.1493920270267@email.1und1.de>
On 04/05/2017 18:51, Stefan Wahren wrote:
>
>> Phil Elwell <phil@raspberrypi.org> hat am 4. Mai 2017 um 11:58 geschrieben:
>>
>>
>> vchiq_arm supports transfers less than one page and at arbitrary
>> alignment, using the dma-mapping API to perform its cache maintenance
>> (even though the VPU drives the DMA hardware). Read (DMA_FROM_DEVICE)
>> operations use cache invalidation for speed, falling back to
>> clean+invalidate on partial cache lines, with writes (DMA_TO_DEVICE)
>> using flushes.
>>
>> If a read transfer has ends which aren't page-aligned, performing cache
>> maintenance as if they were whole pages can lead to memory corruption
>> since the partial cache lines at the ends (and any cache lines before or
>> after the transfer area) will be invalidated. This bug was masked until
>> the disabling of the cache flush in flush_dcache_page().
>>
>> Honouring the requested transfer start- and end-points prevents the
>> corruption.
>>
>> Fixes: cf9caf192988 ("staging: vc04_services: Replace dmac_map_area with dmac_map_sg")
>> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
>
> Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
>
> In order to clarify the context of this issue:
>
> http://lists.infradead.org/pipermail/linux-rpi-kernel/2017-April/006149.html
Thanks, Stefan.
Is there no feedback other on this patch? It's been in the rpi-4.11.y downstream
branch for a week now with favourable results - see issue
https://github.com/raspberrypi/linux/issues/1977 and pr
https://github.com/raspberrypi/linux/pull/1987.
Phil
WARNING: multiple messages have this Message-ID (diff)
From: Phil Elwell <phil@raspberrypi.org>
To: Stefan Wahren <stefan.wahren@i2se.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Lee Jones" <lee@kernel.org>,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
daniels@collabora.com,
linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>,
linux-arm-kernel@lists.infradead.org,
"Noralf Trønnes" <noralf@tronnes.org>
Subject: Re: [PATCH] staging: vc04_services: Fix bulk cache maintenance
Date: Wed, 10 May 2017 09:42:43 +0100 [thread overview]
Message-ID: <bd72cc29-140e-dfd7-eac5-01ccc8b844b1@raspberrypi.org> (raw)
In-Reply-To: <139394270.264573.1493920270267@email.1und1.de>
On 04/05/2017 18:51, Stefan Wahren wrote:
>
>> Phil Elwell <phil@raspberrypi.org> hat am 4. Mai 2017 um 11:58 geschrieben:
>>
>>
>> vchiq_arm supports transfers less than one page and at arbitrary
>> alignment, using the dma-mapping API to perform its cache maintenance
>> (even though the VPU drives the DMA hardware). Read (DMA_FROM_DEVICE)
>> operations use cache invalidation for speed, falling back to
>> clean+invalidate on partial cache lines, with writes (DMA_TO_DEVICE)
>> using flushes.
>>
>> If a read transfer has ends which aren't page-aligned, performing cache
>> maintenance as if they were whole pages can lead to memory corruption
>> since the partial cache lines at the ends (and any cache lines before or
>> after the transfer area) will be invalidated. This bug was masked until
>> the disabling of the cache flush in flush_dcache_page().
>>
>> Honouring the requested transfer start- and end-points prevents the
>> corruption.
>>
>> Fixes: cf9caf192988 ("staging: vc04_services: Replace dmac_map_area with dmac_map_sg")
>> Signed-off-by: Phil Elwell <phil@raspberrypi.org>
>
> Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
> Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
>
> In order to clarify the context of this issue:
>
> http://lists.infradead.org/pipermail/linux-rpi-kernel/2017-April/006149.html
Thanks, Stefan.
Is there no feedback other on this patch? It's been in the rpi-4.11.y downstream
branch for a week now with favourable results - see issue
https://github.com/raspberrypi/linux/issues/1977 and pr
https://github.com/raspberrypi/linux/pull/1987.
Phil
next prev parent reply other threads:[~2017-05-10 8:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 9:58 [PATCH] staging: vc04_services: Fix bulk cache maintenance Phil Elwell
2017-05-04 9:58 ` Phil Elwell
2017-05-04 17:51 ` Stefan Wahren
2017-05-04 17:51 ` Stefan Wahren
2017-05-10 8:42 ` Phil Elwell [this message]
2017-05-10 8:42 ` Phil Elwell
2017-05-10 9:06 ` Greg Kroah-Hartman
2017-05-10 9:06 ` Greg Kroah-Hartman
2017-05-10 9:11 ` Phil Elwell
2017-05-10 9:11 ` 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=bd72cc29-140e-dfd7-eac5-01ccc8b844b1@raspberrypi.org \
--to=phil@raspberrypi.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.