From patchwork Thu May 20 15:24:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12270861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86725C433ED for ; Thu, 20 May 2021 15:26:12 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4CEF06121E for ; Thu, 20 May 2021 15:26:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4CEF06121E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fJ1HhLCo+Qhsm8aifhy8/QDQ8u2Ea9JqzYH0LMqZCAs=; b=cWIiANFFQ1lqne8KvDV6M+ow+F h88BTnjYBSZ1cGATWDgehgciw785hwSks4KUiMRaU5d2RlDkEmuWeO8LD0stMDrgoI/RCVDzY7zD2 9FpXeR5EaIkzyAmtpoY4BoxpIPz7U8f0DIsv0A4xeIejY1XYiFFKItzLJDxsEZ42GfbYOuzd8zkaE BPWz2hw9HZa5O9sYlAZaUSwLFfrnm2MWOtDMdZvm6c72DEqwSPUFds9ssrXii2bz5qYcKTpTcj2ev Tclz3ZpMkBJM17K5KfMhsm4GyUsKLNlPF8oGW0E4/OeNyNwx0PaERdK1BG2bbz8Yci/kcHg3UIB9x yM6CAMTQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkXa-001fYw-14; Thu, 20 May 2021 15:24:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkXI-001fVf-5c for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 15:24:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=mrTysC+5Y1rzWI1wgv6y9s0IlvCXL79aDEyAPVmzBOI=; b=LaSM2cffzGUNQznRC66UmbhByT WNoIAYcdnuuHPgHSZQom5FmWSE6V/eeYJpQHVwgZvwooT9yuEQlTWWsjOz+mMHrn80Y4IScxPKtHh Se6Dzao7wbzZPpzyfDh8AabNH0KlF41sThxSoqmD+yE1LdIMhmE3WZHhmiTU9IxoDyDqWVyXI3Efp 1X327HDxnCe5gFGNvkb/MT9YtDLxcyfQwHI1rbASYCeu/nNWOXQ02dJkUmIQe9yx0wJVcL+6va/4h TNyuii7R6dAsPLluHEX0T54vM33cFKwLbaATeOQRyNfyAa0DmjD8VettHeNOtAwfT1B2EXRJ5h8Kb vSg99kJA==; Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljkXF-00GSru-LJ for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 15:24:30 +0000 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3062AD84; Thu, 20 May 2021 17:24:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621524266; bh=8pcmUONH1aUUpwsB69i0J0FO1UXvfrIZMpswMRYOr58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQAz7cwvEFxSZBKzN/kA/wsj+jekvXUoo4J0OOYr+2lxDuQffPcyZrib9AbpxYmok FuyPOg6jq4Dl5L8W+ih/t+m/qOFRsyniOsp88UWPb2NEDvwsbcQcwXmkI/M07aIrlH nsP1I5fZYHbgbQlTGk5xDjGOzXKN2IyiYSPlvuWI= From: Laurent Pinchart To: dmaengine@vger.kernel.org Cc: Vinod Koul , Michal Simek , Jianqiang Chen , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] dmaengine: xilinx: dpdma: Add missing dependencies to Kconfig Date: Thu, 20 May 2021 18:24:17 +0300 Message-Id: <20210520152420.23986-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.1 In-Reply-To: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> References: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_082429_869201_E9A355D8 X-CRM114-Status: UNSURE ( 8.73 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver depends on both OF and IOMEM support, express those dependencies in Kconfig. This fixes a build failure on S390 reported by the 0day bot. Reported-by: kernel test robot Signed-off-by: Laurent Pinchart --- drivers/dma/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 6ab9d9a488a6..e47d4efbe7c5 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -701,6 +701,7 @@ config XILINX_ZYNQMP_DMA config XILINX_ZYNQMP_DPDMA tristate "Xilinx DPDMA Engine" + depends on HAS_IOMEM && OF select DMA_ENGINE select DMA_VIRTUAL_CHANNELS help From patchwork Thu May 20 15:24:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12270863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2A7AC433ED for ; Thu, 20 May 2021 15:26:42 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7FB4C6121E for ; Thu, 20 May 2021 15:26:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FB4C6121E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pyzQDnTmqu4GJHq0Wl3KtnLoMKQK6yBGiqbhZUAQ2OM=; b=E9bI4soAHhFaokAhFAujUAMwJw uc+LU/Dgj9wbqUzfTxRIVTbGUKavXzqYCjjevT80SoQH5+OD6QLXZGHUVSC67ywgNENdU1OmPr2j+ ZHxy1VeKhToX7mZECQMvy4AT4rdlVD/3IEIm0XON5Jv2Avmb5KkegR85SgKJUpUKqHR0lc8RcCd9r uPgUFWtsERQeGu1PzdzydC3pxjWUsdi2L7mTQApF/XfO91jVkETV4Abp+So9KDHH/OanhWUgDcjWZ Lhc2HZCnXPvkQINPpDuxybgmCtsJp7KLdPcY7UVb6QwPJC0w9RN8SUPymvHlAMeQBJJ9aJdqQIuuG kY2+bMlQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkXy-001ff7-NS; Thu, 20 May 2021 15:25:14 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkXK-001fWI-VV for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 15:24:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=l5ElAnHzQd0U9cW77d1AZLxw340mxOf/ZfDqNlM73ik=; b=RvwaGdZlhuOHMnSr7aqDGCbhHd LG3MGpNWL5drp//70DJEkN/4vTwIo8nCfEeLRY/t5ARNHJPYHsnizL2rRT5fbf6C2hhjCzhJk5rO6 q57tl4WsXYv95kPcF8oTOKSxO3aVXCvfEPO7d0zwApD4JC2bIehNm3B7bohSdf8QOAwWZbyx6x4OI 8FJlMuGHbgTATEDVql0g8T57X5LBgHQenloif0ugre6n7OWU0P/U/LEWW9Qj32ZJYuEu56OYqnq8o FcI5dmI6BOpbo3dEIU2VUGJQD3z4i9EZqw3HP1Fne5hNjF3zISTtqYAmicGF67kXUNXtXEJb7gNGI WylS3Trw==; Received: from perceval.ideasonboard.com ([2001:4b98:dc2:55:216:3eff:fef7:d647]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljkXI-00GSsO-7H for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 15:24:33 +0000 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C4DB8DEE; Thu, 20 May 2021 17:24:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621524267; bh=xYjj+txXnFrRcpyv9oqbDrdONQMheeJuEAqdZHA11eM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wE+w9qdhyizefZJyQ94OkRRfEjeYd2XlWxARXtpxutbyDk4FcVMZrINvtW91MQ6DU iUJzGJYyhFhf19vXstGisvOaC3OrJ+5kmXilkIrFa3RsYL8UOzBGEv2qaGbBIsu3Tn y9pn9m/WTf9UkFkwdjlCz+42HkzZC37pknIiWiI4= From: Laurent Pinchart To: dmaengine@vger.kernel.org Cc: Vinod Koul , Michal Simek , Jianqiang Chen , linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] dmaengine: xilinx: dpdma: Print channel number in kernel log messages Date: Thu, 20 May 2021 18:24:18 +0300 Message-Id: <20210520152420.23986-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.1 In-Reply-To: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> References: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_082432_426812_FEE47D32 X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To ease debugging, add the channel number to all kernel log messages related to a particular channel. Signed-off-by: Laurent Pinchart --- drivers/dma/xilinx/xilinx_dpdma.c | 32 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index 70b29bd079c9..ea56c3b35782 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -702,8 +702,9 @@ xilinx_dpdma_chan_prep_interleaved_dma(struct xilinx_dpdma_chan *chan, size_t stride = hsize + xt->sgl[0].icg; if (!IS_ALIGNED(xt->src_start, XILINX_DPDMA_ALIGN_BYTES)) { - dev_err(chan->xdev->dev, "buffer should be aligned at %d B\n", - XILINX_DPDMA_ALIGN_BYTES); + dev_err(chan->xdev->dev, + "chan%u: buffer should be aligned at %d B\n", + chan->id, XILINX_DPDMA_ALIGN_BYTES); return NULL; } @@ -934,7 +935,9 @@ static int xilinx_dpdma_chan_notify_no_ostand(struct xilinx_dpdma_chan *chan) cnt = xilinx_dpdma_chan_ostand(chan); if (cnt) { - dev_dbg(chan->xdev->dev, "%d outstanding transactions\n", cnt); + dev_dbg(chan->xdev->dev, + "chan%u: %d outstanding transactions\n", + chan->id, cnt); return -EWOULDBLOCK; } @@ -970,8 +973,8 @@ static int xilinx_dpdma_chan_wait_no_ostand(struct xilinx_dpdma_chan *chan) return 0; } - dev_err(chan->xdev->dev, "not ready to stop: %d trans\n", - xilinx_dpdma_chan_ostand(chan)); + dev_err(chan->xdev->dev, "chan%u: not ready to stop: %d trans\n", + chan->id, xilinx_dpdma_chan_ostand(chan)); if (ret == 0) return -ETIMEDOUT; @@ -1005,8 +1008,8 @@ static int xilinx_dpdma_chan_poll_no_ostand(struct xilinx_dpdma_chan *chan) return 0; } - dev_err(chan->xdev->dev, "not ready to stop: %d trans\n", - xilinx_dpdma_chan_ostand(chan)); + dev_err(chan->xdev->dev, "chan%u: not ready to stop: %d trans\n", + chan->id, xilinx_dpdma_chan_ostand(chan)); return -ETIMEDOUT; } @@ -1060,7 +1063,8 @@ static void xilinx_dpdma_chan_done_irq(struct xilinx_dpdma_chan *chan) vchan_cyclic_callback(&active->vdesc); else dev_warn(chan->xdev->dev, - "DONE IRQ with no active descriptor!\n"); + "chan%u: DONE IRQ with no active descriptor!\n", + chan->id); spin_unlock_irqrestore(&chan->lock, flags); } @@ -1148,10 +1152,12 @@ static void xilinx_dpdma_chan_handle_err(struct xilinx_dpdma_chan *chan) spin_lock_irqsave(&chan->lock, flags); - dev_dbg(xdev->dev, "cur desc addr = 0x%04x%08x\n", + dev_dbg(xdev->dev, "chan%u: cur desc addr = 0x%04x%08x\n", + chan->id, dpdma_read(chan->reg, XILINX_DPDMA_CH_DESC_START_ADDRE), dpdma_read(chan->reg, XILINX_DPDMA_CH_DESC_START_ADDR)); - dev_dbg(xdev->dev, "cur payload addr = 0x%04x%08x\n", + dev_dbg(xdev->dev, "chan%u: cur payload addr = 0x%04x%08x\n", + chan->id, dpdma_read(chan->reg, XILINX_DPDMA_CH_PYLD_CUR_ADDRE), dpdma_read(chan->reg, XILINX_DPDMA_CH_PYLD_CUR_ADDR)); @@ -1167,7 +1173,8 @@ static void xilinx_dpdma_chan_handle_err(struct xilinx_dpdma_chan *chan) xilinx_dpdma_chan_dump_tx_desc(chan, active); if (active->error) - dev_dbg(xdev->dev, "repeated error on desc\n"); + dev_dbg(xdev->dev, "chan%u: repeated error on desc\n", + chan->id); /* Reschedule if there's no new descriptor */ if (!chan->desc.pending && @@ -1232,7 +1239,8 @@ static int xilinx_dpdma_alloc_chan_resources(struct dma_chan *dchan) align, 0); if (!chan->desc_pool) { dev_err(chan->xdev->dev, - "failed to allocate a descriptor pool\n"); + "chan%u: failed to allocate a descriptor pool\n", + chan->id); return -ENOMEM; } From patchwork Thu May 20 15:24:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12270917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6620C433B4 for ; Thu, 20 May 2021 15:27:05 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 738D66121E for ; Thu, 20 May 2021 15:27:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 738D66121E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=r3RKtEcY/apUpZHJHMXzXE+cgGMD0kVBfk2DAuCV9KQ=; b=Rtx0iLu4H3x1CzTBc5c3EIAVQt i8HGmP2RQN2MMsNJ1/dWIi7NQuMLKQPVPG9ErjeccjqOLo1UmxiAxc0nNS2jnjo4H8Fjny//1Ix6o 3xgaIZ+8TsXrmMYOcz/YCeMIfvN537RtFrP/UunWcooYaabc87E5pL6Ih1FytAJ1Nw9wWaECipor/ dgr2sUD23w/KwdYd4aCLNhZ2lQtyHgWNXtr8541hrOzFHXpn7iiwOYoMbevUz5SNUiYStAneOteNs xkgxdaDL3MEvH5u3R4VvO0i9+lOEYz7C8y/ODMXug4xjfJnIeNF6CrGlZeGlwExX43q7ZUXelBpYk YMbRRJKQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkYE-001fn9-0C; Thu, 20 May 2021 15:25:30 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkXL-001fWJ-AW for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 15:24:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=UzWDlcdlaNhrc+fkWaKFRn4MAl15b/MxBvLIuDS/6Vk=; b=KSFsGGHl6rVAKZq0jJBa0bQDQU koXm9bugZCotRNHhExUFOiba1L+PkDxiErR6xu+gca7uebKkESH1wRx8XP8ozIzsbX30ZEWO2xrLU NHAdvVEPWcjzuYBJG+ySa6Kx7ZJpQCKWfX9muwt8BA+9mO8+/BmPLypU/Vgv+fIi3eTtrKTBxSl38 e2FvSOWi6qM1mNrM1UherOlO0gKt7QgN7kxI2Rbh8QT9Jhb5OWjESifP89DwrGBtLkvb6tPq+5+2M L+88k8e+m/X2XHvn5CeqQ4g1Rnm+FA2hmrPfH3BG9B8CF7T9SvKcH02NexYXtVxiCv0fSfsxp5e06 NPyW1qIg==; Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljkXI-00GSsP-Br for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 15:24:34 +0000 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 553A2E0C; Thu, 20 May 2021 17:24:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621524267; bh=MPyQ+vVZp1sQ3qtNieVc8s7/Xsyl8i4v0/UXQm+IvIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wGOUGGA21/1rv5wxW6yBhBppnaVa6KmxExVQ4kEV99ghDgvbyADmETmRitlEx+HQ6 A0+JyMEGGHC+qTaFXJn453jpeqAjHFhZGIfKg8c/prDEb6sJVqU4k5Jnvf2P0qCRpj LMZ/XF2q8uNg+lUSrUPvsR04rFHpiud03+PdLrIw= From: Laurent Pinchart To: dmaengine@vger.kernel.org Cc: Vinod Koul , Michal Simek , Jianqiang Chen , linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] dmaengine: xilinx: dpdma: Print debug message when losing vsync race Date: Thu, 20 May 2021 18:24:19 +0300 Message-Id: <20210520152420.23986-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.1 In-Reply-To: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> References: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_082432_575694_E3414603 X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The hardware retrigger is inherently racy with the vsync interrupt. This isn't an issue as the hardware provides a way to detect a race loss and handle it correctly. When debugging issues related to this, it's useful to get a notification of the race loss. Add a debug message to do so. Signed-off-by: Laurent Pinchart --- drivers/dma/xilinx/xilinx_dpdma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index ea56c3b35782..5834f8614a58 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -1095,8 +1095,12 @@ static void xilinx_dpdma_chan_vsync_irq(struct xilinx_dpdma_chan *chan) /* If the retrigger raced with vsync, retry at the next frame. */ sw_desc = list_first_entry(&pending->descriptors, struct xilinx_dpdma_sw_desc, node); - if (sw_desc->hw.desc_id != desc_id) + if (sw_desc->hw.desc_id != desc_id) { + dev_dbg(chan->xdev->dev, + "chan%u: vsync race lost (%u != %u), retrying\n", + chan->id, sw_desc->hw.desc_id, desc_id); goto out; + } /* * Complete the active descriptor, if any, promote the pending From patchwork Thu May 20 15:24:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12270919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BBC8C433ED for ; Thu, 20 May 2021 15:27:13 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56ADB6121E for ; Thu, 20 May 2021 15:27:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56ADB6121E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OCY6HvhUrt2icltYjaEYXlvJZ5ZclWVbdcXINm4Yg44=; b=ilHrw2L43OlrNst5aqhGbYn1Hq HrNUDjyjV4S/YzpeIODRrYIB1IWSEN1cPJ4a9J2vV7FNDPCArcs5AXS7dXhuGEosKeE7/Ex7Oryf3 xe266Ov0tdtkmhtvX2OAX4D6vUD9YaRNUYiG64WfR0vNE0rnnfF/H5oQQz8zlBILcH+vqbmJY1+OV U3do8m+05gHALD56NfPd2SnzKQrXnSIQ5yy1FuFJe8iHLDrgHRf361oUMeqMzNBp20lhyoitJgp4B Q7hkgCCd3TT30uC17QXn4Hz2nIagu2O1f19/Jq7xNkesujf/xbwFOBjEWuPGc92iOVigvb8DuB504 lww/BFHg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkYW-001ful-Ci; Thu, 20 May 2021 15:25:48 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljkXN-001fWv-La for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 15:24:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=7w7xen/IqhknLNPUoNtAw72IUb6ankMwsaWj4S329vM=; b=CkL3ZPYzVZL1eD6oKL6nyJo/rB IPqx9e3cDPkwRweQMUBfqVznQB0HnN5CZ7XjKk416ZcVNpfryaTcI9uzYdPJyarFhcfurDZzxWrOG ZQGIc6O52eQeGsD8eTM2s0uGoa6nHEvFSu42pehxUPvnFsW3roc+Q7LhWXJp9FgeMl5mLQ2n+ac2E rMbyiuWsBjKvsOZf6ETIhohqT8qERQJCE104LP8aZCrkmc/kWJCjuA0i90vfjDJc0Z9PJzDaTWcya 2P0wTq8okpAPeXSPZkpXeJzV1F+QS6vmgkbn9h3LBe6Nmjzh1TpnO+jzcvwfOJ8ZgOZKX+HUNa8Zv edQJ9FtA==; Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljkXL-00GSsz-3D for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 15:24:36 +0000 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D8790E2B; Thu, 20 May 2021 17:24:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1621524268; bh=WJt9uLnd9ahdsuddT0v6yu32+aM2ZZNh5lobu5CEs8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NqpqAHl7iBqh9PT5igEKqx9bjuaHuLgu2pM5aEcGK8KqheE7VphQYVwgiKXwKnDa+ JRQn2wDZ9gkeyV+WH6Zriz+hCyFKdg72OoBfRfd64Mv0nnhjqOjTZ2in/LVXe7HtrX l9EcYfsMDnYfXoZpY4TAZCpGWV5H5rDXmHjop1gE= From: Laurent Pinchart To: dmaengine@vger.kernel.org Cc: Vinod Koul , Michal Simek , Jianqiang Chen , linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] dmaengine: xilinx: dpdma: Limit descriptor IDs to 16 bits Date: Thu, 20 May 2021 18:24:20 +0300 Message-Id: <20210520152420.23986-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.1 In-Reply-To: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> References: <20210520152420.23986-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_082435_320789_91C29025 X-CRM114-Status: GOOD ( 11.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org While the descriptor ID is stored in a 32-bit field in the hardware descriptor, only 16 bits are used by the hardware and are reported through the XILINX_DPDMA_CH_DESC_ID register. Failure to handle the wrap-around results in a descriptor ID mismatch after 65536 frames. Fix it. Signed-off-by: Laurent Pinchart --- drivers/dma/xilinx/xilinx_dpdma.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index 5834f8614a58..6a8bb977fc7a 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -113,6 +113,7 @@ #define XILINX_DPDMA_CH_VDO 0x020 #define XILINX_DPDMA_CH_PYLD_SZ 0x024 #define XILINX_DPDMA_CH_DESC_ID 0x028 +#define XILINX_DPDMA_CH_DESC_ID_MASK GENMASK(15, 0) /* DPDMA descriptor fields */ #define XILINX_DPDMA_DESC_CONTROL_PREEMBLE 0xa5 @@ -867,7 +868,8 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) * will be used, but it should be enough. */ list_for_each_entry(sw_desc, &desc->descriptors, node) - sw_desc->hw.desc_id = desc->vdesc.tx.cookie; + sw_desc->hw.desc_id = desc->vdesc.tx.cookie + & XILINX_DPDMA_CH_DESC_ID_MASK; sw_desc = list_first_entry(&desc->descriptors, struct xilinx_dpdma_sw_desc, node); @@ -1090,7 +1092,8 @@ static void xilinx_dpdma_chan_vsync_irq(struct xilinx_dpdma_chan *chan) if (!chan->running || !pending) goto out; - desc_id = dpdma_read(chan->reg, XILINX_DPDMA_CH_DESC_ID); + desc_id = dpdma_read(chan->reg, XILINX_DPDMA_CH_DESC_ID) + & XILINX_DPDMA_CH_DESC_ID_MASK; /* If the retrigger raced with vsync, retry at the next frame. */ sw_desc = list_first_entry(&pending->descriptors,