From patchwork Tue Apr 18 08:35:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13215236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9AEBC77B76 for ; Tue, 18 Apr 2023 08:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xc/JvFkPExb09ASveHamNUkfCU8ZWonWkEIcbGbK+Cw=; b=0NBsA5pd3OcF1u kHfFLQmFGVKnbxNauwhdWjAUUXeUOvQ9YXeJA9B8ML1uhDkz4rPCnrchDSBelXWNvO5KINR5fzKEq Jmjy6ygwinW+5oozbOfsA9vZq+9Zw90CVZ/xXlZVIQ0cCaoC5IH1GTPOblNzujrJGSmSit6JdglEn DKWsn12sfKrVBs3EoueaIxA8ny2jJBplZd9kVUwejuMGyDlUXkcdaWGSSzXTlkglxzX90ksQF6Pu+ b9GmKfmPZry9i1uqtEpVcoOQDf8M1PuZMk36t9a5Jt8fPGHaDo6teiekvtvQGMyTsbRanwExaNGX6 tOfyUl+UX56UGpb+bScQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pogo0-001KGY-1P; Tue, 18 Apr 2023 08:35:16 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pognx-001KFR-0L for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 08:35:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681806913; x=1713342913; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EpL+GTwf+VU6IHgsMttB337kq77ZB+0+82oQfGvU02g=; b=SzSow64bDEPkStGvEV6xAQXjh4kuxY2qOs2Ruod28u9WQKBvFaBxrJeT Tj4PuSyXeA2cWx5iRjiw72e7kI0C9xWZWytG+o1NG/XMAkOMShxIsp0Fq wmigaXJQRY8bkGw8j59g5wZc5SggErZijOepzCGBJwB8kWLeSoxcVHtEU oFf4iRSn2Vh4A0Ywk4gYo3j94jQDpQh4YNX263nTGOole+pOVv6NW3SNk 1SMmflHjacdZYucQ4Z2xN7NaswJNwjvC+6UDnadGJBpmz2oiTguxwfg0S +OPcIUGvw8PF/CfIjFqXmxLFUKEe23DPI+XnySR+PP6eQH/c9YwFbR/65 g==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30389895" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 18 Apr 2023 10:35:08 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 18 Apr 2023 10:35:08 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 18 Apr 2023 10:35:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681806908; x=1713342908; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EpL+GTwf+VU6IHgsMttB337kq77ZB+0+82oQfGvU02g=; b=n83rkcTz5dNgFTtRrNFVaIMyoNm3nsRTzPUBmUXlWJRgjNtTYIuN+Cy2 7lMaGmDwNbL4bNLyKy0KN9jBtURmJi9jRC06gOPeSN6hc+zifI3PqnZNj 9nKtp8SZnH/aX36nHpc4FMhJK6/ENOoAo4lMQx3lmQE1J7oJpoS+hrc21 nz1+H/qiOkmU8rkngydyczPeifRQWDUWSjcjyyNWnk9SQaKRr19Y26U1U vet3erbE/M/U8bFqpXbdMIVf4EfNgPrgJQrHqneJeZ8AyToW5bDSXmTBT DWBQPZ5WQ9kLAY82r6CEuXIwRDKdeavrO4fn2SL29Jzc9U+fjhbq36ZS2 g==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30389894" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Apr 2023 10:35:08 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 4BB87280056; Tue, 18 Apr 2023 10:35:08 +0200 (CEST) From: Alexander Stein To: Mark Brown , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests Date: Tue, 18 Apr 2023 10:35:05 +0200 Message-Id: <20230418083505.466198-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_013513_522758_F096C796 X-CRM114-Status: GOOD ( 13.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If dma_request_chan() fails, no error is shown nor any information is shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned. Use dev_err_probe to fix both problems. Signed-off-by: Alexander Stein --- With this patch applied /sys/kernel/debug/devices_deferred actually shows these lines on my platform: 30820000.spi spi_imx: can't get the TX DMA channel! 30830000.spi spi_imx: can't get the TX DMA channel! drivers/spi/spi-imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 34e5f81ec431e..b23325a3bb667 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1318,7 +1318,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, controller->dma_tx = dma_request_chan(dev, "tx"); if (IS_ERR(controller->dma_tx)) { ret = PTR_ERR(controller->dma_tx); - dev_dbg(dev, "can't get the TX DMA channel, error %d!\n", ret); + dev_err_probe(dev, ret, "can't get the TX DMA channel!\n"); controller->dma_tx = NULL; goto err; } @@ -1327,7 +1327,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, controller->dma_rx = dma_request_chan(dev, "rx"); if (IS_ERR(controller->dma_rx)) { ret = PTR_ERR(controller->dma_rx); - dev_dbg(dev, "can't get the RX DMA channel, error %d\n", ret); + dev_err_probe(dev, ret, "can't get the RX DMA channel!\n"); controller->dma_rx = NULL; goto err; }