From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 808A73C0A0F for ; Thu, 18 Jun 2026 09:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781774937; cv=none; b=HPsSTGteYXymq5aoUgP3k6+0WnHqJKBp24pFq6qVbzrA2jAtri0ZhARURLZC4p6tNgG/yg6AelwF048j2Td3YLJa0nH/09v20L7u0EbJg3a5HvZTvwWzyAFlZupRUBzr4dIoO9xq2FieH64wFWBHvlnINygN3Z4yFTxLEha548A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781774937; c=relaxed/simple; bh=n0ehsZOkSmTfJUHo1S4dKm5sKDNwaeJI1q+rZLaqI1E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=D3G+QWUR6oqbUoscHuJVZvI0NZ6nh++Q7t8KrVgS1WHJifH586dXGMdwS0BsBKDNK6WKNH0ydoRB7GN2Ioyv0E29F478F2KLyKEp4dYuzrUZZfpkhjl4rAAVJzi1mq1H69Rn3wKJuTAlMS6yDfc+48h+CjUFA6UmHwuhhkapbSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Nb+ExJoK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Da4cHIAs; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Nb+ExJoK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Da4cHIAs" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65I8Fak91011278 for ; Thu, 18 Jun 2026 09:28:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= eG5zsQP87SBHZTXWU9NhLhnIuxMOy7HmwxVPsoHLI5Q=; b=Nb+ExJoKPrZnZUDd 7ZNuwFiLLwUionlJ0TLwqBXCS/Csod2cbRdklqc8B13YBTjkdHz8kjEriLfbTx8r M1/T4UGZbS6akBVNdIzTYq3PuLgoQwV90Cr13XPM39RjdbOKtFx+QkBRnGtUnxav KXt5a+ou+cmZrbfZ9IAxC9UvLsK0y5kQ8OxtZJ/UYxmGldjC77sopevEcMHp1qbU 0hUUfkzDuWpKlGZ8qMru1tAY1rDqmIxD3QG+6f+bvXxzsgU60TPzdBTxgWN0sTZM VkXqZyeM47VAr0KEqv8U/d0u9ieji1ITrYMAYGbiRB9PDMHeMtuHRN7aXjjiVZ2H YChpIg== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ev1rttm7k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 18 Jun 2026 09:28:55 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-9158ecbfbc2so13865885a.0 for ; Thu, 18 Jun 2026 02:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781774935; x=1782379735; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eG5zsQP87SBHZTXWU9NhLhnIuxMOy7HmwxVPsoHLI5Q=; b=Da4cHIAs5ZqG9B+WbystUNfKvpMbTuTscHrtdTVzyXjqzMj6hyr+VdLavWKbYv3Dzk 7QuPC9IgBNbVZWjWKov+UsArTWlOPTuKYNNYYIaSMapBH58O2//A1CKhl0ApvB8Cre0k 67lXP/gFMi75DF6TCZJjGE7vo1RKkW5EH294YjLr5ORJ4nnzOWY6b/0wRl16YZZsf4YM HFvQQntFSnZVv4lQAM4QoRc9M9GiL9i3gWGRfTb/DF3sLt6wUcf2oxOLgXwZQDdM4SSL 5/eXYQtTugyaNlu54Pp69KBq+TNZdMzWu/x7fZNa0cuZlaWMW840Pim17/1S8O3uTVzQ WAdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781774935; x=1782379735; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eG5zsQP87SBHZTXWU9NhLhnIuxMOy7HmwxVPsoHLI5Q=; b=PE7h1WmEmmTyLPO84yO/yEgyyCZvSDcfcUKIoCQlEUWv7YZCLNh9cjoWVZ7CDHUUfO Hzz06hHHfV2rYjiTYMIT9Yn9kfLRs1dzB5Z+HOAS7xCOeRUs+hWCCmUPWdrLwixs86ef LeRaahvFJQIfS/DIbItTuGIis+xBjQwzV8Sd4hw7hXe8W/dsN9qRtyBhQkKv8gMOTZmi pP3EQT4RqmzxrSxgEztatmPCye3+5hC27hIWXnuur+f43RPIKxqGKIcJv9ICUqs58err DiSMpQYBPkZDQZ0x3XSCU1laWV9Ih0RVZ+jYoItjx2MSyTLH2lOp6C7ZXkhXUwNmOXi0 Xu3A== X-Forwarded-Encrypted: i=1; AFNElJ+8N9eo0mbcs2CFOnrx4EgmMpvDH2Ccskr5OFviB2sAmmx7xgGNMu4k3JEv0vjCMpENQgRD2C0S/OEJaV4=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1nEFXsSAHo8sFH3ymcDnkAd9TA4VkOBU+YFW3owLRwTSAhrAt JjEXd0Iu5Yu4dz3jOCq7njEQVVYI7pDmdE0gn7GG8qYih4hkR80D7uDrnYMyigOFT3quPD8NBLW bjIYdvAE5GCwHvOFHLOUZeDMy/WCvXjmmwWHlBqjdYfQB3vgwICkp28NVpsG+B5+gjxk= X-Gm-Gg: Acq92OHaYa222wi3h4iRAeCjRxPW37JQoCI9I2ogaK6RL/z4BENXmYria+QDCRCMqJR U+SzhWMyatFbJV65KX8Tmbs/I+hl9HWnH4/KUVmzK6OO1/OVHWV7xy6BB0Znozok2l/qg+VtKPK 1kvw0TAUOgoVB2G8Xyv0aes1RFl/q2kaTvuVreKsvF0Y3YCxGYv6VKDiJjsLar+qrmkDUBY4YLd b/eN08Z95DfceG3EyA251aThCUUHqBHKjsEmzfRj7z5WdZpBgccqghkL1XE3jEu6usYennYVul2 XO2qqfks0Kh/lLhBME0iqyc5F/5zk2SkB5u7PP8VFb2A4AWSvPlaFU7v/H2GYkVxuzhaOPuDtgy scRodTUhyBRgsr5IQeNFzfSJkFNqyMballr4= X-Received: by 2002:a05:620a:1991:b0:915:f92e:86 with SMTP id af79cd13be357-91f27cd63c2mr293829585a.2.1781774934792; Thu, 18 Jun 2026 02:28:54 -0700 (PDT) X-Received: by 2002:a05:620a:1991:b0:915:f92e:86 with SMTP id af79cd13be357-91f27cd63c2mr293827285a.2.1781774934250; Thu, 18 Jun 2026 02:28:54 -0700 (PDT) Received: from [192.168.120.170] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-69595d7934dsm1638902a12.30.2026.06.18.02.28.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2026 02:28:53 -0700 (PDT) Message-ID: <299d54c5-fb93-47ee-9495-fbf48a3204fd@oss.qualcomm.com> Date: Thu, 18 Jun 2026 11:28:50 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/6] iommu/arm-smmu: Add interconnect bandwidth voting support To: Bibek Kumar Patro , Dmitry Baryshkov Cc: Will Deacon , Robin Murphy , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20260526-smmu_interconnect_addition-v2-0-2a6d8ca30d63@oss.qualcomm.com> <20260526-smmu_interconnect_addition-v2-2-2a6d8ca30d63@oss.qualcomm.com> <7xfxlxfqjcqdzl6gckaoyy2ioefglc7bgi66yv5khrbl6fi2zc@ivtiukdaj4jv> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=MNpQXsZl c=1 sm=1 tr=0 ts=6a33ba57 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=gDzzPNA0uyMDLQwxZz4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE4MDA4NyBTYWx0ZWRfX+VZfO2Fe3nQA Lw1XZgsdAJ137xRWCC0jkj96T1yrXWSfyG/lwTZ5hSS5atg/VzrQQugQb1AGRDrEB3vpv2Ip4y4 X3TIeSkrrJBtWBKj76uNpNBjG/kLoxAz02MGn8G9wQvz9lr6tXlsbAd+S+Ch4POMMAq+InzsAIn adtXqTZa50TXvflsUcgGJwGpHUaQpCbu48a7xJSWDMQEN54wOzVDpHjqySdxQsBrTeZWqVtA+KR rnp8kYxCqUtJp3vgaO/diyppFhWE8Ot/fzh1odLVI19Uyeorww7WCXe0xCXXwDl3VUvgA4nL037 l6KpBUI4vMscQ6F3DShJyWwJaWBrjZpAd1TtzQh8dkxd2lcJwStPmPJS3D1pBGYObGFaqQhbf8U cye/1ts5R5IO1ss1g3b3Zw2EzbrBumT6Qsb8UhtELlpi1Lcgg8iWFRBMcDn/qyFxY21YPC5WFWL CcPLBM2++VEHu0daO7A== X-Proofpoint-ORIG-GUID: 6KhLrY3D7A5TflNDKpLFLzOHuUleM0wY X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE4MDA4NyBTYWx0ZWRfXwnCYYbqA7tYT mZU/nry7PtvvoAwundnjzqVdpOs1/HMCXgNHHbbYi//q/0jnNz/wcxjMFlLzpuMUeeRsOFr74vQ iENabZM24DFhQ39uAvMTDakUUsvS/JM= X-Proofpoint-GUID: 6KhLrY3D7A5TflNDKpLFLzOHuUleM0wY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-18_01,2026-06-17_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 spamscore=0 impostorscore=0 clxscore=1015 malwarescore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606180087 On 6/17/26 4:26 PM, Bibek Kumar Patro wrote: > > > On 6/16/2026 5:51 AM, Dmitry Baryshkov wrote: >> On Mon, Jun 15, 2026 at 06:36:51PM +0530, Bibek Kumar Patro wrote: >>> >>> >>> On 6/8/2026 7:25 PM, Dmitry Baryshkov wrote: >>>> On Tue, May 26, 2026 at 08:12:03PM +0530, Bibek Kumar Patro wrote: >>>>> On some SoCs the SMMU registers require an active interconnect >>>>> bandwidth vote to be accessible. While other clients typically >>>>> satisfy this requirement implicitly, certain corner cases (e.g. >>>>> during sleep/wakeup transitions) can leave the SMMU without a >>>>> vote, causing intermittent register access failures. >>>>> >>>>> Add support for an optional interconnect path to the arm-smmu >>>>> driver and vote for bandwidth while the SMMU is active. The path >>>>> is acquired from DT if present and ignored otherwise. >>>>> >>>>> The bandwidth vote is enabled before accessing SMMU registers >>>>> during probe and runtime resume, and released during runtime >>>>> suspend and on error paths. >>>>> >>>>> Generally, from an architectural perspective, GEM_NOC and DDR are >>>>> expected to have an active vote whenever the adreno_smmu block is >>>>> powered on. In most common use cases, this requirement is implicitly >>>>> satisfied because other GPU-related clients (for example, the GMU >>>>> device) already hold a GEM_NOC vote when adreno_smmu is enabled. >>>>> >>>>> However, there are certain corner cases, such as during sleep/wakeup >>>>> transitions, where the GEM_NOC vote can be removed before adreno_smmu >>>>> is powered down. If adreno_smmu is then accessed while the interconnect >>>>> vote is missing, it can lead to the observed failures. Because of the >>>>> precise ordering involved, this scenario is difficult to reproduce >>>>> consistently. >>>>> (also GDSC is involved in adreno usecases can have an independent vote) >>>>> >>>>> Signed-off-by: Bibek Kumar Patro >>>>> --- >>>>>    drivers/iommu/arm/arm-smmu/arm-smmu.c | 57 +++++++++++++++++++++++++++++++++-- >>>>>    drivers/iommu/arm/arm-smmu/arm-smmu.h |  2 ++ >>>>>    2 files changed, 57 insertions(+), 2 deletions(-) >>>>> >>>>> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c >>>>> index 0bd21d206eb3e75c3b9fb1364cdc92e82c5aa499..07c7e44ec6a5bd1488f00f87d859a20495e46601 100644 >>>>> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c >>>>> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c >>>>> @@ -53,6 +53,11 @@ >>>>>    #define MSI_IOVA_BASE            0x8000000 >>>>>    #define MSI_IOVA_LENGTH            0x100000 >>>>> +/* Interconnect bandwidth vote values for the SMMU register access path */ >>>>> +#define ARM_SMMU_ICC_AVG_BW        0 >>>>> +#define ARM_SMMU_ICC_PEAK_BW_HIGH    1000 >>>> >>>> totally random numbers, which might be different for non-Qualcomm platform. >>>> >>> >>> Ideally, any non-zero value would be enough to keep the path active. >> >> This is true for Qualcomm devices. However, you are adding this to a >> generic code. >> >>> Here 1 Would be enough to keep the path active, but might be too small to >>> reliably keep the bus active. >>> Other is UINT_MAX, which will reliably keep the bus active but might cause a >>> power penalty. >>> >>> #define ARM_SMMU_ICC_PEAK_BW_HIGH    UINT_MAX >>> >>> seems to be suitable here to reliably keep the bus active by BCM >>> for both Qualcomm and non-Qualcomm platforms (with some power penalty). >>> >>> LMK, if you feel otherwise. >> >> Shift it to the qcom instance or provide platform-specific values? (My >> preference would be towards the first solution). >> > > > To support platform-specific values, we may need to introduce a LUT-based approach in the driver. (Bandwidth voting values cannot be placed in device-tree property IIRC ?) > > Currently, all Qualcomm platforms use 0x1000 for SMMU ICC voting. I (you used decimal 1000) > can evaluate if this could be moved to a Qualcomm-specific > implementation. Add a vendor hook to arm_smmu_runtime_suspend/resume and handle it within the QC driver Konrad