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