From patchwork Tue Dec 24 05:03:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11309091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 575601395 for ; Tue, 24 Dec 2019 05:03:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F5632071A for ; Tue, 24 Dec 2019 05:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577163821; bh=b3d3xrkLIusWswr28twHM/07xXqMtj1qpLrIJ3OenVI=; h=From:To:Cc:Subject:Date:List-ID:From; b=VNalL9GiKnn9mDo0VICmG9TcH867wEHqZ6SPuJojd/ATX2F9vgjjUw/SwLQUkL/rT FLxmJlbt1nGFMw9uoIXgI6g4rLLsQCT4DIJiRSIk3OFSf0jt7zw6Pe/6kYFHyQUutq STNLNbHNZa86+U3qHCHsb4lSsZJgE3l4Qbpw/c2U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725866AbfLXFDk (ORCPT ); Tue, 24 Dec 2019 00:03:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:33684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbfLXFDk (ORCPT ); Tue, 24 Dec 2019 00:03:40 -0500 Received: from localhost.localdomain (unknown [122.167.68.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CF1C20718; Tue, 24 Dec 2019 05:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577163819; bh=b3d3xrkLIusWswr28twHM/07xXqMtj1qpLrIJ3OenVI=; h=From:To:Cc:Subject:Date:From; b=Y5ugSBcWJsbjNHp9hQmvoT1E8umDRLuwdgWUMrqvrjJK2XM05ukUj4ocqEbe31eTR Bohlr1ixgNi9jeqZH8VcV4CvIUPrI0fVGtqFKeo9EKMoMs+GT3R/Uu9t25S2B8RbYP 1NRxCJsO/d0SXXCisxqxiUiTL6W0Oi1wttoaPb7o= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Logan Gunthorpe Subject: [PATCH 1/2] dmaengine: move module_/dma_device_put() after route free Date: Tue, 24 Dec 2019 10:33:25 +0530 Message-Id: <20191224050326.3481588-1-vkoul@kernel.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org We call dma_device_put() and module_put() after invoking .device_free_chan_resources callback, but we should also take care of router devices and invoke this after .route_free callback. So move it after .route_free Signed-off-by: Vinod Koul Reviewed-by: Logan Gunthorpe --- drivers/dma/dmaengine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index e316abe3672d..0505ea5b002f 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -427,15 +427,15 @@ static void dma_chan_put(struct dma_chan *chan) chan->device->device_free_chan_resources(chan); } - dma_device_put(chan->device); - module_put(dma_chan_to_owner(chan)); - /* If the channel is used via a DMA request router, free the mapping */ if (chan->router && chan->router->route_free) { chan->router->route_free(chan->router->dev, chan->route_data); chan->router = NULL; chan->route_data = NULL; } + + dma_device_put(chan->device); + module_put(dma_chan_to_owner(chan)); } enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie) From patchwork Tue Dec 24 05:03:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 11309093 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6889921 for ; Tue, 24 Dec 2019 05:03:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 861032071A for ; Tue, 24 Dec 2019 05:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577163822; bh=+IGau3AyCY8MYwyo4wJdg0D20GhOXqWNP0G6ezWvWRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=R5kilYfa8zISji3aCFZ4vFVcrMH1i1QSlCha9c2wLVPVrsMaFPmAJRRP3uLenULBj vMjg8Iwksn9IcT2YAWyT9W6fce1+2/GGLVXPnrdrugNvbqZSiG8zaPtr5XmUJYUqmn 7ID+EKP/XlDo7mt7PNetWX6aLDLoA6mRz94dnwKg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725858AbfLXFDm (ORCPT ); Tue, 24 Dec 2019 00:03:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:33740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725816AbfLXFDm (ORCPT ); Tue, 24 Dec 2019 00:03:42 -0500 Received: from localhost.localdomain (unknown [122.167.68.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C26F2071E; Tue, 24 Dec 2019 05:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577163821; bh=+IGau3AyCY8MYwyo4wJdg0D20GhOXqWNP0G6ezWvWRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B4MLPnYJqBEvQRd632dzBaLgux506TtiO0gJlSESoC0183S44n5kK1SuFTIvELNK+ I4zRBsPsQMy/M2fy3J40gCHnzPFX5kk3uVwes3J8qV8IwJNITZ6u1LLKaLv+2Vll6V 1Zbwz6kxf2sOyYF3Gpr33MXNWj0Mik1te2D/rLmA= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Logan Gunthorpe Subject: [PATCH 2/2] dmaengine: print more meaningful error message Date: Tue, 24 Dec 2019 10:33:26 +0530 Message-Id: <20191224050326.3481588-2-vkoul@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191224050326.3481588-1-vkoul@kernel.org> References: <20191224050326.3481588-1-vkoul@kernel.org> MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org error log for dma_channel_table_init() failure pointed a mere "initialization failure", which is not very helpful message, so print additional details like function name and error code. Signed-off-by: Vinod Koul --- drivers/dma/dmaengine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 0505ea5b002f..4ac77456e830 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -206,7 +206,7 @@ static int __init dma_channel_table_init(void) } if (err) { - pr_err("initialization failure\n"); + pr_err("dmaengine dma_channel_table_init failure: %d\n", err); for_each_dma_cap_mask(cap, dma_cap_mask_all) free_percpu(channel_table[cap]); }