Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1791018lqm; Fri, 3 May 2024 06:47:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbwpzF2mcUcidjIqnSf84gzLjmGuyjkT9GW7SI0NK8AD5j0owrFi6a+YRQilN8GKvk0pNiTMOmedxIuKzqgsSDFh6KzdhWOW3oUF15aA== X-Google-Smtp-Source: AGHT+IEPQeDxuXYQKAxYjITEozqTZmf7k9TsrEW5Kh8XvUYVV8HCkuZbUE6MKTazkzjuG2/PjZGz X-Received: by 2002:a05:6a00:181a:b0:6f3:c10a:7bf3 with SMTP id y26-20020a056a00181a00b006f3c10a7bf3mr3008527pfa.0.1714744067654; Fri, 03 May 2024 06:47:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714744067; cv=pass; d=google.com; s=arc-20160816; b=fujPMCavhZb7Wf2IxQk7mqsrqLhs0t9SKR9amGid5258bDZLHEOJREwEyL58Pb/QrO cXRIv1nz0FKTHjYxjPYTIVkUY01MNmd9qkJeKf6nZxD1kcSwcjG/nflj/8APKMfAzjWJ d2Q5P0vl7YtNp8m6CHmp9zysDZmBtpeGksrZo6D/LWXnGsI8gVQQmozs6agES8xsHtHs pAmUQT1MyO3LKLBvdDKlsUT4SF+qICNcVZkWDhcFAoBuGpXwcBo8e9hteAYBU7L9bYqo MNWe38H5J2/wCsk9eCqCHX7M5sjv/uriuKK8x2VWCbnI+rtGCgQiOMEDalCkoAw8sRKs QtGA== 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=g3ua50wpq46PgdKK2kII6t9P1G0JXIDxe02SWFIKB2s=; fh=S05Kv2Owt0MHBlJkYdjzDEjvVLeP3XvG7H8KTWx0h/s=; b=iL3+on+WtepnR5EB5e96paBwjoKHUZiw/Q/tmeaJf6uXn/NTy76wCV5qecFiBkGtKo riNzRlBrgShL5dNTPYy1TCgqHjeUz9cEkCK+A3pWv7WG1tGirRhzuzcriSeBGK0Qip32 cJkcpkcWpB8qlFxXoYOZFzvzQzmlqtCfoqyGQS4CaMDrcUsLSfJHy2ZkJ9X5ufTZ81wR WT37H+5qUkx/vVwenM1RC5DSFmyMxGyeGwCDyh5ai4Ron0Kj19iUPBCBmo513V2CO/Ad 0pPFx8+Xn1Sbm4+gnHQPrsJXj33aa5TGSefv7vT93X6Cwu/lL/BaGhjqUPhLEVbUq7Sd txog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="iTcfm/EW"; 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-167721-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fh34-20020a056a00392200b006f0b25a0a13si2999287pfb.184.2024.05.03.06.47.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 06:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167721-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="iTcfm/EW"; 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-167721-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167721-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2F0D9281C47 for ; Fri, 3 May 2024 13:47:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2332153BF6; Fri, 3 May 2024 13:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iTcfm/EW" Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (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 AE451153BD1 for ; Fri, 3 May 2024 13:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714744059; cv=none; b=ZhAlkNN/L1Je5RfcjGYBPypDVLyc1QWcILBr3Bkw4JhJnM5p1uAtz+zXl0yANtqW2YVpD+zdVMmXz8CgS59919+UeWAXPyRb7/WQX53sPtcek/cfs/UH6e12DVb564jSwbnAg0A6nMfs2k+iWtkpFUxSje+ryk292Fdlp5sMpRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714744059; c=relaxed/simple; bh=iFzFySdvqYlfRl4Ui4A1b/pniHe923+mjxQ/LLLWxVI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ZIpN6c8eDnCIw/Dd9lameLqj8cwZv2a84dTHapuwWDx6KFDTaPkAA9qWYlQQK/Q8yB9mZ0I9y0TfEYcey5e5KvOFOZtDR8NVwLglxXxE6IbtHfLJzEyYEM8wGJtaWcmgnzAAma9W3BqVTohLv8KU0mQTl0YbfZr6sum9VNJQLuQ= 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=iTcfm/EW; arc=none smtp.client-ip=209.85.219.180 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-yb1-f180.google.com with SMTP id 3f1490d57ef6-de5acdb3838so8468104276.1 for ; Fri, 03 May 2024 06:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714744057; x=1715348857; 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=g3ua50wpq46PgdKK2kII6t9P1G0JXIDxe02SWFIKB2s=; b=iTcfm/EWONRaWgxXUYZLWSvI4LJjuT4abW2ZWKdJ7Fz0y89iGRA/54mqH5NJxGy0W7 nTy6RMjZGVFOnnWpj726Ux+N0tnzvY1y5wxKql9zmPojdO4AuHxiWf1os/SpoMoEK0nY LYagLYhJAbkz7e+yuNqgxgCzJ74UB3diCbY1zUYI5GCrlNbfWK2FW8izIujLn8zTnw2b BtnW6pIZKZjDOd2r+XhMk42zFR0OcWUIfY6fZaj5lINX1RR8Eg0QnUsLMibRfGLCEQ6a hBtRC0fNEoLAgqgfWPetFKqelRExkAMGpDtutDtQi9C3ke21adx4FLgK90TtVsYb5cIn +kZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714744057; x=1715348857; 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=g3ua50wpq46PgdKK2kII6t9P1G0JXIDxe02SWFIKB2s=; b=P0SMDZRPiOx5oUlqGiRQJtQJqTNLSXPJFcmmkF89Rkq4oYHMRWa80dMuX5CH9rn1lX 6THN1edf2vIcNyHxgo8+h7vAAKkfFuF/SZxwzwiDl9XBJJlroD73Zw1MaeHgC7UM7S7g FuAzq+7PHJ9fjPPm2AKJLwhj5rJ56ef0B5EVGVQteDODbLM0/BtCa6RTvMCyGpS1CRrM zC/UPfoWe06i0KLIKuCVuOaL07dPFeAYZqc/gvs2QFwcdY2aTP/fAPEOngDwhNsQg68h gWIrXEKy+4Zketea5llpwGFEKB7P+k+6K/pDomRKS8h+LfRd71PrdI8CaeXmXj55iHZt IxDg== X-Forwarded-Encrypted: i=1; AJvYcCWaVeM6RdYq/p+uVvnwSooZ+K5T7ATAlwrHxnzPKIz5vMosciS82kn7tlVFLShAxCZTFiXa+s8Zm5u6HsZH/a8MSYib6PYrocryxJNr X-Gm-Message-State: AOJu0YzWu+WF1sFOYXjx+Kj++WAhQv4Lkc3NGbvG02U7m2RAkS5J5Ah/ 91wq4drvf0bAS+qmcPmUxtK+Y/5B+0dBkyytkT5Muq/jP6zVmJqgbQmQwuAxe7sMxQ/SQp1Xh1b YG30FZ+MRWh60ksPwRFHw8QGsBxf0OImNLAGT2g8+AoK4vzrI X-Received: by 2002:a25:b115:0:b0:dda:a7a9:7b59 with SMTP id g21-20020a25b115000000b00ddaa7a97b59mr2785467ybj.50.1714744056830; Fri, 03 May 2024 06:47:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240415-ti-sci-pd-v1-0-a0e56b8ad897@ideasonboard.com> <20240415-ti-sci-pd-v1-1-a0e56b8ad897@ideasonboard.com> In-Reply-To: <20240415-ti-sci-pd-v1-1-a0e56b8ad897@ideasonboard.com> From: Ulf Hansson Date: Fri, 3 May 2024 15:47:01 +0200 Message-ID: Subject: Re: [PATCH RFC 1/2] pmdomain: ti-sci: Fix duplicate PD referrals To: Tomi Valkeinen Cc: Nishanth Menon , Tero Kristo , Santosh Shilimkar , Dave Gerlach , J Keerthy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" On Mon, 15 Apr 2024 at 18:00, Tomi Valkeinen wrote: > > When the dts file has multiple referrers to a single PD (e.g. > simple-framebuffer and dss nodes both point to the DSS power-domain) the > ti-sci driver will create two power domains, both with the same ID, and > that will cause problems as one of the power domains will hide the other > one. > > Fix this checking if a PD with the ID has already been created, and only > create a PD for new IDs. > > Fixes: efa5c01cd7ee ("soc: ti: ti_sci_pm_domains: switch to use multiple genpds instead of one") > Signed-off-by: Tomi Valkeinen Applied for fixes and by adding a stable tag, thanks! Kind regards Uffe > --- > drivers/pmdomain/ti/ti_sci_pm_domains.c | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/drivers/pmdomain/ti/ti_sci_pm_domains.c b/drivers/pmdomain/ti/ti_sci_pm_domains.c > index 9dddf227a3a6..1510d5ddae3d 100644 > --- a/drivers/pmdomain/ti/ti_sci_pm_domains.c > +++ b/drivers/pmdomain/ti/ti_sci_pm_domains.c > @@ -114,6 +114,18 @@ static const struct of_device_id ti_sci_pm_domain_matches[] = { > }; > MODULE_DEVICE_TABLE(of, ti_sci_pm_domain_matches); > > +static bool ti_sci_pm_idx_exists(struct ti_sci_genpd_provider *pd_provider, u32 idx) > +{ > + struct ti_sci_pm_domain *pd; > + > + list_for_each_entry(pd, &pd_provider->pd_list, node) { > + if (pd->idx == idx) > + return true; > + } > + > + return false; > +} > + > static int ti_sci_pm_domain_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > @@ -149,8 +161,14 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev) > break; > > if (args.args_count >= 1 && args.np == dev->of_node) { > - if (args.args[0] > max_id) > + if (args.args[0] > max_id) { > max_id = args.args[0]; > + } else { > + if (ti_sci_pm_idx_exists(pd_provider, args.args[0])) { > + index++; > + continue; > + } > + } > > pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); > if (!pd) { > > -- > 2.34.1 >