Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1300838rwl; Wed, 12 Apr 2023 10:43:13 -0700 (PDT) X-Google-Smtp-Source: AKy350aUp0/YCosBdybjsICGEz9OEmqrIhvHYFVIOesHYG5kkt9iXdi6UF0AsqcgQm907uZAXYjB X-Received: by 2002:aa7:9798:0:b0:636:afb9:cd5a with SMTP id o24-20020aa79798000000b00636afb9cd5amr3651123pfp.13.1681321393050; Wed, 12 Apr 2023 10:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681321393; cv=none; d=google.com; s=arc-20160816; b=TlJnNK746Lk9vnxY45c+6ZjdO+Aa0/2ycFG6kTnjmuMeZPdKsOCyHoxEqJ7OeN/5vJ s5p2wTLDS32wHUZ7y6TlChMHg7x35rwraSmNAsVRo7TDAIkn4ghwX54SuQUJ+ZzyNfR3 S7SwUnjDs69oR27YXojtG+7OZ08BeGWCfi6/a4B//H5HLxIz+mb9FftRqRtxGz9f7LJ1 ZD7h0Za6mVt0iIpPjX4CWOmK8sPwhCmryHNsFMHeQPLY53LxVK2vIxOHGzGSGJwKeSer PoO41kadOFEUFFdS71EPup/Lke8OP9Ivxqesw0gNXZacyARIak/uzRiunK3/zITIEktp Haqg== 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=fh2G0IyMu8jouq+UhrqAp0rtETQIlxeDwyAzSQWtLGc=; b=MODAIxQRzg4UM4tIDaXcAqAg5MWQdUAbSJjaqAbsUDb1ABSV90su2gEoZognN7SUfZ Pso12xQF3fFgTLVdhMWMzQgknMa4WRbDnift2vToNOGhHoGiGO3XBdnswj7JEtbLyJoc 5GxKvx1sR4LoffL/dqjdSRVqQkHMJJF8PLHX3XN5pRyxAeXVfB0IA9DG/YCXlQqeM3WG gfiCNmr4DqTbe3suawPaCQHqVh11Wqo3fONJGHz8EgAv27CS5SvsOnL1CLM4Gq6A1qhY 0XXbHhO7EiS9FfKu0wRpyWWUzlOmkvvYP8oNiWiOKklD/SXJuJKcv61s8O3Z4DdS0hcc w/iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ouoza3hW; 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 u184-20020a6385c1000000b0051446aaeae9si10007629pgd.598.2023.04.12.10.42.59; Wed, 12 Apr 2023 10:43:13 -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=Ouoza3hW; 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 S229980AbjDLRd2 (ORCPT + 99 others); Wed, 12 Apr 2023 13:33:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbjDLRdZ (ORCPT ); Wed, 12 Apr 2023 13:33:25 -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 E1BA340FB; Wed, 12 Apr 2023 10:33:07 -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 7D50460F35; Wed, 12 Apr 2023 17:33:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56C3DC433D2; Wed, 12 Apr 2023 17:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681320786; bh=lKsHeifIk0MMoix2MaCJURu/5rLXpLLzEOTegL6Fd10=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ouoza3hWnGAYOaaiBW5fQlX5v2jsyu/gpNcUyw/SytcgkuVi6QvTRTzb9Pk43EQU2 dMThLb/MDuiLi6P7G+wWsF6eODq6dckcBxzRUh4dp6T6KpHR2aXb5BxERNBfy3ZB3Y YhE9Qe/KPCKKBtqX/4jqmg5U7cnZu7wLeigN8MgT5tJ//kVensYxGqtYcXV/XMraue RpRZy2OGQRrI1hGkqAfpks8XjUgC1YtzypxUyml6TAe6zbVwxqltJ6lwzP4fPpsu8K pQ11R4696HT17grw+2HRAR7bai7FR7y9uTgxWLNGYEU1J46XCRUwC/XOpB+Qgc4je9 YOCMxm0cUh0SA== Date: Wed, 12 Apr 2023 23:03:02 +0530 From: Vinod Koul To: Jisheng Zhang Cc: Eugeniy Paltsev , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/11] dmaengine: dw-axi-dmac: fix reading register hen runtime suspended Message-ID: References: <20230313170450.897-1-jszhang@kernel.org> <20230313170450.897-2-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230313170450.897-2-jszhang@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 s/hen/when..? or something else On 14-03-23, 01:04, Jisheng Zhang wrote: > We should runtime resume the device before calling > axi_chan_is_hw_enable(). why is that can you please explain.. > > Signed-off-by: Jisheng Zhang > --- > drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > index 7f3a60e28e38..23a10dbdecb7 100644 > --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c > @@ -462,13 +462,17 @@ static void dw_axi_dma_synchronize(struct dma_chan *dchan) > > static int dma_chan_alloc_chan_resources(struct dma_chan *dchan) > { > + int ret; > struct axi_dma_chan *chan = dchan_to_axi_dma_chan(dchan); > > + pm_runtime_get(chan->chip->dev); > + > /* ASSERT: channel is idle */ > if (axi_chan_is_hw_enable(chan)) { > dev_err(chan2dev(chan), "%s is non-idle!\n", > axi_chan_name(chan)); > - return -EBUSY; > + ret = -EBUSY; > + goto err_busy; > } > > /* LLI address must be aligned to a 64-byte boundary */ > @@ -478,13 +482,16 @@ static int dma_chan_alloc_chan_resources(struct dma_chan *dchan) > 64, 0); > if (!chan->desc_pool) { > dev_err(chan2dev(chan), "No memory for descriptors\n"); > - return -ENOMEM; > + ret = -ENOMEM; > + goto err_busy; > } > dev_vdbg(dchan2dev(dchan), "%s: allocating\n", axi_chan_name(chan)); > > - pm_runtime_get(chan->chip->dev); > - > return 0; > + > +err_busy: > + pm_runtime_put(chan->chip->dev); > + return ret; > } > > static void dma_chan_free_chan_resources(struct dma_chan *dchan) > -- > 2.39.2 -- ~Vinod