Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2624850rbb; Wed, 28 Feb 2024 07:37:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWDkwZKWBcPCW0qtzk1NM/GS+f1sS/IDg3RBEfuK4CHlOh4Av2KNcnwgMSPayN/8popM6NwjDuQBAA/pmsiEYC32Do9fSqAmHBbQ/yjpQ== X-Google-Smtp-Source: AGHT+IG0/Suvv2JDr/g/aWFhEhVrMVEAFaDC4f5n72qmwC5X7UzAXfvAoWy8mk3Rs43Vrrm+FGm0 X-Received: by 2002:a05:622a:1002:b0:42e:687e:95a with SMTP id d2-20020a05622a100200b0042e687e095amr15483256qte.16.1709134663583; Wed, 28 Feb 2024 07:37:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709134663; cv=pass; d=google.com; s=arc-20160816; b=akmSu4OL60wtHewsvdzYjd33HPRi9ry9ap0+WVpMVoKdTRAK4LJCFTJn0kDZ1L5sad V7tRe7mBg58fFW8ySSpBWG+fg4hoENYepCQuzdTaxRbIMjs1GLWqRqYkEAKVTZI1DZkp 2RctrcTV24I/4Itx8fYW+w/IJvr6+LJlBcnlEryY1Pi/jCgxgnTz/L7kLaPqYPUXpJr1 WOKOezBLPY5uQolRAv+mhH/VULZqBkIbqTkKDFLRnDzX5GWxBLp8moWM6XOjdbtWBrXT nCLg8KYXj6OMQA3ve9coHDvMTnbbHqGkFsu7yecN0lnO/dko7Szy3/HLctSkNApGXoGc ploQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=8dVCImcIlLLiITmfEBgBjhdVxqWWMzlc8Dv1nyWSOGo=; fh=eA7d6hecITp0pBatbOyiQtiPaAzKW19tlATO2EnELe0=; b=OFYyvvvPPr4R51UgLqkvSGaFEevGBTL1w1BiPUWfuR5TJb7jX/WkCVijq7Cq5657lw 3k/4dFa4wGBGdYzH2vDxnm8/fpY2hYU9PhfYE7P+a8GApQAkM+/AMUzffxmMIazQv2ri FRVumgqsYN4svVSPtzxuIM5S5t+ONOrgOedgabJPpel7EA8ubZyfABQRhnQglUjjFnDv MQ3SJDINoLrtUHilLjkhlurl3eyxYbbGtOiE3BpkgoIUurdx8Rv6T8haRyDNYwJNZYPb ptOVzEnZG+XsdKqmYiTub7bi8lKFPCn0HsBZiGi6rPdMbBMUJP6M6ADUfirbtW6oSZ5s RLIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TUKVQzDh; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-85271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f13-20020ac8464d000000b0042df087534csi9445993qto.800.2024.02.28.07.37.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 07:37:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TUKVQzDh; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-85271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 2BB181C227D4 for ; Wed, 28 Feb 2024 15:37:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED11C15CD6E; Wed, 28 Feb 2024 15:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TUKVQzDh" Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 02B5D15CD66 for ; Wed, 28 Feb 2024 15:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709134632; cv=none; b=lusqVst6swKBCWJAAMYW2VLc0fhO7Iq4UOVaR3+dHXaBTOliKrmoYA1QupknNboXhYwfz7QCFR5Wq5ZxgUwunofgsBk2gO6EqbZCs7UtlqvrTJS/w0qVMoGYp9IvMhz3SVWbMhsQzdFL2gbMCXJjk2ZGNf5jIXOKn/yGC2FVdek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709134632; c=relaxed/simple; bh=zGa+IyFAz8kwIE7x38Wl0fe/t7lkIR01+L6mE1MqudM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=T7Vh2drP9ATkvbqgVlOOxnYMQ5H3Llg0QLIv4RFKeZvpPVkG3SYMmWxUgmwPu68JxyL+aeAmogEbuK9dPHrEYwlI4625mEB+12VEWHJuw7Gna/FoAVSGykwkEwH/eLf5WOUIVU7gCEFcGmwD9LwWIc8GMRcOld4+VhDqng0Yr5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=TUKVQzDh; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-56657bcd555so1560819a12.3 for ; Wed, 28 Feb 2024 07:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709134628; x=1709739428; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8dVCImcIlLLiITmfEBgBjhdVxqWWMzlc8Dv1nyWSOGo=; b=TUKVQzDhnvGkhODw3ShNo58Wb7gAODf+QVCs7R7LbdhcBr0/Mw1AVlyMs3ZoulFJWd YggH7IsV3h8mzUYvY/4FsOxcxyqgYf71gNNkrxYJyNgjfEVNdRuopE/r1wFjYv9KyeSz Vv7c2kZV7sprdNuc3FMsYw4t9LCjc7eBrV4kjpSsoC2gzwJ/6s519UyKuvKZmn27Lqe8 c7bOhv8h7DGN3iXo6jbjgncU3aIVkfSexCEzRCjc2aFTpNuSmoF8dpnEnZqf1Bk0jxsu gCAW9KpiwyjWQl0d4YHCV6Pky+PqMn/TgEQ3pZhJfUFKHSygIRYIWjafunFdbpAroape TYHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709134628; x=1709739428; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8dVCImcIlLLiITmfEBgBjhdVxqWWMzlc8Dv1nyWSOGo=; b=g8EvrJZR2+xwfvU4vyF1s7Evi3bBBp9omarEIU9/wzBBYkoAnPdPEtWwQKsRGb+UcB qam9SvnqTXwEtIr+cIODOgU3ETofDJga87JDu3oWRQ3WVLJSj41wKPgBGtWU9xBGkxxt MlmfbgxBdybNq9e2ixFyyL5XK0BXxc6PxbgjhMVfeQjsAHPQEE523dU3uaoMeS8D5Eay bj2spXWQnCYjSL5yAcTucHnQmrVU+YM8JMrVKuSnQCYFjrA7/8aGMEpMJClwjMmtFmPQ QfPm4Yyz9P+atuwuR+wUUq8MnzfYbImIiRT5HKayitWkhS7V5Fry/OEfJH048ptV2ZyY DCUw== X-Forwarded-Encrypted: i=1; AJvYcCUtHfsaFOjvBWXdqgm0i/0yQbd1x7s41n2zYCtwB7FqiWrzUdYOpPXXcJ8rJCKsdTo44aE8bUGFrcmGu0fWSmi+SMtfaY10Cv5xxCGv X-Gm-Message-State: AOJu0Yx4vQ1O1fynDXrHSg4dJk4E4GjOWHPjJ72YBf8f7WBtkKsGyneI OVjZRpdvNenUPPZfozRkoz+1+Spe6NPuoGoBkgeYaJGBIKvVqJMuqsdRCQEizKsCJLlz3Q0N+Z5 4dfaJpbvwuNKhl7pIYRpCML8uYmhGnGQp0Nmiag== X-Received: by 2002:aa7:d982:0:b0:565:fb4c:7707 with SMTP id u2-20020aa7d982000000b00565fb4c7707mr5488857eds.26.1709134628391; Wed, 28 Feb 2024 07:37:08 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240226-rpmhpd-enable-corner-fix-v1-1-68c004cec48c@quicinc.com> In-Reply-To: <20240226-rpmhpd-enable-corner-fix-v1-1-68c004cec48c@quicinc.com> From: Ulf Hansson Date: Wed, 28 Feb 2024 16:36:30 +0100 Message-ID: Subject: Re: [PATCH] pmdomain: qcom: rpmhpd: Fix enabled_corner aggregation To: quic_bjorande@quicinc.com Cc: Bjorn Andersson , Konrad Dybcio , Stephen Boyd , Johan Hovold , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Tue, 27 Feb 2024 at 02:45, Bjorn Andersson via B4 Relay wrote: > > From: Bjorn Andersson > > Commit 'e3e56c050ab6 ("soc: qcom: rpmhpd: Make power_on actually enable > the domain")' aimed to make sure that a power-domain that is being > enabled without any particular performance-state requested will at least > turn the rail on, to avoid filling DeviceTree with otherwise unnecessary > required-opps properties. > > But in the event that aggregation happens on a disabled power-domain, with > an enabled peer without performance-state, both the local and peer > corner are 0. The peer's enabled_corner is not considered, with the > result that the underlying (shared) resource is disabled. > > One case where this can be observed is when the display stack keeps mmcx > enabled (but without a particular performance-state vote) in order to > access registers and sync_state happens in the rpmhpd driver. As mmcx_ao > is flushed the state of the peer (mmcx) is not considered and mmcx_ao > ends up turning off "mmcx.lvl" underneath mmcx. This has been observed > several times, but has been painted over in DeviceTree by adding an > explicit vote for the lowest non-disabled performance-state. > > Fixes: e3e56c050ab6 ("soc: qcom: rpmhpd: Make power_on actually enable the domain") > Reported-by: Johan Hovold > Closes: https://lore.kernel.org/linux-arm-msm/ZdMwZa98L23mu3u6@hovoldconsulting.com/ > Cc: > Signed-off-by: Bjorn Andersson Applied for fixes, thanks! Kind regards Uffe > --- > This issue is the root cause of a display regression on SC8280XP boards, > resulting in the system often resetting during boot. It was exposed by > the refactoring of the DisplayPort driver in v6.8-rc1. > --- > drivers/pmdomain/qcom/rpmhpd.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/pmdomain/qcom/rpmhpd.c b/drivers/pmdomain/qcom/rpmhpd.c > index 3078896b1300..47df910645f6 100644 > --- a/drivers/pmdomain/qcom/rpmhpd.c > +++ b/drivers/pmdomain/qcom/rpmhpd.c > @@ -692,6 +692,7 @@ static int rpmhpd_aggregate_corner(struct rpmhpd *pd, unsigned int corner) > unsigned int active_corner, sleep_corner; > unsigned int this_active_corner = 0, this_sleep_corner = 0; > unsigned int peer_active_corner = 0, peer_sleep_corner = 0; > + unsigned int peer_enabled_corner; > > if (pd->state_synced) { > to_active_sleep(pd, corner, &this_active_corner, &this_sleep_corner); > @@ -701,9 +702,11 @@ static int rpmhpd_aggregate_corner(struct rpmhpd *pd, unsigned int corner) > this_sleep_corner = pd->level_count - 1; > } > > - if (peer && peer->enabled) > - to_active_sleep(peer, peer->corner, &peer_active_corner, > + if (peer && peer->enabled) { > + peer_enabled_corner = max(peer->corner, peer->enable_corner); > + to_active_sleep(peer, peer_enabled_corner, &peer_active_corner, > &peer_sleep_corner); > + } > > active_corner = max(this_active_corner, peer_active_corner); > > > --- > base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d > change-id: 20240226-rpmhpd-enable-corner-fix-c5e07fe7b986 > > Best regards, > -- > Bjorn Andersson >