Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp62437pxb; Tue, 26 Oct 2021 21:24:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFEUDHlUQF/HpsGZXG0UNrjd9Un1XoWKzXQj+9O2A4u8i9gOlggOmre4bxr/Pnq1RkAmIl X-Received: by 2002:a17:907:9688:: with SMTP id hd8mr16914172ejc.535.1635308660436; Tue, 26 Oct 2021 21:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635308660; cv=none; d=google.com; s=arc-20160816; b=fzilm//BAf6VS1n8KRYg1bc4qv25uPq6wFa9gcFE+oPN7Ti0srNNPlOjopAmuvlj4A Dw/oshM18mGH5n2vVsn9/rwSsVPuCPmWseBXRt3zYqskgePnYmoyFmkMimAaWXUC+10a qsuuL9Zj0T6m3iEqG9TSwGSmAWRnEyLtxtSl9TOISMpVkX3Jt0+h0riyBY2JxNuxM5Ok KRILDNdBaeJp3cHHo2Ht01iL5BIUcQblRzYU+FURXxZwpemFO0s79ZY23KNrNJXwjKL5 hO0iRZfL+1IVMq5aroMkoCslhvS3ncvRBphffBE2YqmsNdbHASJm3PENEGhVJr7KtzWR Jl/Q== 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=55Wiuk+vhFEgZhWSKqhr8aUkCrc+H/l8H2FxgeE5N1M=; b=F+MPP9RX6n/VjmIRVN6ogw4gSrSq9xbUISrvb7L7etQMQBBmX5vRmMQi7UmrOuK94G sSbyycWmBk2y1zzLpofOmycCj2/ZcwJCdoNy6g33RqDPecH0czFXLK+mokml6XPxeM6t YBSm4HQ6wKul9R94akXETWTFlivyAon99FXYjYuuDbuWmhkRxoVhcKaf0yntplPnOrhQ 9rs2jaB062UFeGfvKxtg7pPAUOJ6XYdA/AUam+BhlNliZoTTAv0tL9BHuIuh0IdYy/oV QQEdz+XBJaI86/56kfCQ56PCpsJWgsfPxNvFjzPSuQdrIHnyJEaNixLKjqJeBBLExi1D LP1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9pKZk0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr12si1871178ejb.335.2021.10.26.21.23.50; Tue, 26 Oct 2021 21:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9pKZk0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbhJZRwx (ORCPT + 99 others); Tue, 26 Oct 2021 13:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235152AbhJZRww (ORCPT ); Tue, 26 Oct 2021 13:52:52 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60730C061767 for ; Tue, 26 Oct 2021 10:50:28 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id v65so368942ioe.5 for ; Tue, 26 Oct 2021 10:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=55Wiuk+vhFEgZhWSKqhr8aUkCrc+H/l8H2FxgeE5N1M=; b=K9pKZk0C5IuwGpuBt3P8vlDuOIoL2vOXpa4HXaUHePCmealB43zHzS9+Abd804Gou5 AX1Ko0Hgr+IqrHTHlDpPvZyWwd+IHOwkRNGe7sWr+tlqO+qnhGQBXnoi35g7DhUboVdw jEE8031QquN7g17K4I7/vnj+ZHRtelq3SlCn8oZ8/UTlKNOLYWgM7tClJsAooXWCwOM5 eg0erGB9Km5hSC0T2+FhmppSX3AukPqDcEUOWatA7MzYZRw4zabKa6ZaMH14zL7y8iWt j4xtTAC5UcS3J3DTseib3xOYME0gcib9b1rtSRmqx+LGWtwfSA/ROovpzcOUYVLUKnxt d5Uw== 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=55Wiuk+vhFEgZhWSKqhr8aUkCrc+H/l8H2FxgeE5N1M=; b=PtI4evxIPIGQ66koh3r6wsNK0UdGl24pBdvOqZLN6NYeYas9JuOzdFFTPW6Ap8NghV ZjEIKC1hotHwt4TCwQy5dWMcW6bh3BVdd3T93wKsIaw3ulN9Ik8Ihjcp41lhGLD34M0J JdVPspJd8meqYjxV8DmsQBY3RqAdR4c9f3rm+oYOs3/HXrDmBBHA9mtcUe6oN3n05Yln anv/5PMOgREcF4dwYBxSsQMBJG6HcFNGIay/SzNVzFDiM10z2ZhHg5yXhjrMB1OqLsOq 8NrxbvlkLNGlU1qaQcA66ocYKTZJ7tnycPt7iB6Ji3rt1THsF4ZfNamz+TigtRg+GkNg 4IVg== X-Gm-Message-State: AOAM530lSBFV7pDT8kOe70O2hNFitApaNAoDEsVERtf3fYKOw+ib3iAR 7FCO8iFdsGhRKrhPsy9YxSyAVxpUJqWFB9djXLZqvg== X-Received: by 2002:a05:6638:d84:: with SMTP id l4mr16445923jaj.30.1635270627599; Tue, 26 Oct 2021 10:50:27 -0700 (PDT) MIME-Version: 1.0 References: <20210929000735.585237-1-saravanak@google.com> <20210929000735.585237-3-saravanak@google.com> In-Reply-To: From: Amit Pundir Date: Tue, 26 Oct 2021 23:19:50 +0530 Message-ID: Subject: Re: [PATCH v4 2/2] drivers: bus: Delete CONFIG_SIMPLE_PM_BUS To: Saravana Kannan Cc: Russell King , Neil Armstrong , Geert Uytterhoeven , Magnus Damm , Tony Lindgren , Catalin Marinas , Will Deacon , Damien Le Moal , Greg Kroah-Hartman , Ulf Hansson , Rob Herring , Android Kernel Team , linux-arm-kernel@lists.infradead.org, lkml , linux-oxnas@groups.io, linux-renesas-soc@vger.kernel.org, linux-omap@vger.kernel.org, linux-riscv@lists.infradead.org, Dmitry Baryshkov , John Stultz Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Oct 2021 at 06:00, Saravana Kannan wrote: > > On Fri, Oct 22, 2021 at 10:00 AM Amit Pundir wrote: > > > > On Fri, 22 Oct 2021 at 05:13, Saravana Kannan wrote: > > > > > > On Thu, Oct 21, 2021 at 4:21 AM Amit Pundir wrote: > > > > > > > > Hi Saravana, > > > > > > > > This patch broke v5.15-rc6 on RB5 (sm8250 | qcom/qrb5165-rb5.dts). > > > > I can't boot past this point https://www.irccloud.com/pastebin/raw/Nv6ZwHmW. > > > > > > Amit top posting? How did that happen? :) > > > > > > The fact you are seeing this issue is super strange though. The driver > > > literally does nothing other than allowing some sync_state() callbacks > > > to happen. I also grepped for the occurence of "simple-bus" in > > > arch/arm64/boot/dts/qcom/ and the only instance for 8250 is for the > > > soc node. > > > > > > The only thing I can think of is that without my patch some > > > sync_state() callbacks weren't getting called and maybe it was masking > > > some other issue. > > > > > > Can you try to boot with this log (see log patch below) and see if the > > > device hangs right after a sync_state() callback? Also, looking at the > > > different sync_state() implementations in upstream, I'm guessing one > > > of the devices isn't voting for interconnect bandwidth when it should > > > have. > > > > > > Another thing you could do is boot without the simple-bus changes and > > > then look for all instances of "state_synced" in /sys/devices and then > > > see if any of them has the value "0" after boot up is complete. > > > > Turned out RB5 is not even reaching up to > > device_links_flush_sync_list() and seem to be stuck somewhere in > > device_links_driver_bound(). So I added more print logs to narrow down > > to any specific lock state but those additional prints seem to have > > added enough delay to unblock that particular driver (Serial: > > 8250/16550 driver if I understood the logs correctly) and I eventually > > booted to UI. > > Ugh... I think I know what's going on. It popped into my head over the weekend. > > Couple of ways to confirm my theory: > 1. After it finishes booting in both cases, can you compare the output > of the command below? I'm expecting to see a significant drop in the > number of device links. > ls -l /sys/class/devlink | wc -l > On a successful boot with debug prints: rb5:/ $ ls -l /sys/class/devlink | wc -l 245 Booting with this SIMPLE_PM_BUS patch reverted: rb5:/ $ ls -l /sys/class/devlink | wc -l 248 > 2. Can you try out this terrible hack patch (not final fix, no code > reviews please) on top of Tot to see if it fixes your issue without > having to add hacky logs? > No luck booting with the following hack patch either. Regards, Amit Pundir > Thanks, > Saravana > > --- a/drivers/bus/simple-pm-bus.c > +++ b/drivers/bus/simple-pm-bus.c > @@ -38,10 +38,12 @@ static int simple_pm_bus_probe(struct platform_device *pdev) > * a device that has a more specific driver. > */ > if (match && match->data) { > - if (of_property_match_string(np, "compatible", > match->compatible) == 0) > + if (of_property_match_string(np, "compatible", > match->compatible) == 0) { > + of_platform_populate(np, NULL, lookup, &pdev->dev); > return 0; > - else > + } else { > return -ENODEV; > + } > }