Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6129413iog; Thu, 23 Jun 2022 11:59:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uWGbw49tNMmXLoTMJdpDNpVVxNNLjM1Tq/RiAWTFDtAh2BAhOCH1CTBzx0LiisPnRqbGr5 X-Received: by 2002:aa7:dac2:0:b0:435:76a2:4ebe with SMTP id x2-20020aa7dac2000000b0043576a24ebemr12359423eds.196.1656010743482; Thu, 23 Jun 2022 11:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010743; cv=none; d=google.com; s=arc-20160816; b=QL0oOUn10W8WQj+2mtfQQ7vvCNNLPLxP/srYAGzUqOUzHtt0+UwdpZNjma4mhYPZfb vQquG1ndOlhxdBSVgQXXd0Dix+tg3a1Ic/wna+C+fxSbM81fEHQElNvZBhEETgDfkKuP PM4gOTWFvBbfgcPfEXTOc0APQI9uyxPIPsV3PM23XUj2gzn1XPjlKdoxPpJdLNZGeqH5 4J9dVfQBPyML9zxXNSllHR4pkAudveOZDEroDLuNA3ZhJgIAHl3j9o8HjuLTE3VV8KVI K5V8NyrL6d6Hu9As3DwbkGTighY7/TDzHA9mUtguFN0U+/bVsmJkdWgqj31tBZI0Sm+0 PmYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EL/06AiO/r0aaZHGPm8olM4Z1g8u3q+FzLtpTcwW9+E=; b=v42YCEk3rnwrQQO7xFmXXXcmNyFuP0lV6nLqSizAEs6hl8qithg7XB8m0XI8JeXkg/ 1SZB/xY0TXKOVEI21t6RJZT82f6vOTgLxDNnjci2S1zjIkUMV6+eWNkVUZL+Ypdk2Lrg YGYadLcMfhxAaBv9OxaNyCHd2sJWzPEOYZ5p/UzmFTAE3GIs7uXwwXsj/p+HG7CWcf0N ZVFxsvGSjMmG2t9IcqbKyxq7DQKU/72/6VEX/tQU9tqbsW+QyLtAL19owGyFX6bx4zl8 goIiaMJYBEq88kAzrNm8dyb/hmqT3t5ZWQVZvMtTr+4dAK0Q12iWJ9cyIbQTj6TrbY98 Jpvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=JnCT42yA; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb44-20020a170907162c00b007175ffc8ba1si9044759ejc.993.2022.06.23.11.58.36; Thu, 23 Jun 2022 11:59:03 -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=@google.com header.s=20210112 header.b=JnCT42yA; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237195AbiFWS0j (ORCPT + 99 others); Thu, 23 Jun 2022 14:26:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237203AbiFWS0I (ORCPT ); Thu, 23 Jun 2022 14:26:08 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73DD86F7BE for ; Thu, 23 Jun 2022 10:27:23 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-31772f8495fso1258077b3.4 for ; Thu, 23 Jun 2022 10:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EL/06AiO/r0aaZHGPm8olM4Z1g8u3q+FzLtpTcwW9+E=; b=JnCT42yA4RwkalddkzPrJcFW4xS8/AuSbzy9tJ3tePu5bM24Ibqr3x++pzaPDrLfSq kaGJTArX9fUCrT0wKKOCtTLYJfjz7rj9imdcL7Pqfb4slmHg8IMENvZlqFm4OXbLEZny J9YpduFdJ0C9SGIfK3lAhmOLKKSD54emhGXwyTKd4zLc6mUsVCr0UEcbk+IU96MD0I9r JA/jzjJFQ+fQd7mJ8EkAmfjizWANCRRDX1m02PA1R+yQuTc3BWGj/hPC7P5U7eOqhdOe TNE+ns8QKBZrDwGhF91i4cSeiE94OXjudpzhMpSeD6m7B9EcjFqLK1KazAZTYMoHsxV2 /pXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EL/06AiO/r0aaZHGPm8olM4Z1g8u3q+FzLtpTcwW9+E=; b=2qY9OS7f0bSwluzMsWQ1zfD4rr6o07DXrJnIJKUHnnNGZvZF6r794e3b+77/uGS3IB j4PNFnRZVHsT9VErPPROQ4WWmpdjGR/ZOpzMYd9SBAGYXsZd9+F29AAeXbV9rOD7p5bo iduft982VRNeAUYgOjbLl9e0R8/Zfw/7XSJomhDj4XvswJrCwjZqhSd61po1b/bW4D7q 3epRdRE/W2IoCXoPGY3l0xkacDwWX+l8ANrw25gCHti+peaEQA+sGvo61MhNrQMEF9Oq yN7Bci9OMY0QvA4pe7J5DqDbl7tjE+0juRDhukaQtxXBO74mrxN0+t6JilX5Dp4YxCuH 2OBA== X-Gm-Message-State: AJIora+ORBBVQurXGbn+gSn7SrJqJGvrJiVDt5pFPQbyKm6KIfSLF8cc H2DZDD2MTq5cQgLX5StbH5OBp5m9KhvOzCkH6zLEVA== X-Received: by 2002:a81:a095:0:b0:317:d4ce:38b6 with SMTP id x143-20020a81a095000000b00317d4ce38b6mr11755149ywg.83.1656005242403; Thu, 23 Jun 2022 10:27:22 -0700 (PDT) MIME-Version: 1.0 References: <20220623080344.783549-1-saravanak@google.com> <20220623080344.783549-3-saravanak@google.com> <20220623100421.GY1615@pengutronix.de> In-Reply-To: <20220623100421.GY1615@pengutronix.de> From: Saravana Kannan Date: Thu, 23 Jun 2022 10:26:46 -0700 Message-ID: Subject: Re: [PATCH v2 2/2] of: base: Avoid console probe delay when fw_devlink.strict=1 To: sascha hauer Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Rob Herring , Frank Rowand , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Len Brown , peng fan , kevin hilman , ulf hansson , len brown , pavel machek , joerg roedel , will deacon , andrew lunn , heiner kallweit , russell king , "david s. miller" , eric dumazet , jakub kicinski , paolo abeni , linus walleij , hideaki yoshifuji , david ahern , kernel-team@android.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, iommu@lists.linux-foundation.org, netdev@vger.kernel.org, linux-gpio@vger.kernel.org, kernel@pengutronix.de, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Thu, Jun 23, 2022 at 3:05 AM sascha hauer wrote: > > On Thu, Jun 23, 2022 at 01:03:43AM -0700, Saravana Kannan wrote: > > Commit 71066545b48e ("driver core: Set fw_devlink.strict=1 by default") > > enabled iommus and dmas dependency enforcement by default. On some > > systems, this caused the console device's probe to get delayed until the > > deferred_probe_timeout expires. > > > > We need consoles to work as soon as possible, so mark the console device > > node with FWNODE_FLAG_BEST_EFFORT so that fw_delink knows not to delay > > the probe of the console device for suppliers without drivers. The > > driver can then make the decision on where it can probe without those > > suppliers or defer its probe. > > > > Fixes: 71066545b48e ("driver core: Set fw_devlink.strict=1 by default") > > Reported-by: Sascha Hauer > > Reported-by: Peng Fan > > Signed-off-by: Saravana Kannan > > Tested-by: Peng Fan > > --- > > drivers/of/base.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/of/base.c b/drivers/of/base.c > > index d4f98c8469ed..a19cd0c73644 100644 > > --- a/drivers/of/base.c > > +++ b/drivers/of/base.c > > @@ -1919,6 +1919,8 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) > > of_property_read_string(of_aliases, "stdout", &name); > > if (name) > > of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); > > + if (of_stdout) > > + of_stdout->fwnode.flags |= FWNODE_FLAG_BEST_EFFORT; > > The device given in the stdout-path property doesn't necessarily have to > be consistent with the console= parameter. The former is usually > statically set in the device trees contained in the kernel while the > latter is dynamically set by the bootloader. So if you change the > console uart in the bootloader then you'll still run into this trap. > > It's problematic to consult only the device tree for dependencies. I > found several examples of drivers in the tree for which dma support > is optional. They use it if they can, but continue without it when > not available. "hwlock" is another property which consider several > drivers as optional. Also consider SoCs in early upstreaming phases > when the device tree is merged with "dmas" or "hwlock" properties, > but the corresponding drivers are not yet upstreamed. It's not nice > to defer probing of all these devices for a long time. > > I wonder if it wouldn't be a better approach to just probe all devices > and record the device(node) they are waiting on. Then you know that you > don't need to probe them again until the device they are waiting for > is available. That actually breaks things in a worse sense. There are cases where the consumer driver is built in and the optional supplier driver is loaded at boot. Without fw_devlink and the deferred probe timeout, we end up probing the consumer with limited functionality. With the current setup, sure we delay some probes a bit but at least everything works with the right functionality. And you can reduce or remove the delay if you want to optimize it. -Saravana