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 F04B43DAAB4 for ; Thu, 6 Aug 2026 06:45:49 +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=1785998751; cv=none; b=pSaPxXiXRdjG3FhZeROfA5/rM5vLsR1BBOZgZ6YyMqxrBuvZaa6qkXKGh0g91DQdl4R2EfMEPDECMG1FDPZwk3r8FEdwd6ArK/P2oFPuNMaAGuJK/kuZgypETvtcVstfg6PsM9hPFL0VUkJLbK/Yd05m6V2qgZdyRQkFVsYGHNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785998751; c=relaxed/simple; bh=TNdqO7brRwaEyGj/qSF80gr/Z52pRjnjirsZi2hKnAs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Pz9sOPqdTL/3kvSprl0OiNgZzk1nAUpjy/U2Zixc5JerXNu+ewRyVUXhUFwPafiN/tg/9bpTCq09s7ci2Z9r8dqlZjSguZAMsuINZvlBnRclPAIT2TT6kI99ioUF1GcdvRyouZVzhI2BRcoTIZM6eWentjzt7awGV98awQaPGrQ= 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=YhTQWEca; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=fx3OkhEQ; 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="YhTQWEca"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="fx3OkhEQ" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6763wjbE1070736 for ; Thu, 6 Aug 2026 06:45:48 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= BMl+CwunyU4TULlNX31iYhZaOG7oZ8f+KS+sqBYQ9gI=; b=YhTQWEca77txrB95 cCDZaCHwBHhOIETmkUmwnvqzd41W4szpoyGfKxv7NonUf2yMk6vs4VKeFJMPh8NG eaOHs4Ad5TqC3odGsEEZYpB98+G1/ISKtLI1f4k9gWiFDagot1cnuxI44FtmI6KV TWcHTVcudyjrq9H2geNscVhG1L2oej9CCInPA+URGCTrNuE3naB9ANT+UFQZFCiE k2w9TErmzf4PxbAuHyqt6TSm8MSrhMJl2HHnwSFEQK4697mKGfE7IAUbGurc2CZj o0OrUcdSvCnYukGUYuBK4uiG6vTtnGwyheOsQOnJ6AVXkek3cqgD3QfFDQSrRk9M 7UwcmQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fvjucgkhr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 06 Aug 2026 06:45:48 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2cee894b3d8so29187765ad.2 for ; Wed, 05 Aug 2026 23:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785998747; x=1786603547; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=BMl+CwunyU4TULlNX31iYhZaOG7oZ8f+KS+sqBYQ9gI=; b=fx3OkhEQZfLHUsUxsRSUS+cfM8/NdiX/htDLJV9d0Ge0/st6Ih54bcsTszJwFSQjSl XdGMevbZhIQyyT/D5iBF18Tyi+MgWc+f6/ZQ38Ju/z3YUvrbdD8A7nsQ2F4GSwnaKCEF 4oz5eALpsFiWRJTBewQ4QOMWUQvbNhGmtAe2wEMvlH4yXgLK/t6S04COoOzAj0559eQb K34SPE7sOCINTCfxQJb6dU3Bb5uvHMpLfUUCJKe4OcHLKYmqd1FsJg5FL3pa85t1bKXg ETyW2vbpTufXO47glAlHib37FpzUCeovsWapKG26HLoRva+Merzyxxb2oWthz5wEUXDz pKgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785998747; x=1786603547; h=content-transfer-encoding:content-type: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:content-type; bh=BMl+CwunyU4TULlNX31iYhZaOG7oZ8f+KS+sqBYQ9gI=; b=dUtQe/6j5NOSLYlRViFBaIhC/B3jeZda5zPCUUFxzQwDyRhb8k4IAipzpuFcbPjsL4 s/OE9SJNieXlNd5SW1JXxA92fcTQCUZT/BsSMfaeu5XBiqJ8Nbqw0xC/HYmLr/Ad/Z92 +d+VS+bnU1eTqpX+UsaPOrWvzPRjFCaniXO1H85cw6Ivi3MA8/6MR+/pms/FQYoOfIHl 96Uv/cJyqn6OQsWn7C1KMfVFhdA9wuOICc5q02xt0PWTM4Ff8B5zwUT7ykAEVHHUzdgg YDpNs7muZqoSD3ZNcqC18AUYef1u0Ro1goCIu6recIc9Beig5WYiScfWpiTvM5PVmJ+M DJRA== X-Forwarded-Encrypted: i=1; AHgh+RoHIEyNvm/4IYOfx7OjV35qf8mSnQZ9Lgd5D79H4g7l0pBZG6+QFIm4Vw2S6ndkbnnrZrwUqe8HA9kEjnM=@vger.kernel.org X-Gm-Message-State: AOJu0YyB6jTmj6WAsnnPqN/+HhruV0TUv4blFgMslWG7ImoXZxyT9gbm YmLoneTVYWCDbFdGuOVfN3ATat8oO6BCZkhmYlzloiqGMnFUsw5e1S0vfetrXnUxFrP8o9J36y3 tuFv854CLGOtfjSjlNySRSUf+vgDbzhqkvo4gqjf3CJdJZJBcR4Rq/+xc0m4hS3TeFvU= X-Gm-Gg: AR+sD119xkSkOBoKKFrSJmUoKUWOYiHckv8XzpDT9DvVa1Yejf/SyvLwAD+CmGW9vhT 17npvx7qO7SnF0MTrTZKeUDpLVxT8409Dtq8lVmAiJYf1WJNuKBZUCSoXAEPf0NeCUi1x/+HJ+z ssQofeRKzKR7nJuh1JeWuC7eQAXCBifHRODXRH4Iy+SZnkx34KDfH8FykCQUCGpoXTWqoS+dFJk KetkuZWlp4Rk2yjEaIggX7bjJ7VcdlWt+RtBhUubqO39/xFu+8GjEbe9UB9wMUuW7Im/Ikw2HWE N2qjmkQRz6oOJTmHnanOEu9mkg+H9KeK1qMFPIV6sWzcJEKP7oXdgPR25mmhEF/QRJfRlTgnCFL xfnQh8hyD6JRfE1e+/FiyMEd5wpaMwWYxFg== X-Received: by 2002:a17:903:388b:b0:2cc:76fd:6537 with SMTP id d9443c01a7336-2d0ca7aebd5mr146961735ad.2.1785998747485; Wed, 05 Aug 2026 23:45:47 -0700 (PDT) X-Received: by 2002:a17:903:388b:b0:2cc:76fd:6537 with SMTP id d9443c01a7336-2d0ca7aebd5mr146961435ad.2.1785998747094; Wed, 05 Aug 2026 23:45:47 -0700 (PDT) Received: from [10.217.198.68] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d0aa4d9b86sm26109775ad.76.2026.08.05.23.45.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Aug 2026 23:45:46 -0700 (PDT) Message-ID: <1e032c84-cee8-45ef-9cf3-7654de85778a@oss.qualcomm.com> Date: Thu, 6 Aug 2026 12:15:43 +0530 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/3] soc: qcom: cmd-db: add reverse address-to-name lookup To: Maulik Shah , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260717-rpmh-timeout-debug-v1-v2-0-81ade4fcdb49@oss.qualcomm.com> <20260717-rpmh-timeout-debug-v1-v2-2-81ade4fcdb49@oss.qualcomm.com> Content-Language: en-US From: Navya Malempati In-Reply-To: <20260717-rpmh-timeout-debug-v1-v2-2-81ade4fcdb49@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYwODA2MDA1MCBTYWx0ZWRfXy9BUfUEEXVfv YjACMYpM2c5EqrQ0qL6mv8wuoLYWdY9fdD9ih+tR7wHknVnvBa9rrTxzAgLaWaNpxIB2M3HFIP2 u+tAvxCh72wwAOPLOZzmIJsZK5m5cdI= X-Proofpoint-GUID: p6X5FEi-ENi3UiuNYOn6Sr45jLzXwcc8 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODA2MDA1MCBTYWx0ZWRfX5PhEAR39+xHe m6gFgxzHzIgfBBgHzCaZSD6P0Kn7KJUpHlO0C4LRaPZ2ltZVuF+1y77vVTdhw/i55Y0B7AGuCxD wCSnSOduNNqbZMfTRMluF9YAUwyqdkAAlPtiSMewqeGqBlftZqPOztX10pH6gWHTBjupiH30dDH 6do1ew59QeBPx4xhdhjUUJJGLUDU+IMzDJyKvz/kHXsp9gszaPNsW1QDI4q+cBwSF166UBRMf+g EEpEoOb0va/btgCZp0IoAZX2VPqnmZVS8bP2NwcmeRqOCN3DYwcTW5YLcd1MWnB+iUBYsWgtVcS n3bpz3EThTWVYV+w27PRNgBf1AMPihwJtwv4XoLZ/bXaOPlqlBL1uL7gjhqo/MRF03yqok5tpal H3KLiHmOi8sGUIYPwYUrbJgWipEo9Bfnnb9faxwNjSNfBWk7ahg7yHPXgAfcZamEKJpChiWeMCf R/RQBk3CkBxNfBE+D1g== X-Authority-Analysis: v=2.4 cv=Mo1iLWae c=1 sm=1 tr=0 ts=6a742d9c cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=mXvhL1AVVtzIk_KeqgUA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: p6X5FEi-ENi3UiuNYOn6Sr45jLzXwcc8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-05_06,2026-08-05_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 adultscore=0 malwarescore=0 bulkscore=0 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608060050 On 7/17/2026 1:19 PM, Maulik Shah wrote: > RPMh resource addresses are opaque 32-bit values. While the slave ID > in bits [19:16] identifies the accelerator type (ARC/VRM/BCM), the > lower bits encode a resource index that is only meaningful when mapped > back to the human-readable resource name stored in the command DB > (e.g. 0x30000 -> cx.lvl). > > Add cmd_db_read_name() to perform this reverse lookup by iterating > the command DB entries and matching on address. Unlike other exported > cmd-db APIs which go through cmd_db_get_header() (which calls > cmd_db_ready() internally), this function iterates cmd_db_header > directly for address matching, so it calls cmd_db_ready() itself. > > For VRM resources, > which have up to 4 contiguous 4-byte-aligned addresses per resource, > the match uses VRM_ADDR() on bits [19:4] so that any sub-address > (enable, voltage, mode, headroom) resolves to the same resource name. > > Also export CMD_DB_ID_SIZE so callers can size their name buffers > correctly without open-coding the magic constant 8. > > Assisted-by: Claude:claude-sonnet-4-5 > Signed-off-by: Maulik Shah Reviewed-by: Navya Malempati Thanks, Navya