From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DECEC433EF for ; Fri, 1 Jul 2022 19:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231163AbiGATN4 (ORCPT ); Fri, 1 Jul 2022 15:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbiGATNz (ORCPT ); Fri, 1 Jul 2022 15:13:55 -0400 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7482393D6 for ; Fri, 1 Jul 2022 12:13:53 -0700 (PDT) Received: by mail-yb1-xb34.google.com with SMTP id 194so624387ybc.4 for ; Fri, 01 Jul 2022 12:13:53 -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=0QS+dcPV5O8kLzr2+REcEkzxVnC/iy1E7v+r8knheu0=; b=YxJMJqn/vOk+95wW9H3XyxhU7b6ot8wJfR5j/hJXXANi9ACWI8OWpYLc7idqKtR70V I3f03mBuDThOJwgTtewRvSXUMPEEQyG2ilkW3LrxcIy7/7G+z/lvGEKEHqAw36hYhA+D 6ECYWOChAVa+UxOkE+iS+daPXf69U0SflOW9HtDhl9SR2FAyXKxcYvKm3CgyTVMStMHC d3loWbDJUvP5cApZmY9sk39gsPipm7VWUwXpJ6tYDGtPK2MW5LBo5X+RScgoYXv7fbLo O9phoX29OCjJ0I+QGlNLfK3+Itz44Me8/dSf5Psw1rGo4PvdspD0oJiqYd3r+D2c9F2x uSLQ== 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=0QS+dcPV5O8kLzr2+REcEkzxVnC/iy1E7v+r8knheu0=; b=XewzjScaLtksfze0++PN7JWGptMWkabZ2zXqQpTZ5Kyyy3GVeDgEjLMbnQ5SDWtypi 2BcPjdAuA/KRhm2Eir0rlvpLRcCwPNsATmoYEz7Zda2F0rCUCb7qjVQFL7xDG8m3LT3C ijd4jrvQSd2ESiyr+PiVUghPIRnHiTNU2fopVtavE1pwz53j/wnDJrch5uMKXw6PJJeq D1N1JxDJFYRYH6ZxBE8Ba1MmiZR/uRyDbqpg2STPcSWFRgZn5boLv0obDtaGkYLjQ4xt Dbvn0SbG8OFFa8Q4QCcN579yX/ZXGe0Cm70Ph9vZg9OdyjZz+fKbph7mdEwik9gjZOxH y4DQ== X-Gm-Message-State: AJIora/JV4xLnIXgPQm4x21ijoZGTRAEbTyEQO4YOkBsGXfv+e69Vk9z /QW1XEGEb1c0pY+hP8Synskj+sCRgjZZNj+04VKogw== X-Google-Smtp-Source: AGRyM1tQv6CCDFx3u07LEvOjaGIhnXAU5l72oCC5MmwYKS+JqS6dGPS426l3v4HvKqgb/fUO3PdDTLb3hZ+49n67IRs= X-Received: by 2002:a25:5bc3:0:b0:669:b722:beb8 with SMTP id p186-20020a255bc3000000b00669b722beb8mr16783331ybb.447.1656702832727; Fri, 01 Jul 2022 12:13:52 -0700 (PDT) MIME-Version: 1.0 References: <20220701150848.75eeprptmb5beip7@bogus> In-Reply-To: <20220701150848.75eeprptmb5beip7@bogus> From: Saravana Kannan Date: Fri, 1 Jul 2022 12:13:16 -0700 Message-ID: Subject: Re: [PATCH v2 1/9] PM: domains: Delete usage of driver_deferred_probe_check_state() To: Sudeep Holla Cc: Tony Lindgren , Rob Herring , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , 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 , Android Kernel Team , "linux-kernel@vger.kernel.org" , "open list:THERMAL" , Linux IOMMU , netdev , "open list:GPIO SUBSYSTEM" , Alexander Stein Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 1, 2022 at 8:08 AM Sudeep Holla wrote: > > Hi, Saravana, > > On Fri, Jul 01, 2022 at 01:26:12AM -0700, Saravana Kannan wrote: > > [...] > > > Can you check if this hack helps? If so, then I can think about > > whether we can pick it up without breaking everything else. Copy-paste > > tab mess up warning. > > Sorry for jumping in late and not even sure if this is right thread. > I have not bisected anything yet, but I am seeing issues on my Juno R2 > with SCMI enabled power domains and Coresight AMBA devices. > > OF: amba_device_add() failed (-19) for /etf@20010000 > OF: amba_device_add() failed (-19) for /tpiu@20030000 > OF: amba_device_add() failed (-19) for /funnel@20040000 > OF: amba_device_add() failed (-19) for /etr@20070000 > OF: amba_device_add() failed (-19) for /stm@20100000 > OF: amba_device_add() failed (-19) for /replicator@20120000 > OF: amba_device_add() failed (-19) for /cpu-debug@22010000 > OF: amba_device_add() failed (-19) for /etm@22040000 > OF: amba_device_add() failed (-19) for /cti@22020000 > OF: amba_device_add() failed (-19) for /funnel@220c0000 > OF: amba_device_add() failed (-19) for /cpu-debug@22110000 > OF: amba_device_add() failed (-19) for /etm@22140000 > OF: amba_device_add() failed (-19) for /cti@22120000 > OF: amba_device_add() failed (-19) for /cpu-debug@23010000 > OF: amba_device_add() failed (-19) for /etm@23040000 > OF: amba_device_add() failed (-19) for /cti@23020000 > OF: amba_device_add() failed (-19) for /funnel@230c0000 > OF: amba_device_add() failed (-19) for /cpu-debug@23110000 > OF: amba_device_add() failed (-19) for /etm@23140000 > OF: amba_device_add() failed (-19) for /cti@23120000 > OF: amba_device_add() failed (-19) for /cpu-debug@23210000 > OF: amba_device_add() failed (-19) for /etm@23240000 > OF: amba_device_add() failed (-19) for /cti@23220000 > OF: amba_device_add() failed (-19) for /cpu-debug@23310000 > OF: amba_device_add() failed (-19) for /etm@23340000 > OF: amba_device_add() failed (-19) for /cti@23320000 > OF: amba_device_add() failed (-19) for /cti@20020000 > OF: amba_device_add() failed (-19) for /cti@20110000 > OF: amba_device_add() failed (-19) for /funnel@20130000 > OF: amba_device_add() failed (-19) for /etf@20140000 > OF: amba_device_add() failed (-19) for /funnel@20150000 > OF: amba_device_add() failed (-19) for /cti@20160000 > > These are working fine with deferred probe in the mainline. > I tried the hack you have suggested here(rather Tony's version), Thanks for trying that. > also > tried with fw_devlink=0 and fw_devlink=1 0 and 1 aren't valid input to fw_devlink. But yeah, I don't expect disabling it to make anything better. > && fw_devlink.strict=0 > No change in the behaviour. > > The DTS are in arch/arm64/boot/dts/arm/juno-*-scmi.dts and there > coresight devices are mostly in juno-cs-r1r2.dtsi Thanks > Let me know if there is anything obvious or you want me to bisect which > means I need more time. I can do that next week. I'll let you know once I poke at the DTS. We need to figure out why fw_devlink wasn't blocking these from getting to the error (same as in Tony's case). But since these are amba devices, I think I have some guesses. This is an old series that had some issues in some cases and I haven't gotten around to looking at it. You can give that a shot if you can apply it to a recent tree. https://lore.kernel.org/lkml/20210304195101.3843496-1-saravanak@google.com/ After looking at that old patch again, I think I know what's going on. For normal devices, the pm domain attach happens AFTER the device is added and fw_devlink has had a chance to set up device links. And if the suppliers aren't ready, really_probe() won't get as far as dev_pm_domain_attach(). But for amba, the clock and pm domain suppliers are "grabbed" before adding the device. So with that old patch + always returning -EPROBE_DEFER in amba_device_add() if amba_read_periphid() fails should fix your issue. -Saravana