Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1816456lqb; Sun, 26 May 2024 20:11:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTJuNO7acvls4Tek+NV8kgDtyK1nCsqU9Rg9RquqYbcRmXA5SYMYjJjaLltFnPI6aN3tzQ7lCZzuaFt8f8uz0NlDjtR873Z/JqhUHI0Q== X-Google-Smtp-Source: AGHT+IE8pgnVE4ikpzMvneAllFCZDhr1tVZ62WLvsY4NeeMAIvjJD10sjtlvpuFd8f++AbxoDfhh X-Received: by 2002:a17:903:230a:b0:1f3:35ff:ad25 with SMTP id d9443c01a7336-1f449900e24mr121645785ad.63.1716779516488; Sun, 26 May 2024 20:11:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716779516; cv=pass; d=google.com; s=arc-20160816; b=TZDZhevVa7+lvy4kiBOh3Afe7cUFfqOx/Cwm/9avSHj9igzr+nWIFwkSRJLAlDM0Cw QQ/qHy/f+nuKIMzqYkIjO8BVzLHgOSuplaZkFZnGM5c+gdOwmtcMooVRWbNfRlZ4f5eF FZWvoQnU6gbkUpSzCH3kWl/oRkGLxHysiK0PjKBKp/KBeXFft8NXsA10oh4KrGON+VKk HpUJv+qjtvVaTpWezVJN1N4UAdzwMIfcKzWXSe5YbRhEfWZpndWxRYLXRQ+sVBVjhPxQ 9y8DP8zIYpFRDv41ysdnsV8p4qiAZrNzhgkuUIyoA+kiS+p1qG6oXaj2ZupnhQULEZ55 8OOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=25OZ5jEX6YvmsLSDpuMrswSucG2fnPwzCVR9yrBYyFU=; fh=ziaV1oLfR/Q8RZa4+fwhAVc9QAzTxV8WZTlx5d2VngY=; b=fuAJkpNNH08q4yrI2JKTpWAzzRWiHrC5CT9x4gca47p22V3J7mWkvZtAFAuwy5tPuq dMVCqwLvdS2jfkyiHQq67fM3/rhmx9apMZQ5HGl7tK7LwqfIr3Hs2sHkbDcFoQgk3TNR DWuDabL03nP9uu5zrQ7tgImaulGJ9/4c35eOxcpa6HLQRp7MKpB9CDyQn4BQCHenxw73 zLoRAVLxPVCH8WDoKBsLAt9Ki0hP7uIMqeheUETNG0gYvqY/qLwe2S/0Hkym3OhqASHD deSWF6CJIpBOCuXiUzvhccXdakVF3Mqsd1VWaxl5GgNXBO3SHe1mw0wT+4Egb9jto0i3 TADA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X2aK+GHx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189981-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f46fae66bcsi30662855ad.521.2024.05.26.20.11.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 20:11:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189981-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X2aK+GHx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-189981-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 21B57280C19 for ; Mon, 27 May 2024 03:11:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 94E4D7464; Mon, 27 May 2024 03:11:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X2aK+GHx" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B5307DDA5; Mon, 27 May 2024 03:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716779507; cv=none; b=QtLEwqfbkXohVf2lzzI9s7LOqYE/hIpK3Rd4eT3dZ+8wC+jgXYf0FKk4KAHPH1s+Ht3gAYyP/RhRE9MWWjULdUSQWFEU+FVjDbAqjwma2Zfho/MLM1CSEyN6+gmuVTs20TymVkA8SzBTjgo2UZ4jKnXGWbxjap455GZMiFPqRzg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716779507; c=relaxed/simple; bh=MRV95ptO8M8/LH3xJMcdozG2tVt7MtaRVLIZ99obl+s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZKm30GAcitz04H+VXPa2BDymVxmGxIi4Cd7Dx+Z7oYoVXfirmH2vQFtCUjgLhybQtE6xm70q1o0iypbRUJTN4SfMGGel6z+de0mqo7z0JGQabskRX7uPBJj10CqrJ/E8HXifsNRxRPmscFSI2iv7Dqc9WjpODh+yyqotV3vwYzU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X2aK+GHx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DCF8C2BD10; Mon, 27 May 2024 03:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716779507; bh=MRV95ptO8M8/LH3xJMcdozG2tVt7MtaRVLIZ99obl+s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X2aK+GHx2No830rQwQ9WBmzzlYbvWzJy9R3e5c/Ybb6vpwAQ6WmWfQjJjxzdlm1xj 1hqe2CFWLcIP4jgYxSpkIPgjGEx3rdP2YFyRM0geHEMi+KGK2xUA+AjRWYLICHNgyB h5hIXwVek1uEmfoJeYTDhWSi9dR+WhaddDSL6sCRL46G3uwJ9d+C+ZZMWdUEn6AeR3 OliQnhZNkg3O5OQfOn0X6qmaCxOj1ZLjFyUNv1cYLacimreEviviavzIbXkRd0tw89 ikLHBVSuWEJjF3/288YG7UMujOGVB4M+Cq+NK1kM00V4msfFEc3b/+Y6qErHFNplgH 6G4MMyyYOnBVA== Date: Sun, 26 May 2024 22:11:44 -0500 From: Bjorn Andersson To: Unnathi Chalicheemala Cc: Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@quicinc.com, Bjorn Andersson Subject: Re: [PATCH v5 2/5] soc: qcom: llcc: Add regmap for Broadcast_AND region Message-ID: References: <2c7654492ee436b41acddf2edc65d6722c3ad6aa.1716228054.git.quic_uchalich@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c7654492ee436b41acddf2edc65d6722c3ad6aa.1716228054.git.quic_uchalich@quicinc.com> On Mon, May 20, 2024 at 02:00:14PM GMT, Unnathi Chalicheemala wrote: > Define new regmap structure for Broadcast_AND region and initialize > this regmap when HW block version is greater than 4.1, otherwise > initialize as a NULL pointer for backwards compatibility. > > Switch from broadcast_OR to broadcast_AND region (when defined in DT) > for checking status bit 1 as Broadcast_OR region checks only for bit 0. > This is a good technical description of the change you're making. But it's been long enough since we discussed this that I've forgotten which problem it solves, and the commit message doesn't tell me. Please add a paragraph on the top describing the actual problem this solves? Regards, Bjorn > Signed-off-by: Unnathi Chalicheemala > Reviewed-by: Bjorn Andersson > --- > drivers/soc/qcom/llcc-qcom.c | 16 +++++++++++++++- > include/linux/soc/qcom/llcc-qcom.h | 4 +++- > 2 files changed, 18 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c > index cbef0dea1d5d..5eac6aa567e7 100644 > --- a/drivers/soc/qcom/llcc-qcom.c > +++ b/drivers/soc/qcom/llcc-qcom.c > @@ -821,6 +821,7 @@ EXPORT_SYMBOL_GPL(llcc_slice_putd); > static int llcc_update_act_ctrl(u32 sid, > u32 act_ctrl_reg_val, u32 status) > { > + struct regmap *regmap; > u32 act_ctrl_reg; > u32 act_clear_reg; > u32 status_reg; > @@ -849,7 +850,8 @@ static int llcc_update_act_ctrl(u32 sid, > return ret; > > if (drv_data->version >= LLCC_VERSION_4_1_0_0) { > - ret = regmap_read_poll_timeout(drv_data->bcast_regmap, status_reg, > + regmap = drv_data->bcast_and_regmap ?: drv_data->bcast_regmap; > + ret = regmap_read_poll_timeout(regmap, status_reg, > slice_status, (slice_status & ACT_COMPLETE), > 0, LLCC_STATUS_READ_DELAY); > if (ret) > @@ -1284,6 +1286,18 @@ static int qcom_llcc_probe(struct platform_device *pdev) > > drv_data->version = version; > > + /* Applicable only when drv_data->version >= 4.1 */ > + if (drv_data->version >= LLCC_VERSION_4_1_0_0) { > + drv_data->bcast_and_regmap = qcom_llcc_init_mmio(pdev, i + 1, "llcc_broadcast_and_base"); > + if (IS_ERR(drv_data->bcast_and_regmap)) { > + ret = PTR_ERR(drv_data->bcast_and_regmap); > + if (ret == -EINVAL) > + drv_data->bcast_and_regmap = NULL; > + else > + goto err; > + } > + } > + > llcc_cfg = cfg->sct_data; > sz = cfg->size; > > diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h > index 1a886666bbb6..9e9f528b1370 100644 > --- a/include/linux/soc/qcom/llcc-qcom.h > +++ b/include/linux/soc/qcom/llcc-qcom.h > @@ -115,7 +115,8 @@ struct llcc_edac_reg_offset { > /** > * struct llcc_drv_data - Data associated with the llcc driver > * @regmaps: regmaps associated with the llcc device > - * @bcast_regmap: regmap associated with llcc broadcast offset > + * @bcast_regmap: regmap associated with llcc broadcast OR offset > + * @bcast_and_regmap: regmap associated with llcc broadcast AND offset > * @cfg: pointer to the data structure for slice configuration > * @edac_reg_offset: Offset of the LLCC EDAC registers > * @lock: mutex associated with each slice > @@ -129,6 +130,7 @@ struct llcc_edac_reg_offset { > struct llcc_drv_data { > struct regmap **regmaps; > struct regmap *bcast_regmap; > + struct regmap *bcast_and_regmap; > const struct llcc_slice_config *cfg; > const struct llcc_edac_reg_offset *edac_reg_offset; > struct mutex lock; > -- > 2.34.1 >