Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4052127pxv; Mon, 19 Jul 2021 15:32:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8VIYkKDpt7Mp09i+RxNX/XDRNjal+8Gdcy2Vvf8mOpnvfkrERlabPhkIbhiWduKk1D/zj X-Received: by 2002:a17:906:3616:: with SMTP id q22mr28717201ejb.276.1626733978182; Mon, 19 Jul 2021 15:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626733978; cv=none; d=google.com; s=arc-20160816; b=xpIMIkxDMY43+9Bru/ZgGRLRiIRw3F5phqgjYqkAapfoeywGx7cJnLmb3ztAuOqlEW 47XZRE7DUJXqYSlrW7lqWQr0bSApC+Z1RaEzGWVVcIbXebL2lkLpvfoL/XIio4LZmbcU XWbGxJluwCoxVRlxNM1WKqJEsaLUrhV8lSq/AMxloP+3M39HoHo5qBwj8HAkKnlLwXxY WWlNPmNLxTzPtJhoN/O8sST20y4CEIxfeecSbB3esy9Ul1SMbqg7vj8Ls3xl+EFgsd/O uGYsSFSPS+0fj+Zrn/fhpBeq9gwP22tyix5s3NbjpRbczc+REty2pXum67nUxhQ1QD+b lmLg== 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=Mgewm5mjx+FRnoLmab+NYqOB950vpM/jLC7o5sa2XM8=; b=xcmrAqXOgW9ch0/V0IpYRhA0M7ODGcs+4ov/3vZRcUfyY33GeeKo/6CkBm8p4TKQVs j1L5Lf+VkWwN23+HQMPDaojhqM8RXzadOYhn4sQ5HU2Zape5vJGJKbBbb6s7ri2lLHyB gdMxUiReRz7Qj4qmwlXcNrGAz0FUVjl+S0YnM63xQ6zRveLHBnLLewFYnP4I89nNqyQn /IM4wqWeVDxa/NdleLGQDuQUuicEK1BjiTiCof/iplBOL9BGmcYO8G5ZXrGqTvogqRft b0xwfd7sabPrMyXo9j1gonXu9MxbngoxRdmzFNn6MD70ZptjrcQkdkq189PcZhS1KPM7 Jt3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=l0R7mPgH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt10si19832927ejb.366.2021.07.19.15.32.27; Mon, 19 Jul 2021 15:32:58 -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=@google.com header.s=20161025 header.b=l0R7mPgH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390048AbhGSViF (ORCPT + 99 others); Mon, 19 Jul 2021 17:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359698AbhGSVWX (ORCPT ); Mon, 19 Jul 2021 17:22:23 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D3F8C05BD15 for ; Mon, 19 Jul 2021 14:54:25 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id r135so30061354ybc.0 for ; Mon, 19 Jul 2021 14:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mgewm5mjx+FRnoLmab+NYqOB950vpM/jLC7o5sa2XM8=; b=l0R7mPgHhU+9/Prsowfdj7Q2tQ1PxSoUyzKyHKVvNc724HS7Q2DlFv99s3OP2TG/Zq lwEOjLRSF21f2rIl6xbmlp+HtCrfmG/rtgg50IMgNNhdd7MvHme0UH+zssIKkD4DysIV 9n03+QQKXy8uuwmkJD8Mr+uOSE/yA0i2iVtHLv/9GUxl+FSGRkhTePgD8pYCukp4Dyz7 nqQ6P12jnkTl+CUhabJGja6HSNCHhD9KeRBFuzhgnM8w1DbZ2CXLE0Q7Ci39eg+sf+vv GsJnL5QEKafmdGXCglA+rJ9522ssx6xe5cbdRqM+wnuZ2Iz4xFxlQvezVkADeXN2P62Z xTTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mgewm5mjx+FRnoLmab+NYqOB950vpM/jLC7o5sa2XM8=; b=kNcjMifM9ncaVy9FH72F8h+mmnfSjVTg4KpLP/kzqq41dEpGxq/YUWVs7OuV7CDNQQ cX6ksADYVG9b0aOw18DCC4ItfAR/Wx1UipgjL/UkVa3dKNd8eqSlx/88GSQdJp8HF6/R Fu6nDtlDeZ4lg9y3Ffl8Gcd+Zv3FSJEKpzmo4O5BZ9W+b+dLXkDwmoAgAnnihdzlm4fq PfwBzQkkJ8UXv8VTTzcUKW9yNPJXMxaxwC1AqqZ8wD+ZeW3Yp0Oy0Mjv4xwVxT+bbyr/ ibAxRYokrfCzTFZ7L0ia5yIB2GJljWhthZu6PxIK5uKzJX6BbGaTt+6dWBWivNqAZLXU wvSg== X-Gm-Message-State: AOAM5320Mr+r8TM4lAEvsCDJhwd3cuasbOlIoQAu04oBmgEvqySpP5Iv 4wRtBlSj+ndnQDC9seX4b0oBJn7ekJQOraI5ik1uyA== X-Received: by 2002:a25:8b91:: with SMTP id j17mr33097786ybl.228.1626731663924; Mon, 19 Jul 2021 14:54:23 -0700 (PDT) MIME-Version: 1.0 References: <20210707045320.529186-1-john.stultz@linaro.org> In-Reply-To: From: Saravana Kannan Date: Mon, 19 Jul 2021 14:53:47 -0700 Message-ID: Subject: Re: [PATCH] firmware: QCOM_SCM: Allow qcom_scm driver to be loadable as a permenent module To: Bjorn Andersson Cc: John Stultz , lkml , Catalin Marinas , Will Deacon , Andy Gross , Joerg Roedel , Thomas Gleixner , Marc Zyngier , Linus Walleij , Vinod Koul , Kalle Valo , Maulik Shah , Todd Kjos , Greg Kroah-Hartman , linux-arm-msm , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , "open list:GPIO SUBSYSTEM" , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 12:36 PM Bjorn Andersson wrote: > > On Mon 19 Jul 14:00 CDT 2021, John Stultz wrote: > > > On Fri, Jul 16, 2021 at 10:01 PM Bjorn Andersson > > wrote: > > > On Tue 06 Jul 23:53 CDT 2021, John Stultz wrote: > > > > Allow the qcom_scm driver to be loadable as a permenent module. > > > > > > > > This still uses the "depends on QCOM_SCM || !QCOM_SCM" bit to > > > > ensure that drivers that call into the qcom_scm driver are > > > > also built as modules. While not ideal in some cases its the > > > > only safe way I can find to avoid build errors without having > > > > those drivers select QCOM_SCM and have to force it on (as > > > > QCOM_SCM=n can be valid for those drivers). > > > > > > > > Reviving this now that Saravana's fw_devlink defaults to on, > > > > which should avoid loading troubles seen before. > > > > > > > > > > Are you (in this last paragraph) saying that all those who have been > > > burnt by fw_devlink during the last months and therefor run with it > > > disabled will have a less fun experience once this is merged? > > > Bjorn, I jump in and help with any reports of issues with fw_devlink if I'm cc'ed. Please feel free to add me and I'll help fix any issues you have with fw_devlink=on. > > > > I guess potentially. So way back when this was originally submitted, > > some folks had trouble booting if it was set as a module due to it > > loading due to the deferred_probe_timeout expiring. > > My attempts to change the default timeout value to be larger ran into > > trouble, but Saravana's fw_devlink does manage to resolve things > > properly for this case. > > > > Unfortunately I see really weird things coming out of that, e.g. display > on my db845c is waiting for the USB hub on PCIe to load its firmware, > which typically times out after 60 seconds. > > I've stared at it quite a bit and I don't understand how they are > related. Can you please add me to any email thread with the details? I'd be happy to help. First step is to make sure all the devices probe as with fw_devlink=permissive. After that if you are still seeing issues, it's generally timing issues in the driver. But if the actual timing issue is identified (by you or whoever knows the driver seeing the issue), then I can help with fixes or suggestions for fixes. > > But if folks are having issues w/ fw_devlink, and have it disabled, > > and set QCOM_SCM=m they could still trip over the issue with the > > timeout firing before it is loaded (especially if they are loading > > modules from late mounted storage rather than ramdisk). > > > > I guess we'll have to force QCOM_SCM=y in the defconfig and hope people > don't make it =m. > > > > (I'm picking this up, but I don't fancy the idea that some people are > > > turning the boot process into a lottery) > > > > Me neither, and I definitely think the deferred_probe_timeout logic is > > way too fragile, which is why I'm eager for fw_devlink as it's a much > > less racy approach to handling module loading dependencies. > > Right, deferred_probe_timeout is the main issue here. Without it we > might get some weird probe deferral runs, but either some driver is > missing or it settles eventually. > > With deferred_probe_timeout it's rather common for me to see things > end up probe out of order (even more now with fw_devlink finding cyclic > dependencies) and deferred_probe_timeout just breaking things. Again, please CC me on these threads and I'd be happy to help. > > > So if you > > want to hold on this, while any remaining fw_devlink issues get > > sorted, that's fine. But I'd also not cast too much ire at > > fw_devlink, as the global probe timeout approach for handling optional > > links isn't great, and we need a better solution. > > > > There's no end to the possible and valid ways you can setup your > defconfig and run into the probe deferral issues, so I see no point in > holding this one back any longer. I just hope that one day it will be > possible to boot the upstream kernel in a reliable fashion. Might not be believable, but I'm hoping fw_devlink helps you meet this goal :) -Saravana