From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB75974043 for ; Wed, 19 Jun 2024 07:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718780478; cv=none; b=nlQq/y8EfpzF7aX0QoxI97MMvwUNtAArmxutagK6tyMiTxUG2F3uHtxNDjZSl2Kp0LVDZI2zC2BlQeNsq51ddl6vE4qgzM8JbRGVCm4/UMBM5P6yHP1ow2EYPOWBUiS8JIWT22xRki0sYDCEyKIozd32JO9RB+BkZDmlFfAlQvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718780478; c=relaxed/simple; bh=vqVzH7Q+py7+XHNXN6SV+8B/VLbUbbZ6vxhZez8tDIg=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=o1PLezlub55fvz3QN8kf7XviiH6wDTZvFlJQ8LqOIap5OfSe8PzSkNFQC1BtwI7yH2fr7jqDLc8R8ptMef4xghnveS/tVY9OSISuNpHifpA7pXpklYFDGToKjp9jHxgmEOzKX7B+9gmjRLarIAxqv1T8ywUvom7Uq7Wrdru6qtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lUigrxsF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lUigrxsF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C7BAC32786; Wed, 19 Jun 2024 07:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718780477; bh=vqVzH7Q+py7+XHNXN6SV+8B/VLbUbbZ6vxhZez8tDIg=; h=Subject:To:Cc:From:Date:From; b=lUigrxsFMetVu+AHEeMgQyrUOlPtlGaTRACRgQmdOITo0g62yGhwlPJfJ98onlX9f RWo7nL07E10VxYiSR51oNDW9xBfA/1WopH5stJj/Swc/JxLKwHTbShQHa3oxYJthzp S9ZWVyD1z8yi3Xhs0eWIqQ7O0BKvDZh7hlCGZ0MY= Subject: FAILED: patch "[PATCH] pmdomain: ti-sci: Fix duplicate PD referrals" failed to apply to 5.10-stable tree To: tomi.valkeinen@ideasonboard.com,ulf.hansson@linaro.org Cc: From: Date: Wed, 19 Jun 2024 09:01:04 +0200 Message-ID: <2024061904-headache-underfeed-cd85@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 670c900f69645db394efb38934b3344d8804171a # git commit -s git send-email --to '' --in-reply-to '2024061904-headache-underfeed-cd85@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: 670c900f6964 ("pmdomain: ti-sci: Fix duplicate PD referrals") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 670c900f69645db394efb38934b3344d8804171a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 15 Apr 2024 19:00:23 +0300 Subject: [PATCH] pmdomain: ti-sci: Fix duplicate PD referrals 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 Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240415-ti-sci-pd-v1-1-a0e56b8ad897@ideasonboard.com Signed-off-by: Ulf Hansson 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) {