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: 182428 Delivered-To: patch@linaro.org Received: by 2002:a92:a146:0:0:0:0:0 with SMTP id v67csp1254394ili; Mon, 23 Dec 2019 21:03:42 -0800 (PST) X-Google-Smtp-Source: APXvYqznbb4zxFAaFq9iK5EJ1mSETJwH+jD6akzLXMqaoBCYK07lXZyuSckGOa0ClTRoBWA8JlOm X-Received: by 2002:a9d:51ca:: with SMTP id d10mr35468688oth.76.1577163822422; Mon, 23 Dec 2019 21:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577163822; cv=none; d=google.com; s=arc-20160816; b=yFPoaIxldiobL5OOnZvlMMkgGCgUV2CvPW8oS0Agmn8gUhRNdDYP3frYnxjLiaWAEB Qu/tuB4ruoKMxAUyh5pNNCIrsEh37jGHfI6YXa/weK4lU1m6k7dR38Wzhm1UBNgxD2EH o7THMGGPb2hOhPTLJGooU/sSdf+9lC/rQh34HniPTyRl8CWv5kBv0HS/rbYHvJJLOyyL xiftF8QKcZYKRHko7t/FMG0pzFboFx68ORZymflBSdL+KJW/YSJhE2GGRNZbxyQrDG/2 NYz9TPjxn/4v1HekpAKSIrGBjtcVlOQaRS09ETSnip+BrOMD0qLap80zW7JM2vq03bwm w5Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=n5PyKIYW8P2pnzHm3k5cCW1lgUliE7QE9lpXxNfBCnc=; b=wpxbpb0ZFdSc/PXG95J8kRmvHlTiZK9cJQqDMWbWwkOHEjGsLig75j3X9KnFtMZIvp msx8jZPYR42F7iLYM7Jn7PGt51+Dmykp7hJR3ubYY2QN4xdpsvCrO2tICmsy0K/MNdrF O4Qdfu8+B7jYvE4OBudvBrqhEyGv2cY5ZYGVEYhPAJfxEAfMNj9tRhjumzuNKexkqEvJ QuU9906CreW6TiggS113N1V4D+3hos0p775Xdzf38fh4fVUJVs5fhntok/Y9pf4MH4C7 zrSoJ44dWsT07emavRP+w+7/kMpFrxN6he+QVbztW6n030g4cqQOD6/qy+tWAiXRH4AJ xD4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y5ugSBcW; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i205si10807229oih.257.2019.12.23.21.03.41; Mon, 23 Dec 2019 21:03:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y5ugSBcW; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-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 S1725866AbfLXFDk (ORCPT + 3 others); 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 --- drivers/dma/dmaengine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.23.0 Reviewed-by: Logan Gunthorpe 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: 182429 Delivered-To: patch@linaro.org Received: by 2002:a92:a146:0:0:0:0:0 with SMTP id v67csp1254398ili; Mon, 23 Dec 2019 21:03:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwTiUb60gvnv8+wYraj0I8O405d/mvrIEU3Lkgim8Ytj1u3/ACxmkYkP7OHpVyI8JByH5IG X-Received: by 2002:a9d:2028:: with SMTP id n37mr38207552ota.127.1577163822835; Mon, 23 Dec 2019 21:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577163822; cv=none; d=google.com; s=arc-20160816; b=AHm+gwDSvJeZ0NTDGnEVH02x6Rx6oOHGGlCp6YSv9nX2ZG0pwb88iwcQlrvg/JSbNe No4VnfcLrFxRZhc//DcucYZ2wMukUwcJNrlZ4oStSVmXbxJQdPr9WvvksCpETfGSLqes O8uas31zdTy7X6JG9yQBXBcOFzzA1Dtn0V+LqrNVsS3vQcc2QarLzJbwWi3Bi3QKigwc jYRyOirkW+gPN56JLjWXh2r8WR0fz+SekFq6/Y2n4MNC+G6clMWmyUMNtJDos/BLfnlD A2eq1Hou4Wl25Ad2xyKks9llKWPv3BsZbrHLbpN53jiLzuuG0oCLGc5MlF5PhUN4XnKU o1iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sXNjapxnyiVCWASJ3o+ZqmCkb8i/rTDNscQW8A2XYU0=; b=vGQdJiWS+44EjyHmO9xepjxWqAten/Tcpub+oKi0GjgJsDZkduBVzvJB+FXXXshTcB piRR8rSwMRzCLZxZW3LC3GXT7QEfRYdeV/krYqtmUNSwyRCKfpQZ9c9uhoWJgEt0kCkN DdvE5hQCl4jWdZaI5dIB3Fa35Lv1blPx+T5zrIwV5OoNf8V2nQOGkBZj7OP6Fj42zoJY NtZ/eytj2vbod+y/x2BwfzOaRFUlMq8S2luFFnXdRHxZxfUnkPDRYRtvBj/WGz4uHmF3 gJtlmCGTwHNpjJWHe6WkzOA7E5/dFLXvQzFiK/ZQ7XDBKshvAD1YoOf5Q5kb1QapCDLK yI0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B4MLPnYJ; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i205si10807229oih.257.2019.12.23.21.03.42; Mon, 23 Dec 2019 21:03:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B4MLPnYJ; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-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 S1725858AbfLXFDm (ORCPT + 3 others); 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(-) -- 2.23.0 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]); }