From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (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 0D90938A723 for ; Wed, 14 Jan 2026 10:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385262; cv=none; b=cDRYUs/RetD1c/xxOgxnj4oVQPFQlpgeQ8Ad1EL1Cqpk3863t0W5C3bS37cVoN2k27GuIc1GFjKICgjSjVp+waaE63vkK3tgH/pHkdHMfguITvt3x+Dx4bbzW3BVK2iC47JlBQBECKWmNCF6mKF/ImWhYuDDGQvh8VeaMm0rm28= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385262; c=relaxed/simple; bh=aqHYCoOIh2zY40JLbyZ6FfpCHfXNb5CknOmVdBYwquw=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=FCX7QjlRSP/oJBzccRVDqCs8frqXybgTu/9SdTPEoYmDSonMkSqR0omuqOPB/usiJA8DXMLK5NJFymU7pouFhBhesKN1P5mj/L0+tL6yL5/xRACxzWQossB0sBZe3Ad81ZC19RT1qDZeyv6IkqzFiDoQhSiM2rbV/wpOKSrUV7c= 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.65 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-f65.google.com with SMTP id ffacd0b85a97d-42fed090e5fso4862864f8f.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=UsNjMt3mYDhswgA/RCM8opYBuFpCt6VCEgVohXUYq9k/I+ieI6cqZoOlQDzKPLA4e9 ghZS7vjCTItEq7lpA48PuxkJPrNKzW8uiz7VI9eP3vnYS5bZhc16cuy62dewHN2JZj3Z k/6861dvt03v7oLIUCpyuUnmZ3/w9mOWVlztF3MLZfMRUKePkFy2LD3I2vbsASZ1cwwP ME3jCi56/2DL36XMG0C4LUDiRybw2IhTAHg5HWWqxfamKlvhZMRqpANEQALOmCuvmk6N Qt6Sb0Ee1XmpQysGTKCxpIfk2VndYLQSm0SDqOMQMCY6PRe/7exVq1mb0z5NDAZ5tvAq pilg== X-Forwarded-Encrypted: i=1; AJvYcCWqKpQHj5DXRRsp/0Ld/rUXUF2jShZvzJEka/3LKQwYngdWSw3argA/Y3x/2JmbNzC2GIvKIrjbyye8lg0=@vger.kernel.org X-Gm-Message-State: AOJu0YwvM30kjodSSXd+1BbNRVJn+PF0XTFY6Pk1EFb7EVS2qR4Fk2dN nsdw0nselDUi+eIZUg8uRoFq5vwS8xd3oyryzXK6cfVqHyTPJ2nsC4fzDQRh5gxVGWA= X-Gm-Gg: AY/fxX5ryqJlHVDV6DjT3VHeWVoLucywqsfAAwpZlvuJDy2ozDh7MvBLYmUQ8xFhd9B q7NAvltT9KB0RoGufyOSSVZFGq8JxgI/Gr+hS6ex88IM9IVxG3244y2XxThw29wRh9K1AUiJY9Y 6hvhHfBIktaiKY49B0kNbpYRGRa4USonuiN4OmzxQCucdkWOVO9xyVnOceyB/uTMs3wQFblqg+g 22t8U972Ps9GmB0W5dovlhvOtN7gFf3TYtyamfSaCrmPRX/WudBWVb2yDrbsMKJYf/I+REXE337 jmb736sNqZklQ0OFsYbUFm0FIJmhOMX/b4kdSqe10G34hk7FB99JnIEfjCKqu3SxnkwVxLdvUAa uwrmLrvelZe5mRe8OXjKW02xWJ+5/C7tJ/D0Vb1wLK6+BT48FeGZULgfzEIM67iVpMYKegnMPYu E8gpU/NXbUjanmEhUxCPAhk9xU+gegBnnwjp+6gbIY2jum4zyyE5ovEfnmNzfiWno= 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-kernel@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 AAHNKk5laWwgQXJtc3Ryb25nIDx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yT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT 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