Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1250966lfc; Wed, 1 Jun 2022 13:06:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1eCz97I87oK/oYWmJ9U0OMsQpP9RT98HxAGOXZBSlfUPx4sZsW3P6bQouDsjvqoN9X4o3 X-Received: by 2002:a05:6a00:2386:b0:519:1ff1:d723 with SMTP id f6-20020a056a00238600b005191ff1d723mr31305578pfc.21.1654113968698; Wed, 01 Jun 2022 13:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113968; cv=none; d=google.com; s=arc-20160816; b=zDXZRbO4iaforhTnjuFYBkZEhUEtVxZJbKnqrjED2EQzPFAC0zz1fi66HPAwTFtsKP tgwfYo9B0B9E0yMbLj1s3U50+GcTZwi2gyCLNYgVg1t4Aff4lF21ev3BNXY0uym3XsyX cyywdItT3yyyb4pjp1MwBREQ/CQvGkK4DueL2KboGsfG2QBf6UYODLuiBE5Xp4tWYzv5 a3EkvNEf9h4C32Cq6A6QM6uQNiGtbpD0m+DWlYRdO9VsuUEGCS6UmaOu1YmZN5+NnaAu PmOyMppzGhaS+EL191kR8Q5bbGh+eBSUaYGuJgWXGEvmkwRk3vfo2cLo8+Z1A53Ua541 JdGg== 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=5fTMtdgYtSmcGCLvHgv3QYrblVJSFHkBBfEM1fwrark=; b=LFoC3Uf7HQIIAJPwxcP8SrB3SJTaSCdaafqouUeUszh9QuwWSYfZzNBjCl1T5IncFH uMQZnRYQdqP7HASrH7fnn5MzF+lnknyeT4KJQwOBZ8qqfY9xmEBZvsr9pbhNxXrDUBG1 jU49crKY1K/1KJmZLnuaZFHTf2lhBQMQ/fvzYt46U7CBre06+abUN67A4BPXxdhpcYvN p9pV4/9hXj90RI70WBTJ/2cM+RGlogMgQlWg0THhEyrzHEmOuEH9qBHtE4brbNbv2osH iQoqXmJ1PB951X/VwgOYW0pi5g9mNFCf1dRtEMgyBhQN5qFaiJuasvfLoyx7ds+rKxBH 6t1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CbfNNbDi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y7-20020a170902d64700b001639f0ff47esi3310440plh.40.2022.06.01.13.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:06:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CbfNNbDi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06531227CFA; Wed, 1 Jun 2022 12:22:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243980AbiEaFYJ (ORCPT + 99 others); Tue, 31 May 2022 01:24:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243975AbiEaFYH (ORCPT ); Tue, 31 May 2022 01:24:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E29989155B; Mon, 30 May 2022 22:24:05 -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 68E0861186; Tue, 31 May 2022 05:24:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A69FC385A9; Tue, 31 May 2022 05:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653974644; bh=K25t52uoCNYvpbrLQpbyibAodXjFdV5vwswnYCvnAS0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CbfNNbDisfkjIlr5el8eLItHfExKRxouOzQFTz3IXOPK5GxLJ/7y42vhbJ540tT7z ECvyb3tU88oyGuzT2uQXjilZJkYgxWoHHL9d7iRavTTqfq3w32fKXbhZJGzVC7hedC zfSM/eokCABKe0sUG8NWiqaqNiGpmijT1TeOKpEj5gtYGAs/Wcq1gEyfX/Ha90AyAt vYEKUDI1Aqcahh6wTtreeLtROTqh1TQDftikVx/wa8Wl6X3q024QYhzYe7R44fm0nc B60RLQp7trDb9lo2rsc9heRaqHESHWQDtP4TCKji+6qkaBtjx6uXsdQGw8W93ASWe5 SEqO4WzP7XDfA== Date: Tue, 31 May 2022 10:54:00 +0530 From: Vinod Koul To: Geert Uytterhoeven Cc: Dave Jiang , Yoshihiro Shimoda , dmaengine , Linux-Renesas , Linux Kernel Mailing List Subject: Re: [PATCH] dmaengine: add verification of DMA_INTERRUPT capability for dmatest Message-ID: References: <164978679251.2361020.5856734256126725993.stgit@djiang5-desk3.ch.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 30-05-22, 10:06, Geert Uytterhoeven wrote: > Hi Dave, Vinod, Hi Geert, > > On Wed, Apr 13, 2022 at 12:58 AM Dave Jiang wrote: > > Looks like I forgot to add DMA_INTERRUPT cap setting to the idxd driver and > > dmatest is still working regardless of this mistake. Add an explicit check > > of DMA_INTERRUPT capability for dmatest to make sure the DMA device being used > > actually supports interrupt before the test is launched and also that the > > driver is programmed correctly. > > > > Signed-off-by: Dave Jiang > > Thanks for your patch, which is now commit a8facc7b988599f8 > ("dmaengine: add verification of DMA_INTERRUPT capability for > dmatest") upstream. > > > --- a/drivers/dma/dmatest.c > > +++ b/drivers/dma/dmatest.c > > @@ -675,10 +675,16 @@ static int dmatest_func(void *data) > > /* > > * src and dst buffers are freed by ourselves below > > */ > > - if (params->polled) > > + if (params->polled) { > > flags = DMA_CTRL_ACK; > > - else > > - flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; > > + } else { > > + if (dma_has_cap(DMA_INTERRUPT, dev->cap_mask)) { > > + flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; > > + } else { > > + pr_err("Channel does not support interrupt!\n"); > > + goto err_pq_array; > > + } > > + } > > > > ktime = ktime_get(); > > while (!(kthread_should_stop() || > > @@ -906,6 +912,7 @@ static int dmatest_func(void *data) > > Shimoda-san reports that this commit breaks dmatest on rcar-dmac. > Like most DMA engine drivers, rcar-dmac does not set the DMA_INTERRUPT > capability flag, hence dmatest now fails to start: > > dmatest: Channel does not support interrupt! > > To me, it looks like the new check is bogus, as I believe it confuses > two different concepts: > > 1. Documentation/driver-api/dmaengine/provider.rst says: > > - DMA_INTERRUPT > > - The device is able to trigger a dummy transfer that will > generate periodic interrupts > > 2. In non-polled mode, dmatest sets DMA_PREP_INTERRUPT. > include/linux/dmaengine.h says: > > * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon > completion of > * this transaction > > As dmatest uses real transfers, I think it does not depend on > the ability to use interrupts from dummy transfers. Yes this does not look right to me. DMA_INTERRUPT is for a specific capability which is linked to dma_prep_interrupt() which dmatest does not use so i think it is not correct for dmatest to use this... I can revert this patch... Dave? -- ~Vinod