From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (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 1600C38A72C for ; Wed, 14 Jan 2026 10:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.66 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385263; cv=none; b=MUVN/Oed8Gk0Wg46FIllbrYdFskwuGx8tnNipNHdl1Uy0gj4Rt4zRAmrDKekSWE4e5m6+pc6T6NPrx9EiZZArVvu23+J2PIWGD7/QEzG9yhP1zcyHKXp+K4PYy/kgS1IFSIKy/x715Md01XQ7rpoKLhZnlKEBYujpdbeYGrW1Ik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385263; c=relaxed/simple; bh=aqHYCoOIh2zY40JLbyZ6FfpCHfXNb5CknOmVdBYwquw=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=hlPgCyMB4Mo+ZgryJMJr4udNb1LjjTdd69nBcW33IyCxRxXvWo9gEBn28e2ioMPziXaA3p6qfkwMmIvrMmle/YNaXN3bfaQWvpUPHb9eNAZ9ZdtqndthImrrGxErvwQRN8hwoWDPUD3AgDuxZTwMV65OW7BpEhvQhtO9X+6Z6KQ= 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=H9DsiHHl; arc=none smtp.client-ip=209.85.221.66 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="H9DsiHHl" Received: by mail-wr1-f66.google.com with SMTP id ffacd0b85a97d-42fed090e5fso4862865f8f.1 for ; Wed, 14 Jan 2026 02:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768385258; x=1768990058; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=n8mW+tYY/3O9GKx5C5cOgVc4F9fjWRFBqMrxS64uloQ=; b=H9DsiHHlhF4GL2p9dBZbln5Avj0w/7rwZ9gGeA3BK/R/gAv4GGUCX+Sw+Z08r7hg9w jBlwb/Uha/af66u6pnuKQIcilUwY5ony+RCTzlJQwQ8b2frbBfvBEAtgKvWddA+ELGIR IjOpoFzR19rIqvR+s+LKhXlAxnq1bF2xl96yMRURXTlsmR/mRArTDB4qV1BYVkToohRQ 76pRkYLaly8KMYf+7sVIOjYMVSPE+wx5bX38vk8UgYSFEIvxYG2fZKabLA5f+Eghd8B9 zQZpcEuY0kt90RdzZMjATI4k8xBZzkokiKXuR+FoYbpH4sm4AEyIiYCNht/y87p76BcY YTDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768385258; x=1768990058; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n8mW+tYY/3O9GKx5C5cOgVc4F9fjWRFBqMrxS64uloQ=; b=aztN7htpCOaUYkI2+GmkhScMW+U3Wzq60c572akhiEAsSmKMLGyFxtX01p0ewCINiE xvmEv0wf6VQ+Z1pofoARAXII25lsqjqaXs3Krta2++4jEq5bWO3tpIBcXUmkK7Sfqqbk K+hXRHkZlDcr0s9ZERpNrPNaGkXarZNYCymBtC8gWGmogbWpiuUeTM2c2uiRHm109DKz 3SeHw9GWGv25OvpjF6HCw/6tw3LtdkXASCKhNofNf/UeB8FgXD9mTBfXKq+eKwUCu7to SsYDjkh4Bja9eqtBgJLqhG1lZ9XtN5tnIY7QWoQXWTnMTrBdijqtYg8yAICjxtDql61Z I8aw== X-Gm-Message-State: AOJu0YwqQMO97UUob/uW+RIawB4NOhd+e0+CUXBZDyNJyxxwE3Mb85OX 2DBKARBmhC8JzofMBJTxS8PHaJI8e1xjA1oieAixWc9btuyGfLwLVEkwPJvk/kiT1VA= X-Gm-Gg: AY/fxX7P7ulFob2q+8tTmfD68uf2IHD9cVMVf1pSdmafaHWSUF0FDjSq187TYTtL2Rk 3rCMbDvtDzS52Q/kpN8rwey40260uvSPQUVSCTxUKsx4H8FMFug3wifMljpwsBWbiD5Fx/w+F1+ SBYVe40bQo1mIwcvuQ5WDfdrZz5akg+DEPgB69sOIrrmLuvWKu3zbhBuPpjBDQTctiqrWXKR4Cz xE8ZOe8QjBElkeUJoILhlObQmxZ//GPwBfXj9dAwkMm1IXnCIujf2sVGlCATI46xSRvFMujajRY 9GcjiRK0erSWx002ZstqGAP0n2KRhtVNrx1Bme1G4Feetyo7TGO8LeJop1n2YwH9coHFQYUureZ ysCWyLOQcXFUhCwIhGa3E8rptuXLdbddhO52OfRtYY4oAhl/OV6ffn110SDZBpCghwUo4hBjjrt 8aRELr70UuyKHdg9oSQXUu7/ayfHeDQfrkzihBMx3XW4FY4zYjWPvu3RWDt9NUonQ= X-Received: by 2002:a05:6000:2893:b0:430:fd84:3171 with SMTP id ffacd0b85a97d-4342c500119mr2192528f8f.22.1768385258402; Wed, 14 Jan 2026 02:07:38 -0800 (PST) Received: from ?IPV6:2a01:e0a:3d9:2080:b357:7e03:65d5:1450? ([2a01:e0a:3d9:2080:b357:7e03:65d5:1450]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-432bd5ff1e9sm51179179f8f.41.2026.01.14.02.07.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jan 2026 02:07:38 -0800 (PST) Message-ID: <95becfde-ba4b-4024-9b90-e64e77551f0a@linaro.org> Date: Wed, 14 Jan 2026 11:07:37 +0100 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Neil Armstrong Reply-To: Neil Armstrong Subject: Re: [PATCH RFC RFT] interconnect: qcom: implement get_bw with rpmh_read To: Konrad Dybcio , Georgi Djakov Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson References: <20251106-topic-sm8x50-icc-read-rpmh-v1-1-d03a2e5ca5f7@linaro.org> <8eb528dd-71fc-408e-a97c-d484198e4f81@kernel.org> <1be287ac-fce9-4f27-aa88-b1f786e968cd@oss.qualcomm.com> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKk5laWwgQXJtc3Ryb25nIDxuZWlsLmFybXN0cm9uZ0BsaW5hcm8ub3JnPsLAkQQTAQoA OwIbIwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgBYhBInsPQWERiF0UPIoSBaat7Gkz/iuB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XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: <1be287ac-fce9-4f27-aa88-b1f786e968cd@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/14/26 11:01, Konrad Dybcio wrote: > On 1/13/26 6:53 PM, Georgi Djakov wrote: >> On 11/6/25 6:46 PM, Neil Armstrong wrote: >>> Since we can actually read back the APPS rpmh interconnect >>> BCM votes we can actually implement the get_bw() callback >>> and provide a coherent average and peak bandwidth at probe time. >>> >>> The benefits of that are: >>> - keep disabled BCMs disabled >>> - avoid voting unused BCMs to INT_MAX >>> >>> If the interconnects are correctly described for a platform, >>> all the required BCMs would be voted to the maximum bandwidth >>> until sync_state is reached. >>> >>> Since we only get the BCM vote, we need to redistribute >>> the vote values to the associated nodes. The initial BCM >>> votes are read back at probe time in order to be ready when >>> the get_bw() is called when a node is added. >>> >> >> FWIW, I was able to finally test this on sdm845. Some nodes are indeed >> showing reasonable bandwidth values instead of the default INT_MAX. > > As I learnt here > > https://lore.kernel.org/linux-arm-msm/1e7594dc-dca6-42e7-b478-b063e3325aff@oss.qualcomm.com/ > > rpmh_read() will only retrieve the currently active values, so as-is, > this hunk: > > + /* For boot-up, fill the AMC vote in all buckets */ > + for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { > + bcm->vote_x[i] = x; > + bcm->vote_y[i] = y; > + } > > is lying about the state of wake/sleep buckets > > this is ""fine"" today, as I don't see any "if (old_bw == new_bw)" checks > across the framework, but debugfs is going to report incorrect values and > if anyone decides to add the aforementioned check, it may introduce issues > where the values aren't commited to the hardware (because Linux is going > to believe they're already set) This is only for the pre-sync-state phase, where we don't need the wake/sleep values but the interconnect rpmh implementation needs them, and anyway they will be replaced by proper values in sync_state So this is an informed & assumed choice I did here. It's a small optimization to avoid turning on _all_ interconnects at INT_MAX, and keep boot votes up to sync_state. Neil > > Konrad