From patchwork Fri Jul 12 09:34:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11041927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F382138B for ; Fri, 12 Jul 2019 09:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BF4F28929 for ; Fri, 12 Jul 2019 09:35:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E1C828BE8; Fri, 12 Jul 2019 09:35:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 96FA828929 for ; Fri, 12 Jul 2019 09:35:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DC576E336; Fri, 12 Jul 2019 09:35:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 74E306E336; Fri, 12 Jul 2019 09:35:16 +0000 (UTC) Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MuUvS-1idHrA1K1y-00raHL; Fri, 12 Jul 2019 11:35:10 +0200 From: Arnd Bergmann To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter Subject: [PATCH] drm/amd: work around llvm bug #42576 Date: Fri, 12 Jul 2019 11:34:57 +0200 Message-Id: <20190712093508.1420279-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:T0t9yMg8w/+NPQa9xO428uGk7wZdKsknl8QBX4d3SnulUoORRM/ trO21OtppDiYQuT3C4jVcKiiTnNnS6/5eKvCrjLKi+uRjvPt5MQZMv9b6D5BKTd/052kBFw akgzrRcmNIQyyldfjHRhBbtJ6Gkx/BDwtqZB4H0qV71ENh6YpR7eLIXuvYRe6ArKTSYl++G QgIeU6F+4ybc1xwYgbYEQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:uJnPJIwtCWU=:ZuTP/RSLwgHQipfLeMHCG3 RibAJkLb9sr5VnedmiI47Wahdi0mNwmExruwBc0yE5dw7Iz+cCTj8DYQTyJT3baRm4kedpuu9 XE1yvzo5sYN5y2cyj9jJImvM+uCBzrCw2HvFrBwfBwdpe7pR0RzxRY58oj9Glcrggz3LJtEj3 AnjMoWibdpZ5g3xolKyDEcUdQoOWLQHFSxM+/IS3DChRY4OoFy2dFpusCCiEVOVl0PVLXVCz+ aXfdH5gmJdVPwVGpWJiO3DaRknezrgtxfr4QjHQBvpu7Ibhe6MH03BWKGric15VglyrwwRZ9B wXU9jZSZdxQ2Xu2AJQJMGskauUlJrXlfB/cnWcnHXh9z48b0t44qEWq4l1lbnBAnEEfAkSWv7 QypLsVSqiy8fvChwlaFNg6NFL6cR8U5DrxWAJ4vtKitaK+gvnrxm01YnD3RsL51bgM7aPGGvT jJ3manEXCDccgF4YJk3SXXRT1yyLLnytJPHQ63o8fdpnJotMxuUQQWvenBUmALhN3LEWxvhnq D2kbWHN6N3gj9ABSJLsjGapb8ltOtI0cMR6i7XmBirdJOqOtLYt5511Pkow5N5zi+NsvFLaAw qN4Ahnbzc07s4zcPakcEjon7luREwtRxvQwpg/yd3nu4ygtnNAAeStV/UPLn1U+SLFzcFAOOe 50s+fjsrsnPA5zEK69kR28mY+JGeNx+/8DgtT/gfNkru0iC8O/9VII1C+ZnjG8gfbizNytMBp jwyqt1/X9UFIp/QTWnimQBjsJyp7nqZv/yTRmg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philip Yang , Arnd Bergmann , Oak Zeng , xinhui pan , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, clang-built-linux@googlegroups.com, Huang Rui , dri-devel@lists.freedesktop.org, Evan Quan , Rex Zhu Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Code in the amdgpu driver triggers a bug when using clang to build an arm64 kernel: /tmp/sdma_v4_0-f95fd3.s: Assembler messages: /tmp/sdma_v4_0-f95fd3.s:44: Error: selected processor does not support `bfc w0,#1,#5' I expect this to be fixed in llvm soon, but we can also work around it by inserting a barrier() that prevents the optimization. Link: https://bugs.llvm.org/show_bug.cgi?id=42576 Signed-off-by: Arnd Bergmann --- Sending this for completeness, please decide for yourselves whether to apply it or not, given that it's a trivial workaround but probably not needed in the long run. --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index 4428018672d3..154416a626df 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -773,6 +773,7 @@ static uint32_t sdma_v4_0_rb_cntl(struct amdgpu_ring *ring, uint32_t rb_cntl) /* Set ring buffer size in dwords */ uint32_t rb_bufsz = order_base_2(ring->ring_size / 4); + barrier(); /* work around https://bugs.llvm.org/show_bug.cgi?id=42576 */ rb_cntl = REG_SET_FIELD(rb_cntl, SDMA0_GFX_RB_CNTL, RB_SIZE, rb_bufsz); #ifdef __BIG_ENDIAN rb_cntl = REG_SET_FIELD(rb_cntl, SDMA0_GFX_RB_CNTL, RB_SWAP_ENABLE, 1);