From patchwork Wed Jun 21 16:20:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 13296849 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 4327AEB64D9 for ; Thu, 29 Jun 2023 10:16:55 +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:References:In-Reply-To: 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: List-Owner; bh=uaOyrWEX8n58ULgGTjnBiv1BUIaXvNIba7Mg/OGHZDg=; b=v4v14L15+VvBem NTHmnwtbANHkV3rs1pBWRliA8ou0RiURFpcAvxlRJIhMZueec290GF9mY/bQLirIfblp+ywSPwXW2 EWGsIl6S2IQWTJ6j7Cj1cuxtTL6FQSNb9Yben5RMeA0e3SMuBHeMvnVF7t2xq3CDm7krb3H2vvGl+ zH5YNMjd61sOgJelj23Me6UW2ejDw6uJwV8PTiwwzcmEZI4GbfUtSuy71ebAWgFmAvql0tDo7CmU5 uk6QmwvjUVgXn8hbIJykFzYvPeMnP1Bh9+ZkGFnjckl4MUpK1xIlEhJ80iN7nDrK5uHPTtPllqW/N z9En1ZQaDO9errRFy9ZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEohq-000fpU-2S; Thu, 29 Jun 2023 10:16:54 +0000 Received: from imap4.hz.codethink.co.uk ([188.40.203.114]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qC0Z3-00F45y-1Y for linux-i3c@lists.infradead.org; Wed, 21 Jun 2023 16:20:14 +0000 Received: from [167.98.27.226] (helo=rainbowdash) by imap4.hz.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qC0Yx-0016iZ-Av; Wed, 21 Jun 2023 17:20:07 +0100 Received: from ben by rainbowdash with local (Exim 4.96) (envelope-from ) id 1qC0Yx-001z4S-0H; Wed, 21 Jun 2023 17:20:07 +0100 From: Ben Dooks To: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com Cc: Ben Dooks Subject: [RFC 1/5] i3c: show error with node for invalid reg property Date: Wed, 21 Jun 2023 17:20:01 +0100 Message-Id: <20230621162005.473049-2-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230621162005.473049-1-ben.dooks@codethink.co.uk> References: <20230621162005.473049-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_092013_516465_36869E7B X-CRM114-Status: GOOD ( 12.44 ) X-Mailman-Approved-At: Thu, 29 Jun 2023 03:16:50 -0700 X-BeenThere: linux-i3c@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-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org When adding i3c devices via fdt, it is useful to get an error if the reg node is wrong (say, you thought it was an i2c device and only needed one value here) and have the error show the OF node which was the cause of the problem (in case of many devices in the system), Signed-off-by: Ben Dooks --- drivers/i3c/master.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 08aeb69a7800..559fc2781a81 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2094,8 +2094,10 @@ static int of_i3c_master_add_dev(struct i3c_master_controller *master, return -EINVAL; ret = of_property_read_u32_array(node, "reg", reg, ARRAY_SIZE(reg)); - if (ret) + if (ret) { + dev_err(&master->dev, "%pOF: invalid reg property", node); return ret; + } /* * The manufacturer ID can't be 0. If reg[1] == 0 that means we're From patchwork Wed Jun 21 16:20:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 13296848 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 471EBEB64DC for ; Thu, 29 Jun 2023 10:16:55 +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:References:In-Reply-To: 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: List-Owner; bh=7CfTUlR3fXPVY9/Rz7HfZd+WmycNc8/UQCQgo0qfLww=; b=JXS4c8zi4BK/Ar wTlOWoqWke0dfJipuNyBnwcHyLcZaAw7GezhuQQ8yQKkuUNPa4ALVZJmlvBNtrVMCbx2TdUGWprNQ JCfBfIiH0mCBjCHlmKi0rk6jhd0MZ2otS0n1ITJoEXO6fFZrvSs1oiT/n88jDedO2deJXkrWvNNYs 0u+vopJAvWHsTvPCOklQF/9f2S3pLs0mPnlfBWR5PMh4epk31ZfrCegQ6GDCru07rMyyLvpbryrjz bNtY6uRJEHHd/1vHsWZnucOf4GTjJfIxM0C1yHI40bvPlY2D5g4WatlA2mPlmplikkrQhR/AR9JbK ybJBPkkHNlyXAkf9g1BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEohq-000fp8-1R; Thu, 29 Jun 2023 10:16:54 +0000 Received: from imap5.colo.codethink.co.uk ([78.40.148.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qC0Z3-00F45v-1S for linux-i3c@lists.infradead.org; Wed, 21 Jun 2023 16:20:14 +0000 Received: from [167.98.27.226] (helo=rainbowdash) by imap5.colo.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qC0Yw-00CSap-Fg; Wed, 21 Jun 2023 17:20:07 +0100 Received: from ben by rainbowdash with local (Exim 4.96) (envelope-from ) id 1qC0Yx-001z4X-0O; Wed, 21 Jun 2023 17:20:07 +0100 From: Ben Dooks To: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com Cc: Ben Dooks Subject: [RFC 2/5] i3c: add error print to show device failing during populate bus Date: Wed, 21 Jun 2023 17:20:02 +0100 Message-Id: <20230621162005.473049-3-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230621162005.473049-1-ben.dooks@codethink.co.uk> References: <20230621162005.473049-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_092013_491353_F8019C2F X-CRM114-Status: GOOD ( 10.35 ) X-Mailman-Approved-At: Thu, 29 Jun 2023 03:16:50 -0700 X-BeenThere: linux-i3c@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-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The of_populate_i3c_bus() does not produce much helpful output when a device fails to add, so addd an explicit dev_err() showing the device node that failed and the error code it failed with. This should make finding bad device-tree entries easier. Signed-off-by: Ben Dooks --- drivers/i3c/master.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 559fc2781a81..6316f3fc914a 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2125,6 +2125,8 @@ static int of_populate_i3c_bus(struct i3c_master_controller *master) for_each_available_child_of_node(i3cbus_np, node) { ret = of_i3c_master_add_dev(master, node); if (ret) { + dev_err(dev, "%pOF: failed to add device (%d)\n", + node, ret); of_node_put(node); return ret; } From patchwork Wed Jun 21 16:20:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 13296851 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 73CC3C001B1 for ; Thu, 29 Jun 2023 10:16:55 +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:References:In-Reply-To: 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: List-Owner; bh=5p5q34O+r8gQKksvHqQH66K1RdJYbTo8+AheZTCue+Q=; b=YmELI7aXUNoK8a cXuQZsGKv5QlcyeuAHtX3mG3IacbCRiu51Lg2nNHgpycr7VtvKyzRkAfjkEUCj1l9vrZx66gJZpKv 7m6VcF4VuCBVsMneA3S29xyjUEcCn1P3x3aDOShgktcEiGe57sVA4QBYqpvV/5g3wVj+bRqJxXxUQ 0wPZLnZzCCINGmSQ/OdlFjTTZC5gbt19kZ44yL9YkSeqR3h1+OEz7iGWd0NdFf9MJAdW5nuf/jg2O OkqtPlFmaywpRHcMvN/bEhCXfJXRAApYtTkJBO/KTPFpdqGsDkyFzbA3n5BwMt0tXUY9xK5aufgrD wAed8dKVfRW+pcZccivQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEohr-000fpe-06; Thu, 29 Jun 2023 10:16:55 +0000 Received: from imap5.colo.codethink.co.uk ([78.40.148.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qC0Z3-00F45x-2i for linux-i3c@lists.infradead.org; Wed, 21 Jun 2023 16:20:15 +0000 Received: from [167.98.27.226] (helo=rainbowdash) by imap5.colo.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qC0Yw-00CSaq-JA; Wed, 21 Jun 2023 17:20:07 +0100 Received: from ben by rainbowdash with local (Exim 4.96) (envelope-from ) id 1qC0Yx-001z4c-0U; Wed, 21 Jun 2023 17:20:07 +0100 From: Ben Dooks To: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com Cc: Ben Dooks Subject: [RFC 3/5] i3c: show node when printing unsupported 10-bit i2c dev Date: Wed, 21 Jun 2023 17:20:03 +0100 Message-Id: <20230621162005.473049-4-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230621162005.473049-1-ben.dooks@codethink.co.uk> References: <20230621162005.473049-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_092013_875785_91D2A296 X-CRM114-Status: GOOD ( 10.30 ) X-Mailman-Approved-At: Thu, 29 Jun 2023 03:16:50 -0700 X-BeenThere: linux-i3c@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-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org When an i2c device is errored due to not being supported, the OF node is not show (unlike errors from of_i2c_get_board_info). Make the failed node explict in the of_i3c_master_add_i2c_boardinfo() to aid in tracking down incorrect entries in the device tree. Signed-off-by: Ben Dooks --- drivers/i3c/master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 6316f3fc914a..bc42669f5c6d 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2023,7 +2023,7 @@ of_i3c_master_add_i2c_boardinfo(struct i3c_master_controller *master, * DEFSLVS command. */ if (boardinfo->base.flags & I2C_CLIENT_TEN) { - dev_err(dev, "I2C device with 10 bit address not supported."); + dev_err(dev, "%pOF: I2C device with 10 bit address not supported.", node); return -ENOTSUPP; } From patchwork Wed Jun 21 16:20:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 13296853 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 31667C001DE for ; Thu, 29 Jun 2023 10:16:56 +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:References:In-Reply-To: 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: List-Owner; bh=qBDPkZIXhMCnbOwgrvsAJqFwXExBsy0uK/tHmDMWHcQ=; b=KN1KT0JtjfMcme PfA+njpbyMqpDjphZEaN3Y83OLH9m3mk5hZg2StPniX3z96VJJArCN+TiHn1awC7rhN+VkQ2e435C c0eycMSOO5W4Up9OCKOIdJp3eD0bAkn4zwZYDsroo/dFWmYXQpbTat2UgJOib76HtmdBS6AOABHrl 5V4bfqxXLk7M6marsI2fB2hsMXKCCqZfYa6AUTFvFj2oAThthhhZWBE1ysFeAjG2RSG3VtqCWhsu9 Nm+QfghniW+3OrtpNAHiMtw6MysVLx8RBLAVmQB0XWhQblzkppIPk42dVLPtLpzbUKeVI3XTFJW1U zjqJulj38NiUK02FI3Fg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEohr-000fq2-2k; Thu, 29 Jun 2023 10:16:55 +0000 Received: from imap4.hz.codethink.co.uk ([188.40.203.114]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qC0Z3-00F45z-2j for linux-i3c@lists.infradead.org; Wed, 21 Jun 2023 16:20:16 +0000 Received: from [167.98.27.226] (helo=rainbowdash) by imap4.hz.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qC0Yx-0016ia-Dk; Wed, 21 Jun 2023 17:20:07 +0100 Received: from ben by rainbowdash with local (Exim 4.96) (envelope-from ) id 1qC0Yx-001z4h-0Y; Wed, 21 Jun 2023 17:20:07 +0100 From: Ben Dooks To: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com Cc: Ben Dooks Subject: [RFC 4/5] i3c: show error messages in of_i3c_master_add_i3c_boardinfo Date: Wed, 21 Jun 2023 17:20:04 +0100 Message-Id: <20230621162005.473049-5-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230621162005.473049-1-ben.dooks@codethink.co.uk> References: <20230621162005.473049-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_092013_883652_5AE93032 X-CRM114-Status: GOOD ( 12.72 ) X-Mailman-Approved-At: Thu, 29 Jun 2023 03:16:50 -0700 X-BeenThere: linux-i3c@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-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org If of_i3c_master_add_i3c_boardinfo() fails, then there's no much to say what the issue was (most of the error returns are -EINVAL), so add some printing of the errors using dev_err() showing the node that failed and what the issue was. This should help with finding which device-tree node was causing the issue and also mirrors the i2c case where it shows the node and the error. Signed-off-by: Ben Dooks --- drivers/i3c/master.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index bc42669f5c6d..2a9ebb1d9d57 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2050,32 +2050,42 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master, return -ENOMEM; if (reg[0]) { - if (reg[0] > I3C_MAX_ADDR) + if (reg[0] > I3C_MAX_ADDR) { + dev_err(dev, "%pOF: address too big\n", node); return -EINVAL; + } addrstatus = i3c_bus_get_addr_slot_status(&master->bus, reg[0]); - if (addrstatus != I3C_ADDR_SLOT_FREE) + if (addrstatus != I3C_ADDR_SLOT_FREE) { + dev_err(dev, "%pOF: slot in use\n", node); return -EINVAL; + } } boardinfo->static_addr = reg[0]; if (!of_property_read_u32(node, "assigned-address", &init_dyn_addr)) { - if (init_dyn_addr > I3C_MAX_ADDR) + if (init_dyn_addr > I3C_MAX_ADDR) { + dev_err(dev, "%pOF: cannot assign address\n", node); return -EINVAL; + } addrstatus = i3c_bus_get_addr_slot_status(&master->bus, init_dyn_addr); - if (addrstatus != I3C_ADDR_SLOT_FREE) + if (addrstatus != I3C_ADDR_SLOT_FREE) { + dev_err(dev, "%pOF: slot in use\n", node); return -EINVAL; + } } boardinfo->pid = ((u64)reg[1] << 32) | reg[2]; if ((boardinfo->pid & GENMASK_ULL(63, 48)) || - I3C_PID_RND_LOWER_32BITS(boardinfo->pid)) + I3C_PID_RND_LOWER_32BITS(boardinfo->pid)) { + dev_err(dev, "%pOF: bad PID\n", node); return -EINVAL; + } boardinfo->init_dyn_addr = init_dyn_addr; boardinfo->of_node = of_node_get(node); From patchwork Wed Jun 21 16:20:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 13296850 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 D3F08C001DD for ; Thu, 29 Jun 2023 10:16:55 +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:References:In-Reply-To: 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: List-Owner; bh=eeR63sXdic8Eq1KN7CQztsiBS+NlOtqDRcbDvgVd70E=; b=MR/wpYvFDCkGrI lgxjV9vex+Bd4cvCT4shhrOMv2K5pwUkALXUclE3b+OlnqcI0vMaE+XFYSIybMFwQTHAPDQQeDPNE 0Ymi7ZfNE75J8hDXl0UZf+jMll2hHXFjVdx+FrpX+wpaMapWV4BDdbBtXbztRc8N02ooSmmW0g8JZ MM70JUbTCSoeCpaO102HthOGxKc4TXJQ4FIn0CanUp9yWVCJSbM5Ao7M8mNJn35XPYZQEtCTicVb3 GKGwCZbjSjUTxakdmaB44XF8PGTElPMlPN9Le5IK1OPuo9HLGHo1ggfmf2vUaRIV3z3qfGDr0w7+x /Tv5n0Yq9eq2YBimYbXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEohr-000fpl-10; Thu, 29 Jun 2023 10:16:55 +0000 Received: from imap5.colo.codethink.co.uk ([78.40.148.171]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qC0Z3-00F45w-1e for linux-i3c@lists.infradead.org; Wed, 21 Jun 2023 16:20:16 +0000 Received: from [167.98.27.226] (helo=rainbowdash) by imap5.colo.codethink.co.uk with esmtpsa (Exim 4.94.2 #2 (Debian)) id 1qC0Yw-00CSar-IB; Wed, 21 Jun 2023 17:20:07 +0100 Received: from ben by rainbowdash with local (Exim 4.96) (envelope-from ) id 1qC0Yx-001z4m-0c; Wed, 21 Jun 2023 17:20:07 +0100 From: Ben Dooks To: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, alexandre.belloni@bootlin.com Cc: Ben Dooks Subject: [RFC 5/5] i3c: dw; add print if cannot get resources Date: Wed, 21 Jun 2023 17:20:05 +0100 Message-Id: <20230621162005.473049-6-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230621162005.473049-1-ben.dooks@codethink.co.uk> References: <20230621162005.473049-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_092013_562340_0DF23DC9 X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-Mailman-Approved-At: Thu, 29 Jun 2023 03:16:50 -0700 X-BeenThere: linux-i3c@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-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org The devm_reset_control_get_optional_exclusive() call does not print any errors, neiterh does the clk_prepare_enable or devm_request_irq() call. Add some basic error printing to make the probe failures easier to debug. Signed-off-by: Ben Dooks --- drivers/i3c/master/dw-i3c-master.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c index 9332ae5f6419..ffc84ff6225c 100644 --- a/drivers/i3c/master/dw-i3c-master.c +++ b/drivers/i3c/master/dw-i3c-master.c @@ -1429,12 +1429,16 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, master->core_rst = devm_reset_control_get_optional_exclusive(&pdev->dev, "core_rst"); - if (IS_ERR(master->core_rst)) + if (IS_ERR(master->core_rst)) { + dev_err(&pdev->dev, "cannot get core_rst\n"); return PTR_ERR(master->core_rst); + } ret = clk_prepare_enable(master->core_clk); - if (ret) + if (ret) { + dev_err(&pdev->dev, "cannot enable core_clk\n"); goto err_disable_core_clk; + } reset_control_deassert(master->core_rst); @@ -1446,8 +1450,10 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, ret = devm_request_irq(&pdev->dev, irq, dw_i3c_master_irq_handler, 0, dev_name(&pdev->dev), master); - if (ret) + if (ret) { + dev_err(&pdev->dev, "cannot get irq\n"); goto err_assert_rst; + } platform_set_drvdata(pdev, master);