Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp208670rdb; Sun, 28 Jan 2024 22:21:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyj6MvbsgC2AuNv5hUc7K7Xf8ifbhPHvNbOquHKC/c/24jTp/xTU0wCfTTcQGteQDRQfls X-Received: by 2002:a17:906:7154:b0:a35:e388:cae2 with SMTP id z20-20020a170906715400b00a35e388cae2mr219872ejj.10.1706509296410; Sun, 28 Jan 2024 22:21:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706509296; cv=pass; d=google.com; s=arc-20160816; b=rtn+WA4xpUujUIXsO9A4YWzUse3+nlkHr2dkAutaPUsULfgMi9c0EGr5JpvWLILbOf TUtvPdD5OTXYpT35cPqPH8J0N/hTkbexH9M8avBWtl6d3UY3urIxwbNChFR3bRPGWxIo 0jrCDtMIQQNYT4pZ7moIAz0RqeYW+9yGR1i0uC2D4z0KN3G7ihBYxOTI6sB8sgaong1S thFmZliJilE6Pl/yhEsr66tYosllO+KFmZwdlMDSjIrfOwd3twZ028r1LoRwWIb26/57 nEhrMhREaMBvD1rkv7ZS/qO95sGxnNSngOQbDP6TUKR5dDMmNuwPW6eP7hHXTpDVTei4 voEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tuVzaSE0q/q50xp0AxYrUAe66nQO9Sqbqhz7iRe9JuA=; fh=KIcR//LwdayifiacyQDhil1Mtpo56Wo16QAUsn9/bIg=; b=C/E9iKBD4O9OtWLWgkQoXq/BkZAUHL7ezKCanJQSwRLWm3M0TbZn17Pc3qNs4BePrj wclzAQLQ9tEElYkFOuX3l/xyOZudlDmP+lTwyMIVO8YzplHXSuq0NzfP0tmkmB8s0V2E J3HKlHipCti8E9L9xo01ZphEuEy6dnRnZbK8iSpOD0o77b7dIG9aHBczNcM9ZYEyqkkV 1BsVpXR4on2DuG/HP1sgrlO0Yo4HAYhse2jk8HxeQEnCF2QOIxChWfgkIS4PA4y87Abd 8YXI6Nd+vOM6/te9SzzggDOh6oYscW8Az7QPy83EjI/QG/b/oARNN2NeJwLVTCWoJlhN j7qg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZHvgzaJA; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-42222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lt1-20020a170906fa8100b00a354b4411a5si2043253ejb.219.2024.01.28.22.21.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 22:21:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZHvgzaJA; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-42222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 450621F21F76 for ; Mon, 29 Jan 2024 06:21:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F0304CE1C; Mon, 29 Jan 2024 06:20:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZHvgzaJA" 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 1B1144CDE7; Mon, 29 Jan 2024 06:20:50 +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=1706509253; cv=none; b=WVowOWrMOXSnPQREM0U1ofkjYtOMgPeb7LLn49d1I/uVLcBBTManHcEgOoWtSnh1wII/vkI2SsFnWV2vfvxNiPrDadFc0VuGdWiUt7OUdB7LEjBxftoY/rBY4iFneQ3VgspHIMyFHbFuNOx3TNCqOi10Tgh0uor1J9mb/JHPH7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706509253; c=relaxed/simple; bh=qw/DP9PETNrIhcO6gljeKYbbK08PVRuQsY8yGpNxvlc=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Cz7x0TTVi28m6SaZm2lPbEMGeVUROHHWmyPXFbDnv1x2Nl7ZSynuz2ngpKXRpS7/bVruwWWsBePV7KRA2E5hqZRH95vfgDO4I9PPzwF9MclnT2SsDhz59pOa2wyZqlKe7Y/yXDxAIm8pXC2f8Ulra3+M1onjB7bVA3ywolvXDXI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=ZHvgzaJA; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40T4ro2U007142; Mon, 29 Jan 2024 06:20:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=tuVzaSE0q/q50xp0AxYrUAe66nQO9Sqbqhz7iRe9JuA=; b=ZH vgzaJAq+sQ+MYdIFTbYYRb4b+abxB49TmqTfxGkjWdLAn3hUa9vEAbCNt8UyJHyT LwykJTTiDYkXe56ykMHKsDQJAjUfdZGXtq0/XjIKF+4vOBOw87OoADePlxNjp3/x VlZDbf5Bkxo24GXPm3sYP65stBEl1hG4T8MwT+v8vowLJ2oa7OpiEM1BUqbB3VqU yVNb3SYTa9GiwAOADk3FqS+pzNVnNlvV3yV7g0tklSm3EMqksopLm+wbZcbZrL1Q +goyg1lzRpnCuFIuz7/Th/W6Y/qyYLlAgNljohYRDCtYsYV64OfJYC3jmHByoafE 9wI1lXZDaIjNo6q20Nnw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vvrubaxua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 06:20:46 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40T6KjXm030220 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jan 2024 06:20:45 GMT Received: from [10.217.198.224] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sun, 28 Jan 2024 22:20:43 -0800 Message-ID: <589dddd8-0ed2-4138-a617-402aa28c79da@quicinc.com> Date: Mon, 29 Jan 2024 11:50:40 +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] soc: qcom: rpmh-rsc: Enhance check for VREG in-flight request To: Bjorn Andersson CC: Konrad Dybcio , , , , , References: <20240119-rpmh-rsc-fixes-v2-1-e42c0a9e36f0@quicinc.com> Content-Language: en-US From: "Maulik Shah (mkshah)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 1XsAPNs6ynOh5yrHSKpwwnuGQNC831UY X-Proofpoint-GUID: 1XsAPNs6ynOh5yrHSKpwwnuGQNC831UY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-29_02,2024-01-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 adultscore=0 suspectscore=0 impostorscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2401290044 Hi, On 1/28/2024 9:13 AM, Bjorn Andersson wrote: > On Fri, Jan 19, 2024 at 01:56:54PM +0530, Maulik Shah wrote: >> >> Signed-off-by: Maulik Shah >> Signed-off-by: Elliot Berman > > The s-o-b chain doesn't look right. I will fix in v3. > >> --- >> >> +#define ACCL_TYPE(addr) FIELD_GET(GENMASK(19, 16), addr) > > Command DB is there so we don't have to make assumptions about the > addresses of resources. As such, I dislike this define. sure i will consider querying command db for resource type. > >> +#define VREG_ADDR(addr) FIELD_GET(GENMASK(19, 4), addr) >> + >> +enum { >> + HW_ACCL_CLK = 0x3, >> + HW_ACCL_VREG, >> + HW_ACCL_BUS, > > We already define these in the kernel, but with different names: > CMD_DB_HW_ARC, CMD_DB_HW_VRM, CMD_DB_HW_BCM. I see no reason to use > different names for the same thing. > >> +}; Right, I missed it, With querying cmd-db would not need this enum. >> + >> /* >> * Here's a high level overview of how all the registers in RPMH work >> * together: >> @@ -557,7 +568,15 @@ static int check_for_req_inflight(struct rsc_drv *drv, struct tcs_group *tcs, >> for_each_set_bit(j, &curr_enabled, MAX_CMDS_PER_TCS) { >> addr = read_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_ADDR], i, j); >> for (k = 0; k < msg->num_cmds; k++) { >> - if (addr == msg->cmds[k].addr) >> + /* >> + * Each RPMh VREG accelerator resource has 3 or 4 contiguous 4-byte >> + * aligned addresses associated with it. Ignore the offset to check >> + * for in-flight VREG requests. >> + */ >> + if (ACCL_TYPE(msg->cmds[k].addr) == HW_ACCL_VREG && >> + VREG_ADDR(msg->cmds[k].addr) == VREG_ADDR(addr)) > > I'm sure this work, at least for some targets, but I don't fancy > encoding this information here. It feels like a hack. > > Furthermore, I really would like TP_printk() of trace_rpmh_send_msg() to > be able to resolve the symbolic names for VRMs as well, and it would > need the same information... I can update in separate patch for trace_() to resolve symbolic names. > > Please consider how we can query command db for the type and/or grouping > information. Sure, i will update in v3 to query command db for the type. Thanks, Maulik