Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp344177lqo; Wed, 8 May 2024 01:10:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlJvnDG2QeagxoVU9zd7xCKBw9xeXeeQgNf5lKqDdxFXLTuIZDkncTbnuqwTXHyaRamzgibD6pDwEaMaKR5k9+Tg3eN19ro5MQm97JLg== X-Google-Smtp-Source: AGHT+IFi27svcOnwcVzK8uqsQwSgjp9/ijavuf8gliP5CfyIHsu3yxmB01eRFszc8OB923+BeiOO X-Received: by 2002:a05:6870:310f:b0:23d:8e24:7234 with SMTP id 586e51a60fabf-24098c7f606mr2112193fac.54.1715155843739; Wed, 08 May 2024 01:10:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715155843; cv=pass; d=google.com; s=arc-20160816; b=No0JYEAl6cF6l4VO8GCcx9juE9W65aE7x9IukpLfq7sJ5KtULWCc9ZALx8q+zKkR5V Y81vteJ4OPw5ZOg67RsX+j+6YyaQ/yQb99aK/jmnQ6ZVO9ce9S9GbQhN3Fy9gREW2Mww 75lRtAoPlf/iyCYCBf3ibPojSj0QWH97oP09liEhQS+p0ZK2CMFue9tsEzqp4kSZQzf/ NVEh17v33A+qtnIjnzN5BA7arHuozmmsO03LTtKPtqc/KoOl9wqFRedsFREChk2lWmG5 XhwggCONJACfQRzTKeAWEORVg+qAoPPoNrRYhjSnNH0sl9fII49ifxqCK1o5iyO5RL1g 9vSw== 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=hDil2ZnVWcb5vp45cry1hHQo0ylQ9Dttur8ChmQtHdc=; fh=sk/8nzI54lSW7gHC+uC9qqGNb8bwWPXDHCZnS3gzYbc=; b=YH7AEu7gjwAPsIWQzci1NzabkC9f3HSZdcE6k5e23Vd+tkTFlszqHPFQLRyiJI2+MY DOVDsWymgqIfa1HJqKoRFKhuqJTXswibIi2HKn/Gy/zA02FkDdTbVh6+8E+F0Jv+0+0g 6kMsuuX6QXjQ5IqbliQqoVtTU3z7xSgS65QU5ibDrYRoTl34tLX7lkX8I8Kq4OorEhez Kyb7x5tWk1b2Bvz1kJboYLF77nZTjR2ZHKFsavFFxGxFEOAOwQNdVnPSi1Q+J5gWckKs ACZD+3CjxbkQ54nCP6gqNzH3/P8FTw4CHTHufKN25a7dsF1Z8ubM3uJShBf0gCNP7E+F SNkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bTkOMCKY; 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-172887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172887-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v6-20020a632f06000000b005f7599d0b80si11373943pgv.119.2024.05.08.01.10.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 01:10:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bTkOMCKY; 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-172887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172887-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 518D5281530 for ; Wed, 8 May 2024 08:10:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E08C8446C8; Wed, 8 May 2024 08:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bTkOMCKY" Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (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 2FA2336137 for ; Wed, 8 May 2024 08:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715155832; cv=none; b=SEXtzHM9Jh8OdjOG8nUc8QE/xoF4Bx27j9WnQjixiTTooAbwmKv1lPfApepYsMvP1TU7ZN5YMR8GwutaWArg3wQhf3rSIxoHtJVkWQtW6ZQPBW5mjyu5e1osMykzP9vDGTwuD1grfNa2S5BaZSfcJcnnWwzbfDHdZif9i3Dy58E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715155832; c=relaxed/simple; bh=yDdWDsmhU8mOYZ99K64v5ZtUCmcCbDJ3z/nVF/28VME=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=leV+AXUsoJ7k3tkO64+1RU3u9/uIAvYVnLnaG+3v6VcfCzsUFyWhkpasU4uPe8r2OR5GHDfXM3msVa7OShwlsPBnD2sV6stAVzrsa17YTxFUEXN0x7oPYaihYDUHX84qIu9koTek2814Eu2wj/SA58gVNPCLyfs3G6Gp3nW4AwI= 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=bTkOMCKY; arc=none smtp.client-ip=209.85.219.178 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-f178.google.com with SMTP id 3f1490d57ef6-deb65b541faso4021583276.0 for ; Wed, 08 May 2024 01:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715155830; x=1715760630; 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=hDil2ZnVWcb5vp45cry1hHQo0ylQ9Dttur8ChmQtHdc=; b=bTkOMCKYsk+gYYnKHVYMEdKUHaTSk9qPwcT5Bkxtwq5LQ2rSO0QOmoRfHdqVwXfgAx KPUz49rNSHNXz4Og1SCb/eDaH6n47DrdHIGoPYsTP860Gb4ArLfT5C2TM/ZvQbm2s1Y9 bTO/nhXOJYTwT3FmB4DV1o6wX+PzuirJ33jdrb1x0dFZXSURYPapbahQSD/Oy6saZfD+ I6DxLOYvXeOoRyudYWMIH5iF9uytiCYyb/gCvZeF0pfA27UGh6TwAYoljgEvLHcsZxJm IP5Wo6Zh+YodvFpamtqJR2zI6mO2QBOmPOvLxHE7mNeV0A0GKbgX0sHA2Sg4kN8G9iRM 8ENQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715155830; x=1715760630; 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=hDil2ZnVWcb5vp45cry1hHQo0ylQ9Dttur8ChmQtHdc=; b=HHZffxF+UZvN7y07wUyKaqq26ztW9VCJbNugn8oJ8JmGINV05kxVYvzz2OF/OqKifU lCzYFiIradstdCIr21Pz0Rvu1APO3E62Zq+WV60If2bC68M6uuMC0WG6yRsyIcT8164i cpA+g+Rq73CxTtGrU4G0oI4XR15PHbDHdSRJUs8TZKl4ZMp7Gt4Ld7OQKTp+Nob+Pvk3 /S2JmOEDT/+xAIy+F2r3xFriGQ+jjD9sOKf04X0dsV3/XWX8mNCwDiSussLLmKM0Pixa Vb9nOzu9UoloO/fgn27dYXxK6bs5Pzq0WClWt7WRZUpBSTpGT+XNVLwb/22sCA9zAuSp XTZg== X-Forwarded-Encrypted: i=1; AJvYcCVZJn2PqsJLapgvSHkM9ud3GkfFo7gGLj46+IPYST4Ysg63hzZxF2IpDhCu4+7M9bHyZh4XqCsOh4TMLhejLJWTJ+nRrFoU0xdz1FqM X-Gm-Message-State: AOJu0YwswWj5189P6NxuynCNQzidO3CRQaXhhRV88vVhcxiC5npuog/t tE56HIAXJ6TuWe3zSYBCDW4EQCVirnjkGeJpe8OrqJ8tq2c68bkZ+W+dJMuAcJ3fhFrP3UOSpgX 0vO5/g/MTKPZTyHyuF57sETHjD/LAP6pb+SVj4g== X-Received: by 2002:a05:6902:46:b0:de5:a2de:9453 with SMTP id 3f1490d57ef6-debb9d4ac68mr2095872276.17.1715155830352; Wed, 08 May 2024 01:10:30 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240418092305.2337429-1-quic_varada@quicinc.com> <20240418092305.2337429-7-quic_varada@quicinc.com> <27f4f3dd-9375-40cf-8c8f-1c4edf66e31b@linaro.org> In-Reply-To: From: Dmitry Baryshkov Date: Wed, 8 May 2024 11:10:18 +0300 Message-ID: Subject: Re: [PATCH v9 6/6] arm64: dts: qcom: ipq9574: Add icc provider ability to gcc To: Varadarajan Narayanan Cc: Georgi Djakov , Konrad Dybcio , andersson@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, quic_anusha@quicinc.com, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Wed, 8 May 2024 at 09:53, Varadarajan Narayanan wrote: > > On Fri, May 03, 2024 at 04:51:04PM +0300, Georgi Djakov wrote: > > Hi Varada, > > > > Thank you for your work on this! > > > > On 2.05.24 12:30, Varadarajan Narayanan wrote: > > > On Tue, Apr 30, 2024 at 12:05:29PM +0200, Konrad Dybcio wrote: > > > > On 25.04.2024 12:26 PM, Varadarajan Narayanan wrote: > > > > > On Tue, Apr 23, 2024 at 02:58:41PM +0200, Konrad Dybcio wrote: > > > > > > > > > > > > > > > > > > On 4/18/24 11:23, Varadarajan Narayanan wrote: > > > > > > > IPQ SoCs dont involve RPM in managing NoC related clocks and > > > > > > > there is no NoC scaling. Linux itself handles these clocks. > > > > > > > However, these should not be exposed as just clocks and align > > > > > > > with other Qualcomm SoCs that handle these clocks from a > > > > > > > interconnect provider. > > > > > > > > > > > > > > Hence include icc provider capability to the gcc node so that > > > > > > > peripherals can use the interconnect facility to enable these > > > > > > > clocks. > > > > > > > > > > > > > > Reviewed-by: Dmitry Baryshkov > > > > > > > Signed-off-by: Varadarajan Narayanan > > > > > > > --- > > > > > > > > > > > > If this is all you do to enable interconnect (which is not the case, > > > > > > as this patch only satisfies the bindings checker, the meaningful > > > > > > change happens in the previous patch) and nothing explodes, this is > > > > > > an apparent sign of your driver doing nothing. > > > > > > > > > > It appears to do nothing because, we are just enabling the clock > > > > > provider to also act as interconnect provider. Only when the > > > > > consumers are enabled with interconnect usage, this will create > > > > > paths and turn on the relevant NOC clocks. > > > > > > > > No, with sync_state it actually does "something" (sets the interconnect > > > > path bandwidths to zero). And *this* patch does nothing functionally, > > > > it only makes the dt checker happy. > > > > > > I understand. > > > > > > > > This interconnect will be used by the PCIe and NSS blocks. When > > > > > those patches were posted earlier, they were put on hold until > > > > > interconnect driver is available. > > > > > > > > > > Once this patch gets in, PCIe for example will make use of icc. > > > > > Please refer to https://lore.kernel.org/linux-arm-msm/20230519090219.15925-5-quic_devipriy@quicinc.com/. > > > > > > > > > > The 'pcieX' nodes will include the following entries. > > > > > > > > > > interconnects = <&gcc MASTER_ANOC_PCIE0 &gcc SLAVE_ANOC_PCIE0>, > > > > > <&gcc MASTER_SNOC_PCIE0 &gcc SLAVE_SNOC_PCIE0>; > > > > > interconnect-names = "pcie-mem", "cpu-pcie"; > > > > > > > > Okay. What about USB that's already enabled? And BIMC/MEMNOC? > > > > > > For USB, the GCC_ANOC_USB_AXI_CLK is enabled as part of the iface > > > clock. Hence, interconnect is not specified there. > > > > > > MEMNOC to System NOC interfaces seem to be enabled automatically. > > > Software doesn't have to turn on or program specific clocks. > > > > > > > > > The expected reaction to "enabling interconnect" without defining the > > > > > > required paths for your hardware would be a crash-on-sync_state, as all > > > > > > unused (from Linux's POV) resources ought to be shut down. > > > > > > > > > > > > Because you lack sync_state, the interconnects silently retain the state > > > > > > that they were left in (which is not deterministic), and that's precisely > > > > > > what we want to avoid. > > > > > > > > > > I tried to set 'sync_state' to icc_sync_state to be invoked and > > > > > didn't see any crash. > > > > > > > > Have you confirmed that the registers are actually written to, and with > > > > correct values? > > > > > > I tried the following combinations:- > > > > > > 1. Top of tree linux-next + This patch set > > > > > > * icc_sync_state called > > > * No crash or hang observed > > > * From /sys/kernel/debug/clk/clk_summary can see the > > > relevant clocks are set to the expected rates (compared > > > with downstream kernel) > > > > > > 2. Top of tree linux-next + This patch set + PCIe enablement > > > > > > * icc_sync_state NOT called > > > > If sync_state() is not being called, that usually means that there > > are interconnect consumers that haven't probed successfully (PCIe?) > > or their dependencies. That can be checked in /sys/class/devlink/.../status > > But i am not sure how this works for PCI devices however. > > > > You can also manually force a call to sync_state by writing "1" to > > the interconnect provider's /sys/devices/.../state_synced > > > > Anyway, the question is if PCIe and NSS work without this driver? > > No. > > > If they work, is this because the clocks are turned on by default > > or by the boot loader? > > Initially, the PCIe/NSS driver enabled these clocks directly > by having them in their DT nodes itself. Based on community > feedback this was removed and after that PCIe/NSS did not work. > > > Then if an interconnect path (clock) gets disabled either when we > > reach a sync_state (with no bandwidth requests) or we explicitly > > call icc_set_bw() with 0 bandwidth values, i would expect that > > these PCIe and NSS devices would not function anymore (it might > > save some power etc) and if this is unexpected we should see a > > a crash or hang... > > > > Can you confirm this? > > With ICC enabled, icc_set_bw (with non-zero values) is called by > PCIe and NSS drivers. Haven't checked with icc_set_bw with zero > values. > > PCIe: qcom_pcie_probe -> qcom_pcie_icc_init -> icc_set_bw > NSS: ppe_icc_init -> icc_set_bw > > I believe sync_state is not getting called since there is a > non-zero set bandwidth request. Which seems to be aligned with > your explanation. This doesn't look correct. sync_state is being called once all consumers are probed. It doesn't matter whether those consumers have non-zero bandwidth requests or no. -- With best wishes Dmitry