Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp172023lqm; Tue, 30 Apr 2024 17:17:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV69VATkPCfgBjXbxO+Oxc9rteOZXvXGB+Lw7AxLXt2F0eF8YT70lvSGbp1R2NSp/Morb3JOHVpe/F1nb5gsUm6XSUagGpvfq1aoiMUbw== X-Google-Smtp-Source: AGHT+IF9ZjcxVNIH5yqNjXGAgKfjGj84bv4r7rwVYsZDdDKEn66qIof4B2YUQPli/R4e0e0EoPpU X-Received: by 2002:a05:6214:2a8b:b0:6a0:6f04:b290 with SMTP id jr11-20020a0562142a8b00b006a06f04b290mr985125qvb.42.1714522648620; Tue, 30 Apr 2024 17:17:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714522648; cv=pass; d=google.com; s=arc-20160816; b=lYi+6VEQwiwrv+MRACAZ0Uup1pHQTTUe2do8lNb78NsBO0RjCQCuUtxLGCz5ZRnU6c NvAxOWUos8EzdREObylypX3yoqW9aGS+wfDRf9ITTiQJUmMzuLWbzDYS6fX3/l1FOCfi z7iebprmAbo5tSyBRTb2R1+btFl4LqNLdjmhfL64+8DqfZx5z+Ora3637hWdOv3MbYNo lTYAoZLvXcv3hC/chjHUeFr8fSp1IkwADt1QZCjCpDTE3qcMlzqjeYidweJx1NULuWe/ zIK13Nb1hy06uQjuPb6RMIymWqmCWQSe4lrDvRFDhzc4e8/fn8llioDn8w+i1qo75JSe 7qJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:dkim-signature; bh=1ywHP957dN7QN6N91q0/xp7S+y5cWqGySegerlSjGbo=; fh=f4aexx0l8egrj8dc0Eqxla+uH+IY5FG6LwLyLG+LP/E=; b=jWmHUXuraiVO7cCb3a5B5u5PIUjZqz287tJr3rc0wVSBSuB2B7O0JWwJxnCWVPk5zw xns+h0jq65XixpqhR6il6/T/xAeiPghAeeRxG1ac8ocRYAz6ScB78YZClkUCgbAGjh3g BtnkJag3LpwP9p9r1VuzEucW/uT7yg3Uoc0WvVXlqtqAWVIAlLtIRN09ll8azo8cIpzk aO6RcdzdMi9DsIqTrlAAlDCJdnHytET5EzhShGsEaHPfw1RudvvTgiVrnEKLzZjmtn6c s/oKgJ/E1W1EQsOpBhEXIUnFZa8aOtyJMT+fOqckXNKCS6iGZ+XQTUjCHs7U9LMiPiaP EvAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e1mFR0ja; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-164828-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164828-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r17-20020a056214125100b0069949b82546si30722709qvv.79.2024.04.30.17.17.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 17:17:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164828-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e1mFR0ja; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-164828-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164828-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5ADB41C21C81 for ; Wed, 1 May 2024 00:17:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E25417C8; Wed, 1 May 2024 00:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="e1mFR0ja" Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB23B625 for ; Wed, 1 May 2024 00:17:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714522641; cv=none; b=Ur0+oLjMz/oa6QUa+4wpuXJNX/+EEMlEZaKhN8vn6CLzp8es/ID/JNdiGQvm7Dqb2umW32Z9wvnkXORaRScwe760RJqd4blGDLCBOeubzS3bfIhTtLjzLFWEgssH4L2dMPtp9VuX497cf3KBvuHXdhJtgdcYEQcJWLIxNSw86Es= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714522641; c=relaxed/simple; bh=1ywHP957dN7QN6N91q0/xp7S+y5cWqGySegerlSjGbo=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UZwB2BzV374kbQUgnBbDKuxunIIRhXbndUXXsyrarQg5MEQAtYoHi4XFcv0byTMlL6mw+HSZT2xRkhCQ/N9497IQhHrXi1nDRvTtuq2GkNcDwKZQQpbJf4v9AHOu9Rli6I2BsCVG4inkTEiLFm13W1BL4ACmDUbpV9HOwL4IPQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=e1mFR0ja; arc=none smtp.client-ip=209.85.222.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-79100a90868so181394985a.2 for ; Tue, 30 Apr 2024 17:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714522638; x=1715127438; darn=vger.kernel.org; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=1ywHP957dN7QN6N91q0/xp7S+y5cWqGySegerlSjGbo=; b=e1mFR0jabgWyWSAAUL/bOSqHjDXedFTVZkyjI5G14PwDfAHUkLiQYu8mygH22XkAkd NaEGUFZyOnK2jOTEjv6bVM8qCWYF6qKG9kRKf3fSGUiukhVKezMmrJuPjc02mRMwoZqK 4HBcSa+NtowSV9UqTdGcO9mRihWNk3Pjclh08= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714522638; x=1715127438; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1ywHP957dN7QN6N91q0/xp7S+y5cWqGySegerlSjGbo=; b=W/Blq2Ib3M2TCk0yxgizd6Mbo/VDv++kIiyEk+PdaFijIR1/Qrp+guRXBR8wsFGuTC un8UgGQN0J249A0jTq93zPRrMfuoUYtJk5xDcG8kUt7rCoKuvdZBfCThYDf8hxb3Cujw OYM/8jfK8bdfuzneBYZ6A4lWev07irLZXcy4Mk7y4ku9cnbHdeGklR3sGthM3jTfEQbx /EbZLtFrwcM6Oi5o9+KT96CCjeOfIBPSTomLTW7hMojEQnyuIpcDlWram2hqfMA+WOs9 yRDVEKOQnHpQLHrGdBHvGRuDxxm9cdxd5kOruQa9x/V8zEvyJX08bvqsQ2iDISFyG1kU BPRw== X-Forwarded-Encrypted: i=1; AJvYcCW8bEEDXojU6L/5Ivj57OXDVN1kZGnmjwjylYMWzeaSXLBFqHbpx/+KuQdkIwwBnYxDphBAGqaNXzpYBUtlbduMmKulT6dY300OnyjN X-Gm-Message-State: AOJu0YxiyFqvyunRFiERnN32deS0p68wLO4DqaKwuj29+dlktNXtk38V lhkWXYQLFLGGCPiDL1+WKCkFWLDvoN0rONPrDSr1cSmmg6Me6LOBuM0CCUIv54lgfooY946wvtY EL1M/3wo6S/Nuy9pKvKdDX5byY8KbB5sfnw1l X-Received: by 2002:a05:6214:62c:b0:6a0:cd28:ffaa with SMTP id a12-20020a056214062c00b006a0cd28ffaamr900368qvx.25.1714522638644; Tue, 30 Apr 2024 17:17:18 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 30 Apr 2024 17:17:17 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: References: <20240327202740.3075378-1-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Tue, 30 Apr 2024 17:17:17 -0700 Message-ID: Subject: Re: [PATCH 0/2] Fix a black screen on sc7180 Trogdor devices To: Doug Anderson Cc: Michael Turquette , Stephen Boyd , Bjorn Andersson , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, patches@lists.linux.dev, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov , Taniya Das , Laura Nao Content-Type: text/plain; charset="UTF-8" Quoting Doug Anderson (2024-03-28 09:39:54) > > I spent a bunch of time discussing this offline with Stephen and I'll > try to summarize. Hopefully this isn't too much nonsense... > > 1. We'll likely land the patches downstream in ChromeOS for now while > we're figuring things out since we're seeing actual breakages. Whether > to land upstream is a question. The first patch is a bit of a hack but > unlikely to cause any real problems. The second patch seems correct > but it also feels like it's going to cause stuck clocks for a pile of > other SoCs because we're not adding hacks similar to the sc7180 hack > for all the other SoCs. I guess we could hope we get lucky or play > whack-a-mole? ...or we try to find a more generic solution... Dunno > what others think. I think we should hope to get lucky or play whack-a-mole and merge something like this series. If we have to we can similarly turn off RCGs or branches during driver probe that are using shared parents like we have on sc7180. Put simply, the shared RCG implementation is broken because it reports the wrong parent for clk_ops::get_parent() and doesn't clear the force enable bit. With the current code we're switching the parent to XO when the clk is enabled the first time. That's an obvious bug that we should fix regardless of implementing proper clk handoff. We haven't implemented handoff in over a decade. Blocking this bug fix on implementing handoff isn't practical. Furthermore, we're relying on clk consumers to clear that force enable bit by enabling the clk once. That doesn't make any sense, although we could use that force enable bit to consider the RCG as enabled for clk_disable_unused. An alternative approach to this series would be to force all shared RCGs to be parented to XO at clk registration time, and continue to clear that RCG force enable bit. That's sort of what Dmitry was going for earlier. Doing this would break anything that's relying on the clks staying enabled at some frequency through boot, but that isn't supported anyway because clk handoff isn't implemented. It avoids the problem that the first patch is for too because XO doesn't turn off causing a clk to get stuck on. I can certainly craft this patch up if folks think that's better. To ease the transition we can make a new clk_ops for the RCG as well so that each SoC has to opt-in to use this behavior. Then we can be certain that other platforms aren't affected without being tested first. I'd prefer to not do that though because I fear we'll be leaving drivers in the broken state for some time.