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 7B27E3B1014 for ; Mon, 8 Jun 2026 08:55:37 +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=1780908938; cv=none; b=BAOBj46XNDT5UtIgyZbEGv8iF9GVwcCSeTZK3sBKErW8aWx6xlgptDQjVAN/JrGreECzbglHO6+AaHH/oCNFgu8E4Aj/z42T9SI1wM6uJB9hikhiRpJglpNiGm3F9hsNhs0fLufpMO/8YmQKaUNrHAANTjoSHdS6TbUQf9mmzPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780908938; c=relaxed/simple; bh=fBerNiWf+MDgAZrSmTXySSQ3C8VQubBzWw+Rofp9O60=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N94jDJfdsiOCFXndFzpE3Sw+jYqbDqDWoCONAbzTkidAQiPSqAvZQQrrPo/BvEjy6yID6aMWkQdJPN20HC0rRdWUISInFvYiRQGQ4SPgFAqEJPmVFQzEHxH86+ZnmX7nnE02D4tW1oIGa0bIOIjB7UsLC6CoyIe+XfGjZMgD+2Q= 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=QYv+LLyj; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=I/FeeAAP; 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="QYv+LLyj"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="I/FeeAAP" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6586Olp82801750 for ; Mon, 8 Jun 2026 08:55:36 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= 6ua1qIQefsn0KzCMxDrvAnd9Wib/2gaov9ZIiLNLNqA=; b=QYv+LLyjuU5ToV6J TXdyJnl3g1VRUt43hsHCzXqjBXEeTJ4o2jTCmX68L5wsdDiOAYNmw0m8khGn6uma zKk1NsBJA6hVxC9hmFNP6p3pck+cTYLjHHvq3QsSxnMfiuGtMc40hGgtWOwjz/B3 jDj6Df2PIT4Blfp+Fv4gXkmyethc7IboVu9w8qpnnmzcetPeuqp+FDsj4MYpCa9M kYuqSTYTfWYxXt8+iDZJbtaVGc4eV2z+Ld11dmkVVcOhVNjLzbtQW2M+BGuj/Hj+ hNFdBmBaiXk2UPhk+/PWHbY536bxMKDVNBESky+8xVvs1LUlbY1bN10RwYwZQJ+8 lImZZw== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4em9k3qbc0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 08 Jun 2026 08:55:36 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-517647fbff1so13896281cf.2 for ; Mon, 08 Jun 2026 01:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780908936; x=1781513736; 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=6ua1qIQefsn0KzCMxDrvAnd9Wib/2gaov9ZIiLNLNqA=; b=I/FeeAAPffJTARlSl96lMRgZRMThnr/AjGeAHQwiYPYnl6N2XbvXFLo8JLaXSEj75c 9g+L658ewepekTXe/iNDsEts4zE+J/MhfvpfDxDercc5LrfvY/Z8a5F4yiZiRYBf5ggc sP5eUbBr/oV5u4jkFRHH/51G0vUcymNYHTdnF1JXGNIrZgg5/5fUmFVu7D/0PvBiq4R4 Tv1laHyuoeo2oEAOUfoZJPzx5AaIv4m2SiWMbB3MDmUDgySbImNqrulXUjSEZiRkfsJg 5YO3ENfQn0w7NUJQETuAjPxa1sp/d9lSAtaxJ+Zgobs+8SRWQckfQ+BWSePajyWo/NR0 4Dww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780908936; x=1781513736; 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=6ua1qIQefsn0KzCMxDrvAnd9Wib/2gaov9ZIiLNLNqA=; b=epF1PnZEPxdfBSBzYGTsOum9edCzaMD5EJV0kWGoMBMQJN79qUqOtSIsiGthXycNQY SSkSgvfkb7SX2P95uDaH3IUy92GTR8OSY80hZshM6T2lO3YiEvDICbQqi2b5QEzZMJWG Jz2vlhRiJUKLGW+K25m1XUKZBkqHqpE1XiIvJqCEwCFw+WToNqRf9Nq/EuOZfJwLDrQN FpX3EoYgsWfmK5JDciJmNphuqt2AGAFPzFPutNNjWj/hcctgGSgYnfZhQGWX6Fh9eWpW L6fUOoxA7f01r7U5Kl5sE2BgCGdjJKF5yw3mzQE2cVTLMi6VxHeJHnhHis5wqkHHVLmC 0LYQ== X-Forwarded-Encrypted: i=1; AFNElJ//YBFQN5kCZ/6htq28W6dHzsNl16+O0UmOCufIHRUFDepJzPvX7m/ha4EBlXAoovwL5wMZCbOUsORGLWU=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8Y7owBEZXop4TgAvjBcFZ9laCnboher1xn+Kj+gx9z58Y7JyD DaaIu/NBQzNpX++A0NxhWt1ao2vQES9hggSHn3SLV2W5owwpTvcNwbgsMtey1zG5DVAB2gmM6Lz ZrlG6MKm0fHT/kiq/9lx/Q9MtulggIa54Tmuu7esoHNCERluAM6cJJIV9RyKVPKjdBZY= X-Gm-Gg: Acq92OEJiV/lwmvwzgsPr3yAtsA7a56acmwocgJTNytpnPlnL2RQc9zJXbvtmCCyIEP PyOcK/iasw1CEaVbKuog3MxnnoGvwk3B0pOt3sTGlEaRXHv8XZTK+tabwk6eQ6IBDG5Ry0AcNbW hJz9Js0z2ansSNRx2h3JSkJPMFR1OSoal185jtAiJhZ4i23XMsUZsQHepQnDWVbrlLk5aP0ekQ3 UAGaj+IrSPOss8LC0sCyfpD89gC4ygSjVoaFmbX6nTBDjRbP6d4G3lTGBf+mn/ZJzRTcMLjPdId b9SwIqA8NyGZjFogQaHm26WDgLItt2CE5+3mXmBitTuijdz3jkNmNvK4mtPDntZ37uP5mFIiMuP VevYC6mhnp4U4gqUIpaGPzkoP4FsCIJrkUTWSYdBbjlF+RFID2h3xWCQ3 X-Received: by 2002:a05:620a:198f:b0:913:b4b9:5ec8 with SMTP id af79cd13be357-915a9db3db3mr1315257985a.6.1780908935912; Mon, 08 Jun 2026 01:55:35 -0700 (PDT) X-Received: by 2002:a05:620a:198f:b0:913:b4b9:5ec8 with SMTP id af79cd13be357-915a9db3db3mr1315255885a.6.1780908935398; Mon, 08 Jun 2026 01:55:35 -0700 (PDT) Received: from [192.168.120.170] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-68e650287d9sm6980528a12.12.2026.06.08.01.55.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jun 2026 01:55:34 -0700 (PDT) Message-ID: Date: Mon, 8 Jun 2026 10:55:32 +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 v4 2/2] interconnect: qcom: add MSM8x60 NoC driver To: Herman van Hazendonk , Georgi Djakov , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260606-submit-interconnect-msm8660-v4-0-6e1e5c5efa26@herrie.org> <20260606-submit-interconnect-msm8660-v4-2-6e1e5c5efa26@herrie.org> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20260606-submit-interconnect-msm8660-v4-2-6e1e5c5efa26@herrie.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA4MDA4MiBTYWx0ZWRfXyzQXbnB48SLk V6/UUx7M221zrnWJ9Yh+Ef8x0LHWPDqAa10nytP+OZHuX4OwOe5T/EKXsnUaBYjpxDDFcTzG0WY SoQGDRaYeJrQtXjrR//lKHX3MK7Ox4G/mVCOIKNw8iRRCCij78ReFqLrbD+4U9pWPYph9L4MH9m owMnbjo+b0MvblZfLfgSQyJzBqn6tmCG3j7SF05Rj3U1oI6Nw/HHLyJ5We4baYZ1gVEqf3gS4R3 QBkV6csFTArLW8rDr0LPehUVvn4AIp/NWbF9qOJXrFtErolNuQ6n3vGp2ubt9de2E/PVDtch7BP oKEIcUkTbD6HRcqGYYk8IC76K+awfBjm4cDqByTQFetIIgEE+A0ZmAz8HOdpRkIjT2p08zVaCtt LGrh9Je8kqqfuV6fnhq8tkYIkpGrMkMOR8qFwRWenUjotq8SiXUpdKXxjwJJ3exULFi4GA8bDQM gUz0eJUZ6XKCMzT0HQA== X-Proofpoint-ORIG-GUID: R6acxw2G0OLrMrNz5LThvJ_BuYi0HO3L X-Proofpoint-GUID: R6acxw2G0OLrMrNz5LThvJ_BuYi0HO3L X-Authority-Analysis: v=2.4 cv=TIB1jVla c=1 sm=1 tr=0 ts=6a268388 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=ClTuqyqIc_xs18_e7JIA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 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-08_02,2026-06-05_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 clxscore=1015 adultscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 suspectscore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606080082 On 6/6/26 3:00 PM, Herman van Hazendonk wrote: > Add a Qualcomm interconnect driver for the MSM8x60 family modelling the > four NoC fabrics (APPSS, System, MMSS, Daytona) that connect masters > and slaves on these Scorpion-class SoCs. The driver implements the > interconnect-provider API to manage bandwidth between specific masters > and slaves via the RPM arbitration tables. [...] I'll skip the bulk of this for now, as Dmitry asked you to drop the clock interface (and do rpm writes directly from this driver, see icc-rpm-clocks.c and smd-rpm.c) > +/* > + * Minimum fabric clock rate to prevent bus starvation. > + * > + * When no consumers request bandwidth, the rate calculation yields 0, > + * causing fabric clocks to drop to minimum. This creates bimodal > + * performance: fast when other subsystems (like display) happen to > + * request bandwidth, slow otherwise. > + * > + * 384 MHz keeps fabric fast during concurrent MDP display scanout > + * and USB gadget traffic. legacy vendor kernel docs: "AXI bus frequency needs to be > + * kept at maximum value while USB data transfers are happening." > + * 266 MHz was insufficient - USB crashed during display activity. > + */ > +#define MSM8660_FABRIC_MIN_RATE 384000000UL /* 384 MHz */ So, are there any issues if the USB controller is offline, can we go to the aforementioned 266 MHz rate then? > + > +/* > + * Maximum RPM ARB buffer size across all fabrics. > + * MM fabric is largest at 23 u32 words. > + */ > +#define MSM8660_MAX_RPM_BUF 23 > + > +/* > + * RPM fabric arbitration data format (from legacy vendor kernel msm_bus_fabric.c): > + * > + * Each u16 arb entry: bit 15 = tier (1=TIER1 high priority), bits 14-0 = BW > + * Bandwidth is in 128KB units (bytes >> 17). > + * Two u16 values are packed into each u32 RPM register word. > + * > + * Buffer layout: [bwsum pairs] [arb pairs] > + * bwsum[slave_port] = total bandwidth to that slave > + * arb[(tier-1)*nmasters + master_port] = per-master arbitration entry > + */ > +#define ARB_BWMASK 0x7FFF GENMASK(14, 0) > +#define ARB_TIERMASK 0x8000 BIT(15) [...] > +/* > + * ========================================================================= Let's drop the =s [...] > +/* > + * Pack bwsum[] and arb[] arrays into the u32 RPM buffer. > + * > + * Two u16 values are packed per u32 word: lower 16 bits first, upper 16 next. > + * Layout: [bwsum pairs] then [arb pairs], handling odd boundaries. > + * > + * This matches the legacy vendor kernel msm_bus_fabric_rpm_commit() packing algorithm. > + */ > +static void msm8660_pack_rpm_data(const u16 *bwsum, int nslaves, > + const u16 *arb, int arb_size, > + u32 *buf) > +{ > + int i, index = 0; > + > + /* Pack bwsum pairs */ > + for (i = 0; i + 1 < nslaves; i += 2) { > + buf[index] = ((u32)bwsum[i + 1] << 16) | bwsum[i]; > + index++; > + } FIELD_PREP(GENMASK(31, 16), bwmon[i + 1])) | FIELD_PREP(GENMASK(15, 0), bwsum[i]); > + > + /* > + * Handle boundary between bwsum and arb for odd nslaves. When the > + * fabric has no master ports (arb_size == 0) the arb[0] access would > + * read out of bounds; pad the lone bwsum into the low half of the > + * word instead. > + */ > + if (nslaves & 1) { & BIT (0) > + if (arb_size > 0) { > + buf[index] = ((u32)arb[0] << 16) | bwsum[i]; > + i = 1; > + } else { > + buf[index] = bwsum[i]; > + i = 0; > + } similarly as above [...] > +static int msm8660_get_bw(struct icc_node *node, u32 *avg, u32 *peak) > +{ > + *avg = 0; > + *peak = 0; > + return 0; > +} I think we can drop this Konrad