From patchwork Wed Aug 30 14:17:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13370284 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 01A60C83F15 for ; Wed, 30 Aug 2023 14:17: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: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=28lIqm6o7RfuVs4j8mC67aqcxmTZ5R9tPQtUhCg80YQ=; b=PhNqgOP0YVnhhv kS4AvskZZhEIkxaDv8iMAxsUMEkoXVwQkgYRz7EaZpm0s74sVyuwKH5F6z8KQgM5kENFYhXS8hmkE aILGVrAqE+upo/si7m00P+9XrVVZZmozNqAtx5/sK8Rq4245a4/rPAXqQizyEvjZm8EM/rz3Dcyn2 wOP3yCpXuIG1KVdPDy6nBxgJUKn7sLhOaKXL85f+tekEf3zjCfGdkUZaSC1S/ecGM7QsXJswLXVOX Qb29oQ+GGlgUC8LqDMHbs3x7WSSD7kT2/iueRCXoIOm1BOzxReoJ0q1HYTTCaYR+/x4AtLcR6nW6b owwTied/20Mtgk4FAUgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbM16-00Devn-0A; Wed, 30 Aug 2023 14:17:56 +0000 Received: from mail-he1eur04on062a.outbound.protection.outlook.com ([2a01:111:f400:fe0d::62a] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbM14-00Deuo-0K for linux-i3c@lists.infradead.org; Wed, 30 Aug 2023 14:17:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FBIYR5fefWFl0QhLhAS9JumF1YXYiOxl9T0q653BA4nqhr3EfvnFrLHqfR3G02Jg4fxCyzrqGhxpDyJ/D7WZTioFIVN9XhpcVsqxck9RoNyCa10I3nbrOah2iG9e2uc7YFT7dco3WDgjv9O49v+LrnrzKgar9EHxo/mGDj4wPNuCyJDsREFTwXmt0bQ9R228f4++5w1z208CYq92IO7LyqDWmjfEuqBuf/cpqvnEzk5mdsEZ8DUXJdGA0huDoeJaMNYdureEOyEYjCELC3tzIwd6Ufh2u8nNMu9X+Ey6zmUKeZnU7qunqEqkV1RvP8YQ6KH6dgU7j+NaK8uoBw2eUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Mojyn39deYAsc5Hlyy1QnY104DFhnGSerOFCf3o0JbI=; b=iNsnr0vwS8RUMNhw6tcjsrhcWGiHgiArnyLdSgctab/+E/Nppcp1jRUd0YAKqJ7l0gENP0xJZ2eGgHLmZGRxQUAF1zNPto8XjI1JvvvgNiBvnCTX0N1Ri+KltOsmwIxSgftoNrQTbwo2QkHRP4svgQ6SBJb6BzdZ40wOmouPp52hONQefJmxqjiYqZxtxws67Le8T2ziM0s5OqlZkPDHoMelm13WclzZPubvpCO6sV67zV71tXQb3Jybx5e9tlMvBgLaGpe95ldXM9sE4EazRyJL3NWhHZT0UlpB4E5D0uXMcxOhiNx8ZbPquMByVVbBgLEb+mpDAozQi1fB4gJUfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mojyn39deYAsc5Hlyy1QnY104DFhnGSerOFCf3o0JbI=; b=CX04i3hTLOmC5x8zCboF2lFcFHY6pwceTfY5OEGSo7jXaJ9RWhzpO0P4ei8La9hmThpwfyEki2K/VY4lRFdEL7UdbJIJ4n4t8bS05sunEn0d86ekpWLjGl43RUm+I5PfbNfEp/OB78KDWRqOV/UKyAIRYbdBmTgsKyQQf4nSgtI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB8PR04MB6827.eurprd04.prod.outlook.com (2603:10a6:10:f8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Wed, 30 Aug 2023 14:17:45 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::a680:2943:82d1:6aa8]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::a680:2943:82d1:6aa8%3]) with mapi id 15.20.6699.035; Wed, 30 Aug 2023 14:17:45 +0000 From: Frank Li To: miquel.raynal@bootlin.com Cc: Frank.li@nxp.com, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] i3c: master: fixes i3c bus driver probe failure if no i3c device attached Date: Wed, 30 Aug 2023 10:17:26 -0400 Message-Id: <20230830141727.3794152-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SA1PR04CA0015.namprd04.prod.outlook.com (2603:10b6:806:2ce::11) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB8PR04MB6827:EE_ X-MS-Office365-Filtering-Correlation-Id: be840c4e-427a-4b7c-0546-08dba963e130 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pB38Fx3owMPNwx12TUIQSSp+ezy+C8Ahu8iRFBaUFDszyvA+TNmzm8ju92cKG+45nDsgmwQJ2W5wkwV99ZuRa2DeTsnoWB3QI+2MfcadGVYzY3ZgIIPtgNzQqYs6i8rK5XnCI9af9WxR4eOE5DDDB/UPiEQodGPAmkks6Y8G3PqkbqBR9Znh3uYa/p5TVFGWaeiPLN66kX/Fm2VCA5aMzMyghlG2P6LdvO5l+QKPI/1hEYcOS8HIZEAs83fPIAXWy5iZc6yM0f/2pVXe4clcy8lZEz08cywsD/jWx9TCJAf6yh0xH+hG6SUkSq+iS+t6EoEBKoX4zobvd2I3dLwOa/O2pEYYY/o3uc5bjjIS2jn2hhRMU8PIYiS8y0dlJ2esztxC2xf/RV3r/85hXrvDDTSfDYvVYBhUIoEDVMdy+mEAYR+WaZnrcl2gaw5JSEntOxRdqUaa1Gpi3uhxV7OKYXE6vi0jMf9hQ0vYbIEXuY9x6MyqPZhV8IKIFK1gdGfSmM+Ho41FcGyLcCtjoksBqcnUGV2O9PFPApDDbnPGB8KlmwXxMVdAELt8MkCfcZ2BcStJyyF8uYPLlSdx589H/EnCCUPd64Ge0UvKQtGvq8zC6Z2UGBR+g50Qa1r7B84Mhnt73O3HJm349pIahe21oQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(136003)(346002)(39860400002)(366004)(186009)(1800799009)(451199024)(66476007)(6916009)(36756003)(316002)(2616005)(66556008)(8936002)(478600001)(4326008)(6512007)(41300700001)(1076003)(6666004)(8676002)(66946007)(38350700002)(52116002)(6506007)(6486002)(2906002)(83380400001)(38100700002)(5660300002)(26005)(86362001)(42413004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iuEqGxyVzLqsVy55RYGtRbEeRuozruaEzls5X/59ofBP/YMjYr3UV9qi0Mb7+M0ZeCGDJ8Afb2y3PUrkL2PsyOtVcj7h9BD390tJ0+KFViLt8XQyaFgEA3WVLYKbmBYebbmhItcYxIjdwMbeAxcKO7DEqgdF11W+nYXQXdmBFbq4VQEF4vkgeBQ1Ujgms9d/15e4giJ3xQI1B8nM1RobgK5eyHnZMtd3usHuwBjB6KXEBhX93XQ0coVo0FlUVGGMbBHWUyDQZ8g7OzIMPmTQbwj9nvGW11fnrAg+yl2Uf3q2b9y2Bk9Ur1rdtI0pa1vf8RtzCF4COXZ/9UdQ9XZKa1PZUpEUd+XgZMx47vS5x1uqsgWdRq6w4lnvMgUd/Nxh3WvNVqz9Kj5LcFQhZPJPK3zaXwVmBXac5xr6biV2H2u6fHXd/MvFIkxJwzQRcwzjEY6/blSr2WosR8cQyHzg1MzvrD8CTjxtvCRVhsdvWycSRVXvNwNA/TwVLwD7QNC+bjQBY3BcwxAFGWmWYqQtq7Z2YaYncqZighu7ulXjlXTGagyZJ4HE722lTEvGwlSFYUesf1DKO4uloCuY59AmyeUIyeavSlvVzZFY0uuQLXoVES3VMFT1fLMIl7a8BCdXT4+04cr9leDT5lEoPYd50rf+tz+bINqv6xJzAc6N2zsxdBo6MMIPv0BbUUX31y/6OTcr34NDICexDfacgwVtYTpIlFP9kG/+uYwyHhrVpoA5B5ay2wn4sM1wCs1f3RHiKsbQZYu92rRDSR8Wd1RGuWt1LXGPEAWywcEB7Aa6zcvSUI3T1Q9HucIlTqsah4nADeoi4gzJtDgr/IC6oFdhorxnTfnTyn1s6IOXeC5RKMfm0pYBZMHy80VqovZG6OijOjIBXRPXkLU2uo3SwNJ1+YAkJRBKuwObcxV1E13RJFPfjqHRDhEA+wFs/3l6NqEzudxmalGI8n+w/phu7nT8VAL89jTebyr5uRYpx4G6pvTaeqpcGx81ojqzkJFgMKWSZg67oRPsdI/4o/IYf1c6ivUNOrDaZzR4yy5+IqoKOOPqLa8rEikFBQkpvt/HOhSGlg+aVuHYC9cxvuUlq6faZ0F20X6Bl+lc1A2qltG1F3tvFH8xV6S86ucJOM5JUcSZArGplCS1SrK3chqy8zmAcybQY+gL85LEZFTPR6/kAmxVBiRXlMFiJdKXDbryrbWca3cgdWx+sv/+n9AlfkWrHWCiTynDtztocarq7IL7G6eC+cMoqFLcjDkwFhVzx6+5grvNii2xrUW7MKfJg44jnMm1XkJq84ORdnrofCreKOKP5PIWZ9eMiaW4IxUH+QSgmc9xMbGMM2lDNTfH5GFCCwTdWuA6vFsG+PmZqvxzl9ZfnKW9V9owiTaMJ1yR3jupEUUeegKYEWQ8B4ai7apgXrWJc02N13pj0nFMYrJJcI7K/n9XHrsZj8LW5xA+fq+6iZzJrgHBJqqbtwgZOukxBgAxKTXMUCC0EHEogIQPu2b8E0pWBxjf4wbBTCQxaXq61MqNcnbwAo0iL2ivmI3pj+Y2LrzTkxqUIYrOxzLr30Q= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be840c4e-427a-4b7c-0546-08dba963e130 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 14:17:45.1444 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cY0uCg5TnNRD4Gfv2acqb/K5XAFu00nMpRDH3y6Mgn6u9KR9sAVj14qAH4gogH8TezDWxwB106eQeA91n9pJCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6827 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_071754_219404_E4402377 X-CRM114-Status: UNSURE ( 9.19 ) X-CRM114-Notice: Please train this message. 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 In i3c_master_bus_init() { ... ret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR); if (ret && ret != I3C_ERROR_M2) ^^^ // it is enum i3c_error_code ... } In dw-i3c-master.c implementation: dw_i3c_ccc_set() { ... ret = xfer->ret; if (xfer->cmds[0].error == RESPONSE_ERROR_IBA_NACK) ccc->err = I3C_ERROR_M2; dw_i3c_master_free_xfer(xfer); return ret; } Return enum i3c_error_code when error happen in i3c_master_rstdaa_locked(). Cc: stable@vger.kernel.org Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Signed-off-by: Frank Li --- Notes: Change from v1 to v2: - cc stable drivers/i3c/master.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 08aeb69a78003..00a82f3ab9ac0 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -783,6 +783,9 @@ static int i3c_master_rstdaa_locked(struct i3c_master_controller *master, ret = i3c_master_send_ccc_cmd_locked(master, &cmd); i3c_ccc_cmd_dest_cleanup(&dest); + if (ret) + ret = cmd.err; + return ret; }