Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1829757rwi; Tue, 11 Oct 2022 00:31:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6mnUyZzj/Pe4YU3hU4GkrvvdyrhXxDUv1a8zcNO5gEJq9YlX9ro6SfuyULMsCxGIlDNrpy X-Received: by 2002:a17:903:230d:b0:183:7f57:b5fe with SMTP id d13-20020a170903230d00b001837f57b5femr3325622plh.27.1665473513977; Tue, 11 Oct 2022 00:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665473513; cv=none; d=google.com; s=arc-20160816; b=jGS+65W8ldwtVIiB27775A8qT5NFKuM+8Iulw0WKmNJxCKDHfsugOS2SKFKy/cVVBA QxCGEBgTgd1ixt5SXK1TvKZ36c3uPCzogv1nxH9E/2x3hIG4nMle8ckgkr/hXs6+DJxa vifAXYug8qJeSMU4D+XS/oGtAvLKDSkJCc+8hOa2wlob/Kky/sA0qDu01muC6hwPnTkY UW1nOk4gai7OKjXms5mpP+HNiigima4fSw5WQOsAkgc5nFG/ZuSP4BdfcnYfe/vdPq9h WL4kchoyoNYIszf6lSth7tWS9koS9G3WZrowHQxYWLhc6EXN5QZ3fy05Af5lg5Xj4Cha mVJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=sQRQAFc+KwmyKBkzA/rizi5kxlZCabam4PEFnkxoOlI=; b=SassM6L39Glw9zzE+uN+AWfIXloPXG6dyjRb4MUm2Lsvnp51qNwtzHeAtBkM/nHI+L 3IS4kJ+eY3Xj9p0lxb5ZA8zVdXW8O9ZTa2vCvS51r3RVeaA7tHtfCFt8ZUt+io1ogZbe KxEjgoIYX5TzdCJKE9EdIKYh4UYZiYHZXbN/2xsT8LmWS5zlWz4FUYcggn92ue9a/VUE N1QUmV+cbf/LgtrKjGPE5IuzHWx87rEeSCKNSxhi6SQlcNz/iBX0W/GFAMgwk/c1Quje mZj+pUCez40aEEZ4KeBdmw83z/9IUopszRkz2RHTGwVC/DEvsfWXKHpUEjmoQ7gZ6QNf qAZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=d+xhUNiy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 200-20020a6300d1000000b0045f0757ead9si13408583pga.727.2022.10.11.00.31.39; Tue, 11 Oct 2022 00:31:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=d+xhUNiy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbiJKGjA (ORCPT + 99 others); Tue, 11 Oct 2022 02:39:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiJKGi6 (ORCPT ); Tue, 11 Oct 2022 02:38:58 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97AB36525D for ; Mon, 10 Oct 2022 23:38:56 -0700 (PDT) Received: from [IPV6:2a01:e0a:120:3210:ae63:39ed:8275:38f4] (unknown [IPv6:2a01:e0a:120:3210:ae63:39ed:8275:38f4]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id 833AF6602343; Tue, 11 Oct 2022 07:38:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1665470334; bh=4OqSDwAWB/8lJv+0r9Z1nmJEkUKrOhG1b7aYoMOaaZc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=d+xhUNiy8Vzv2upP0uDiAboiLyyvfkBeLdHocQtqCCGQycYHsF+MKIL0xZy6REvWx dNHJTODHtmr+dYlaC9Af0P5O01ofQt+mNiN6OMAem6jMaXooU3q8EQG6v4221rBdfi sl5biSu57db0Ci50HrP2LyimzLVzpC0ZvduXqGiKLfZiBJKe/aigPAENw4WxQ5R1Mi MWt6qOjDDKjMrlIfWP+O7AONNPHQ0hjyhwd3HPyYxdngjhS7JUPG19ievePYiRt5Ud VwrMjl28ywFzfq4R39Ofww5HO5yoYn4g0zpBDAL6QWJlYtj6fcVBbwvlLXqfC8ryXx Rkl5pmAfb2Bmg== Message-ID: Date: Tue, 11 Oct 2022 08:38:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3] soc: imx: imx8m-blk-ctrl: Defer probe if 'bus' genpd is not yet ready Content-Language: en-US To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com References: <20220919121302.597993-1-benjamin.gaignard@collabora.com> From: Benjamin Gaignard In-Reply-To: <20220919121302.597993-1-benjamin.gaignard@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 19/09/2022 à 14:13, Benjamin Gaignard a écrit : > Depending of the boot sequence 'bus' genpd could be probed after imx8m-blk-ctrl > which led driver probe to fail. Change the returned error to allow > to defer the probe in this case. Gentle reminder about this patch. Thanks, Benjamin > > Signed-off-by: Benjamin Gaignard > --- > v3: > - only return -EPROBE_DEFER if 'bus' device hasn't be found. > > v2: > - keep dev_err_probe only change the return value. > > drivers/soc/imx/imx8m-blk-ctrl.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c > index dff7529268e4..1c195e9e8895 100644 > --- a/drivers/soc/imx/imx8m-blk-ctrl.c > +++ b/drivers/soc/imx/imx8m-blk-ctrl.c > @@ -214,9 +214,14 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev) > return -ENOMEM; > > bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus"); > - if (IS_ERR(bc->bus_power_dev)) > - return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev), > - "failed to attach power domain \"bus\"\n"); > + if (IS_ERR(bc->bus_power_dev)) { > + if (PTR_ERR(bc->bus_power_dev) == -ENODEV) > + return dev_err_probe(dev, -EPROBE_DEFER, > + "failed to attach power domain \"bus\"\n"); > + else > + return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev), > + "failed to attach power domain \"bus\"\n"); > + } > > for (i = 0; i < bc_data->num_domains; i++) { > const struct imx8m_blk_ctrl_domain_data *data = &bc_data->domains[i];