From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754986AbdEDRwD (ORCPT ); Thu, 4 May 2017 13:52:03 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:61497 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbdEDRvz (ORCPT ); Thu, 4 May 2017 13:51:55 -0400 Date: Thu, 4 May 2017 19:51:10 +0200 (CEST) From: Stefan Wahren To: Phil Elwell , Greg Kroah-Hartman Cc: Lee Jones , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, daniels@collabora.com, linux-rpi-kernel , linux-arm-kernel@lists.infradead.org, =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= Message-ID: <139394270.264573.1493920270267@email.1und1.de> In-Reply-To: References: Subject: Re: [PATCH] staging: vc04_services: Fix bulk cache maintenance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.1-Rev34 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K0:V2JeIY/oTow0U4w6L1iTh1bb1FYnZgdCfLsrAOpxfemtGfnxFAY yGaZ6zTlaf9TBiEhkxyPrXjP3duDk9VlI3tQyU6Gx92Oa/VLVovUApX1pTK2MRAs2gitdXX mhiC2WuSCdNzF4zPfOpg3QC2OTzeIyLM8dn3Jy/t/fc7kzOR9wKBq3JYxw0jwM9SBByBHn6 /qjApjtTMUWugOAtnrVsQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:jSdBd7W/eGs=:7z3ua0sbwZ0E+GW9Vudofg gkM/Soov31Sz1Fc9B5uABvSAWsQSjDQO8L+NcJqz7gFzdzb36h6omKWOgAzloc/7Qh4JGlsvO TSSoZsrS+HhMwdkikBjeIcJh0fb4TKW8UKFLwa9H9tWCnrfS4OJWeHcG5orGglv9D1+jCDDMD XfFU3suAUQRwHdNUqTk/NkjrAluU8e4QNLWlvHHJ1gpM43maHp18p8w20E43rQFLU5go0BvZS BuxUu6oznyGUrpc7vwW4LjWIZRSC2hdTveeWmIhX+v62/Ls2qwV2J9cYHU7szbDT/3p36l8We PwjYV+boebJ8mgnHqm5wTboIQV0DQxEOD/hmE0iV38xpxHzAlL8jOmC4p2CFnBPQXTSyCN1sk qwbXXG+AEmYprX/ND/BvR9K7z2AIJ3O8bpVXSy+kUsPy7fjCfhac5kqFcxV1a54D4MSyGtwP7 Po4WjqFk0PzAcb3qMbH7kfUHD05xc6JBDdxBvfpJomQn1z7Wwy4y1++I5JCModmGB50NbCMam oG9Zjy/iEqrL5MLgR2/fWqGqW6zqhKEuaTXUkFbVCA8y+cSNcra/zuLHlGA8SzbKkSpxI1NDn Eh9MKslkgHTOnvJ715pF/VAwx8HDMy8Q0wkuNPj5kjea3ASUkKd5eBn7BiMW9+U4q2MddNKBQ kRj+f9UU6068bbOhWs2mSEuH5X9hMrBTV8h4i5o3iQEKfBeCAvokY7+GMhO+XuxuTP0jtnTjO pKM0ByVS/EUe7X5m Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Phil Elwell 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 Reported-by: Stefan Wahren Tested-by: Stefan Wahren In order to clarify the context of this issue: http://lists.infradead.org/pipermail/linux-rpi-kernel/2017-April/006149.html