Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2655834iog; Sun, 26 Jun 2022 23:23:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1so+FDOUM2omfxthAF4b2OAlgUd5epssHSxT+z7rq0fAlrCcuScj9ben/wuBtVG9ziGtIB1 X-Received: by 2002:a05:6402:438a:b0:435:bc23:d615 with SMTP id o10-20020a056402438a00b00435bc23d615mr14413253edc.283.1656311007756; Sun, 26 Jun 2022 23:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656311007; cv=none; d=google.com; s=arc-20160816; b=rKC5nOkGWwZYztsbdxA4KRhQFHMVuAkuJekOxagPpJmT799dM/+rDleKpYitvbF8hf 9j8LAaN6okKf6DrsBxZRtkK4ojCistbMRfsBzHYlTmWiVboqBr8WZvGML4EtRJCv1Dyp QFyPPwid0kok71hHogsISSSJoeNeZnwnpb/VOOxeJSBKi33hZtC/BW/fTzyiHnxiUg/R NCeb/RuWAoEkn2KVMMjma8M3OWwTy5ogYjizRbwJW4tIjrPGtpIXcAIAGF7ebgjBE59H ImTgNt3WNkHRA7yP5BbL0mmYXY4/AYrWLXulyars+TbIk7KKXTw4Evhb7Mpv+p5seoqr Tuog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tj22f8cuYY6A7uxBy/BCpq6xb3hnD4o3FDHBFP0WKgs=; b=ym6QhgmHSHPjSrxUh0R9kwpNcX3IFQW+w2esfcCCFA4ZgmHNTmDxTqKR9h6yJUZfep SC3bifwv3j/CBZyouUTvybsRV6GlHk+RTghXcgcjhxXGG3gmfJVnBy8eQ7rXwP1XKeks tjb9XgWNRkrBVSdJv+3teAX7oeJ4xKpLes66YYZCcor+5ZXl9wUJQAS+bBVjQbLK241r qX1Z3p4v0vFs5IWTa0oI+/nX2WthqyRtpPil9QgHaKqHdsOKW97sbRTQsRM6NrO2SvLr 2cbjeKX3CNpOW0cHf6edqkAMUx6zi2tDGEcNObOouDUAKDrf+xCfNVovo43rqLeuZ/Io G71A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="psFJnp/1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn15-20020a17090794cf00b007269e670e29si4058411ejc.542.2022.06.26.23.23.03; Sun, 26 Jun 2022 23:23:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="psFJnp/1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232356AbiF0GNC (ORCPT + 99 others); Mon, 27 Jun 2022 02:13:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbiF0GNA (ORCPT ); Mon, 27 Jun 2022 02:13:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5E625587; Sun, 26 Jun 2022 23:12:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 50386612A1; Mon, 27 Jun 2022 06:12:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A2A2C341C8; Mon, 27 Jun 2022 06:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656310378; bh=XSfX3h8z/tYeCfqUd1/OjZf3oxJkcrxHEwFVPj5HSUw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=psFJnp/1+9cXrSMdsLkWLP7bNJgswfVe/IWPxsu+F+2CgKPMBVTropheV6/uMhoDP o5QiP5kBDaYc8arqOdhBIiNx/T9y7PxXGSpJV/UiwaMTl/uRTwdf/w+bcG5RVKyt5h az2m1bnyYkCMP91ErIwltt/nDZIsOku7C7R7CdSkEL5nowr+xPzUSRK3IvJthr0gZ4 J3zIdPdSJRzj5gd5ZaC99KFxr6UJP1G6Gk9se0dg5DU1shHcSvK7TgXuiDoN8tLRec K7sE3qMXdZHrlgrJrkdbyJTB8BkjItexpRoGccipSkLvoVT/GANfedbG0vMd2GH4Fg gDKVLU4hF6+Ng== Date: Mon, 27 Jun 2022 11:42:54 +0530 From: Vinod Koul To: Jie Hai Cc: wangzhou1@hisilicon.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/8] dmaengine: hisilicon: Fix CQ head update Message-ID: References: <20220625074422.3479591-1-haijie1@huawei.com> <20220625074422.3479591-3-haijie1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220625074422.3479591-3-haijie1@huawei.com> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25-06-22, 15:44, Jie Hai wrote: > After completion of data transfer of one or multiple descriptors, > the completion status and the current head pointer to submission > queue are written into the CQ and interrupt can be generated to > inform the software. In interrupt process CQ is read and cq_head > is updated. > > hisi_dma_irq updates cq_head only when the completion status is > success. When an abnormal interrupt reports, cq_head will not update > which will cause subsequent interrupt processes read the error CQ > and never report the correct status. > > This patch updates cq_head whenever CQ is accessed. > > Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support") > No need for blank line > Signed-off-by: Jie Hai > --- > drivers/dma/hisi_dma.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c > index 98bc488893cc..0a0f8a4d168a 100644 > --- a/drivers/dma/hisi_dma.c > +++ b/drivers/dma/hisi_dma.c > @@ -436,12 +436,11 @@ static irqreturn_t hisi_dma_irq(int irq, void *data) > desc = chan->desc; > cqe = chan->cq + chan->cq_head; > if (desc) { > + chan->cq_head = (chan->cq_head + 1) % > + hdma_dev->chan_depth; > + hisi_dma_chan_write(q_base, HISI_DMA_Q_CQ_HEAD_PTR, q_base? -- ~Vinod