Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1634946rwe; Sat, 15 Apr 2023 03:14:33 -0700 (PDT) X-Google-Smtp-Source: AKy350a0gLecDiyiv+Kf4r3wA/H3fw5Z4kbCqZL1S4m1uBMtsMkX13wpMojBV68Hv9MlNlfS9JNp X-Received: by 2002:a05:6a20:729c:b0:ee:775a:1aa3 with SMTP id o28-20020a056a20729c00b000ee775a1aa3mr4801141pzk.26.1681553673153; Sat, 15 Apr 2023 03:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681553673; cv=none; d=google.com; s=arc-20160816; b=JjC6xkjdvj0fKMVPv121308Fv1gZGnDFmPCyQO/wmwowvpJUyIe2kwpuHBWW4/QbvC HQhWYKZGYgTWwB9sHOw0inghoCZEBtkarU434pAVwxP/452VdHZZ2cFthF1KDCHbL2Qc nQyuQ4KFXGNYGCePZYpreVe/npedxtFXPEhkOot1a+ASvmBp15kEpbW3gyUfR7IKzuc6 5hYw3CUtnQyBi3MYB4+vu5U/3yiTaFsRYQ71AXhnlmqSiR3prj9M5L2ZHy5KJKOB8hls GSyEGJyFDIX5a3PEKxqT9w9stIXl/NVOMTGDAF2Xj1ERBxUFCoVW5U6EJvpydbXwSZnT 3G7A== 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=qhY+dhl9tn0uwzi7mTP540cqc0V+ROxF+mlMI9nUuPs=; b=tCRuBqcv2hutST1XjzTOC4Gt4IJGXdTeND6tVyYcW/WH9Lo1oTiM6qx8tgImaPWioi TqscuZ/gjBLOIl1xKA9sSdT+6uqD1WgIu/SNLVjWaLw+rq+s6FQNUarl56booGPEUdF4 lCRixb81X9TCbucftcAYQzuHn44SeBTNSN6uf9vDfeGjs6i6BIjve8lEFXo+XV5WCkNT qx9bwBQ/YFd5OfTYotimfdGqsu5klrsfUcqYpb9flX+mpTOMq33hjT2xVHD9gJs2cz61 BwA8hiQgxmH7gt8rhds71ktav3gKoazAWVcJ/kjlt96vbJyoRHoBv6c+mzu8rismf81G 6i0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QRkWhbnl; 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 z11-20020a6552cb000000b00513234112b6si6780003pgp.898.2023.04.15.03.14.20; Sat, 15 Apr 2023 03:14:33 -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=QRkWhbnl; 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 S229839AbjDOKNO (ORCPT + 99 others); Sat, 15 Apr 2023 06:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjDOKNK (ORCPT ); Sat, 15 Apr 2023 06:13:10 -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 C08FC3C1E; Sat, 15 Apr 2023 03:13:09 -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 5EDE460F15; Sat, 15 Apr 2023 10:13:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5F1CC433EF; Sat, 15 Apr 2023 10:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681553588; bh=y8PFiTJmyHVcHoADVCxHznp9xq9eD+8CSpYGucAEaE0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QRkWhbnlSseV5l3hBHRP/eNaCxSXMpLHob+yibG4SaXV/siBfZUZzlyCZ/o5H4U9Z YPkHs8kURnehXrBRyfQXgOWs6pcetoJ8cAxOvT1LU0inYvVYTY6tye57rQutNtTlZf jMSixDxbp2YqX4CnxJ8wu2G+x5K/KdekvsHxArInDCFIGQyn5t+B70U+Rhrez3ghlp v1Qslr3kDv3YXE+jzQlqbFJW/N5xEYbJj/csRRIuXHEYPAf/2eP43tEXDdjqYjC5pq xF4zynIr1Wysm7XqAq5qAwlVmhLq/i2Ez0ZcOeWoqVyg36+SjJvLvK2IY6sLuyLuq8 oYaUxJWBLqjmg== Date: Sat, 15 Apr 2023 18:02:14 +0800 From: Jisheng Zhang To: Vinod Koul 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=utf-8 Content-Disposition: inline In-Reply-To: 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 On Wed, Apr 12, 2023 at 11:03:02PM +0530, Vinod Koul wrote: > 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.. If the device is suspended, I.E not resumed, accessing any registers in axi_chan_is_hw_enable() will cause cpu abort. I will add this info into commit log of v2. > > > > > 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