From patchwork Mon Sep 18 11:08:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylvain Lesne X-Patchwork-Id: 9956453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 955B660385 for ; Mon, 18 Sep 2017 11:08:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8622028B1D for ; Mon, 18 Sep 2017 11:08:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ADDF28B1E; Mon, 18 Sep 2017 11:08:12 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E01A628BCF for ; Mon, 18 Sep 2017 11:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752150AbdIRLIL (ORCPT ); Mon, 18 Sep 2017 07:08:11 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:54788 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753815AbdIRLIK (ORCPT ); Mon, 18 Sep 2017 07:08:10 -0400 Received: from localhost.localdomain ([109.190.217.251]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.184]) with ESMTPSA (Nemesis) id 0Lp7GG-1dF5VP1Rg4-00etCk; Mon, 18 Sep 2017 13:08:03 +0200 From: Sylvain Lesne To: dmaengine@vger.kernel.org Cc: vinod.koul@intel.com, sr@denx.de Subject: [RFC PATCH 1/2] dmaengine: altera: fix response FIFO emptying Date: Mon, 18 Sep 2017 13:08:00 +0200 Message-Id: <1505732881-7484-2-git-send-email-lesne@alse-fr.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505732881-7484-1-git-send-email-lesne@alse-fr.com> References: <1505732881-7484-1-git-send-email-lesne@alse-fr.com> X-Provags-ID: V03:K0:YaOwBCpqZtMtH+GP/+czFHoQzhw2aWG+ZWd98uohXDo1/ZlYxuf SsyT1hJNu83yOm89iB/TmphLB12RChAkK2z/SSfv2uqsJH8PkUsNjgRkSRbFybzMDOxdwe1 aO+9k2fWOyPj+sMzjtPI6MlaYHMKpIBQ1HNPszHvdJpkoO82iad/fHxTrsy12jTuFW1A9qt q0KNztUD+Pp1CcyBOL8tg== X-UI-Out-Filterresults: notjunk:1; V01:K0:JmgF1R/DbRo=:BAbKtUkRX7eWx7wSrzY5S8 G3oX6uxTsTigAFhRfkZqY9o/Mm0FxMIe1o6Gg+gTAk9UB0anV3HF3Dg23ElZTUYSrrXPVa/G9 z9ndzZGbuY/xyCGDt4obi5yyRYaW7/APDcYtf2GNMN7U/Gwquae+TTifPZNPlsqLrB2d/AyHf BETT/ul/5uck+gxQZPZRa660yrByvpP8M8z2cpSqN6FwiIu2Z064as043FaeyuySmAdDomEER fgaoFmJKMZ+tI51ni4Tkw1BM+8Nq+sMkdtU48tKOhcVikpl8F56E5wwVh4hPP+Fxjy36Rtpw7 mFuD9WMI1/F3HyYbTKv5FSBYuVcJ9iguc0KvR2WnOK80ncMGCwtcb9h15CqGNEZ0hR2ZhE6sG jf3i8d3o2CgsCnaGC0VmphqDS4Nd9nbwhpJSARY2VpWHeevRlYn1sd6gp3mlJ1H2WO86WcmD+ 1TSH9NGmIEBVf7TV8JozalQN5u0i+FPARW0THz2Cc7gi5fcu2yW90W945YFbOS0yQn2StDzRx z7yGyPjz97vPOHO/MjsKPWBwX+RBmVY4H/BARDWobPLbgAk66Jd1DUPO2k4B1W++tCtEG5k7z SmyMXv3OWRc0TmWW+q6v1eXPzgiUKJSTjS5xHDPeRcOX5dJ3FlCxeHxIPtnbPnAzJCd/RRK+w NXLbI2TJtxbOTtXSkDTgQGLFpj0e3gHBV2VCh5cE4uxytKkyF/UPee5KdWY5IRcTBmk2BD600 Gk9ujVct36kt9PixxPnATSgGz7BPJB6REBJHIg== Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 6084fc2ec478 ("dmaengine: altera: Use macros instead of structs to describe the registers") introduced a minus sign before a register offset. This leads to soft-locks of the DMA controller, since reading the last status byte is required to pop the response from the FIFO. Failing to do so will lead to a full FIFO, which means that the DMA controller will stop processing descriptors. Signed-off-by: Sylvain Lesne Reviewed-by: Stefan Roese --- According to the datasheet, I think we also could drop the "bytes transferred" read, since only the last byte of the status register has the side effect of emptying the FIFO. --- drivers/dma/altera-msgdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c index 32905d5606ac..35cbf2365f68 100644 --- a/drivers/dma/altera-msgdma.c +++ b/drivers/dma/altera-msgdma.c @@ -698,7 +698,7 @@ static void msgdma_tasklet(unsigned long data) * bits. So we need to just drop these values. */ size = ioread32(mdev->resp + MSGDMA_RESP_BYTES_TRANSFERRED); - status = ioread32(mdev->resp - MSGDMA_RESP_STATUS); + status = ioread32(mdev->resp + MSGDMA_RESP_STATUS); msgdma_complete_descriptor(mdev); msgdma_chan_desc_cleanup(mdev);