Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2304648pxj; Sun, 30 May 2021 21:37:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3FZN7FcOpBkhlTpoo2alOB0H1+YHLVy61bU7DT7hj15CWSEwWhQtE8WI6DS4nxZtxRDRc X-Received: by 2002:a17:906:988a:: with SMTP id zc10mr8483144ejb.62.1622435821982; Sun, 30 May 2021 21:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622435821; cv=none; d=google.com; s=arc-20160816; b=e9Pn7Cfjb833MA9WrhEAsRaNM3cujcxd/aqLrUyzPDfq8BlZqrTedTMt+V3SXVvIsj xImu72Dh59/Si8ZJ/3AKmmD6NNnvEEleyQjny0PgdhxMv4ayB9ZyIqJJ7lAWQVBStu19 oAGiJtgjCo0av0SGmOurzUeTtR7eXaXBc/5yvwkGVdhj2UuDrJpAiFboCk7Mstky80A0 uH0AiX6s/q7pTEhaqE1uu7TCQnJbhiiIEJhPs/SEJCM74qIABgDLcycWABP8ljLJAoeP HlrrLvXmLvFrrQdrhfl+YdwKKHO1k3o5w3Q80ynHpFMDyK0nknGRdH+GVIhagg7bqRTj aSyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8TCxgyYQSr5o3I78mldH5Z9lcyNNYCjL0+Xcvw5BpHc=; b=RGwrplr9Nw6FOmkGi5LB3k8Wr27vl1nyod8yV4LHANcBAo+yU2ckR4TKvPElA73OGn +7U7Unm60B6ICrZUd32xglSAdlL5tSRztTZW6iLgbRcCdxrIqXCpyP2jaRu/WowF7dAA TriTSkmEbo7Z1k87q/ho5kT1NuMrwQdKkVuizKqqnYzSmwag7hAa/+KmmAg8djnyxyuN ZTVoNaViXERSXSsvf7jXOh1/dXI4/6POcGwCJJZA+gHbz5yq7hn2i710IR9oMh702ZHP /giKshGXRYbN1VZ+GhAIFzhlncC1EKwCpYlhXhBlbsnPr+QK8vz1br0wKBegdyO9cMET IB7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c2reybcr; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si14126971ejq.124.2021.05.30.21.36.38; Sun, 30 May 2021 21:37:01 -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=@chromium.org header.s=google header.b=c2reybcr; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbhEaEhG (ORCPT + 99 others); Mon, 31 May 2021 00:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbhEaEgs (ORCPT ); Mon, 31 May 2021 00:36:48 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3575C06174A for ; Sun, 30 May 2021 21:35:08 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id t21so4591489plo.2 for ; Sun, 30 May 2021 21:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8TCxgyYQSr5o3I78mldH5Z9lcyNNYCjL0+Xcvw5BpHc=; b=c2reybcrNCcfCPjUCkeuvpe3yKi/hqDQxkdLaYqMtpdB1ihkdJ/Ee6lG3gARI5Tsn6 dmWLsn8v2A2NK1XB/35IHqY6VaBEVdLMmndFSX/EZsvOQhOz+nZhcfeCRTbp2DyFwVD0 cKJIZOyZZxC22NNizE2huExt08h9WKwASPX4o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8TCxgyYQSr5o3I78mldH5Z9lcyNNYCjL0+Xcvw5BpHc=; b=A2LnZAX1vaNTUfVrWDF8FsDHKW4aidg4lKKgfsbrmNaOa2+JJX2Jlhvzv+UL8Eg3Xw ovqUVz58FQ5qA5YFoFtNZqtHB2O5R00ZAWCrdZbU0T/aBjqVUPyjkqOPar2+SB10WwWj 0lwRNRjy2xWfjBz20e1eP7zAlCYFG93TOqjhwf/iH4RdjVbsCYRRaoeZLOOQID7l711L gqC5DMNnnrTAYpqsVcTzwXFzILDmJZfOpAOyev6zyy/Pn2SQDLDs9mEo8Lyni1M6hH5p 5Y7++OICh7eCJkzjMec+tlpPzopwwAHpEOT6/by1QqqnyY6cxTkaBtcJ/nlj6rDUelny 3Rzg== X-Gm-Message-State: AOAM533D2LyPHcAsibyuHGQcM5MdHN4iFtvEy73KnV34nYt/ShMadeAG 3ycscHqWqObz7YWuUL96pvRoDQ== X-Received: by 2002:a17:90b:f07:: with SMTP id br7mr10601569pjb.141.1622435708158; Sun, 30 May 2021 21:35:08 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:c929:9e58:1e99:bfb5]) by smtp.gmail.com with ESMTPSA id a9sm9366811pfo.69.2021.05.30.21.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 May 2021 21:35:07 -0700 (PDT) From: Hsin-Yi Wang To: Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , Enric Balletbo i Serra , chun-jie.chen@mediatek.corp-partner.google.com, Yong Wu Subject: [PATCH 2/3] soc: mtk-pm-domains: do not register smi node as syscon Date: Mon, 31 May 2021 12:35:01 +0800 Message-Id: <20210531043502.2702645-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog In-Reply-To: <20210531043502.2702645-1-hsinyi@chromium.org> References: <20210531043502.2702645-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mediatek requires mmsys clocks to be unprepared during suspend, otherwise system has chances to hang. syscon_regmap_lookup_by_phandle_optional() will attach and prepare the first clock in smi node, leading to additional prepare to the clock which is not balanced with the prepare/unprepare pair in resume/suspend callbacks. If a power domain node requests an smi node and the smi node's first clock is an mmsys clock, it will results in an unstabke suspend resume. Signed-off-by: Hsin-Yi Wang --- drivers/soc/mediatek/mtk-pm-domains.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/soc/mediatek/mtk-pm-domains.c b/drivers/soc/mediatek/mtk-pm-domains.c index 536d8c64b2b4..a9ba71eee4bb 100644 --- a/drivers/soc/mediatek/mtk-pm-domains.c +++ b/drivers/soc/mediatek/mtk-pm-domains.c @@ -296,7 +296,7 @@ generic_pm_domain *scpsys_add_one_domain(struct scpsys *scpsys, struct device_no { const struct scpsys_domain_data *domain_data; struct scpsys_domain *pd; - struct device_node *root_node = scpsys->dev->of_node; + struct device_node *root_node = scpsys->dev->of_node, *smi_node; struct property *prop; const char *clk_name; int i, ret, num_clks; @@ -352,9 +352,13 @@ generic_pm_domain *scpsys_add_one_domain(struct scpsys *scpsys, struct device_no if (IS_ERR(pd->infracfg)) return ERR_CAST(pd->infracfg); - pd->smi = syscon_regmap_lookup_by_phandle_optional(node, "mediatek,smi"); - if (IS_ERR(pd->smi)) - return ERR_CAST(pd->smi); + smi_node = of_parse_phandle(node, "mediatek,smi", 0); + if (smi_node) { + pd->smi = device_node_to_regmap(smi_node); + of_node_put(smi_node); + if (IS_ERR(pd->smi)) + return ERR_CAST(pd->smi); + } num_clks = of_clk_get_parent_count(node); if (num_clks > 0) { -- 2.32.0.rc0.204.g9fa02ecfa5-goog