Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp287801lqr; Wed, 5 Jun 2024 06:16:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqvHaX2259VFn0Jo+9yjZdBm4++Em3hUbpsmdl4o/kz7UA2B02cRnne9c6NwIu1s4D2aa8hU+Efk1Ijs9Mk5/3eAuEMbVQMC6SFI3+aw== X-Google-Smtp-Source: AGHT+IFsitKSR8erCrMMxSFxxzp0Ia3mUk9Ctc7pez9LtPHkstlmMUVLKF5cyiZWpVGH+kymBZj+ X-Received: by 2002:a2e:8081:0:b0:2e9:87f8:7fd7 with SMTP id 38308e7fff4ca-2eac7a801a3mr17499791fa.45.1717593385498; Wed, 05 Jun 2024 06:16:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717593385; cv=pass; d=google.com; s=arc-20160816; b=OTDmx5alyOCIwmckwxvrkIZn5biDJ4Rnapl8rfr2VPtNgUNDj9y0p7g6flP5Xon1rP hKli26pXQk4APibC8X+cXfheR3ld66HMiCL3G17j5Q4ibC5Jp6Cww7wEudTxfovJiDBO sbBDA+q9M/t0jFmWfBTX1T0kghjzjntEmqF6snFry97QY+ryWXr4ilm1zgmzuLhKwCJp xjvj1KF9BQkAnABZN6GY8DnugX2nfMorUfMzWZpSFvhXarqBQLB8DMt1fZT60xPq4CR+ AVPz1BeJQdG6ONZ3dE1k8ElYrhNls716zDWB3tFdzTpSX5yfKZoGfuRbU5KQLlSXRsj/ ljFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=DuY6+z/GjfVcOE7IsQ8NQZT/GIAy/7LX4dlzaJULjg4=; fh=lyLSCFSK6l9RW63ZDfr8yvsE4SO7J1cWsNA4C19DeNI=; b=WbCiPxuQoEw4hScg5acFhVx8Aggo2frO+zwcMVMn+J/l6sEhCaTTcVzBE2zAhWugUf y6ppNGmXNlyYJzo4KqhZ5cM2DZbjZ1amYH6f+xJOAcjz5fLnihUkIl1ZDwIibl8KRaW7 Ote4y+ndWU40zKT4RHc2g8htt/0z+e3eoon0OGLm6E9rwIuXw5rCyex7rQ8w+NKqr/4P fa/LTEBBBA7Y/lgFIc7sWoYB+E2FDS0FpXVqXAO9FpL2W05GfXgcpeRZL042/gRH1fDP H3IxNkn0u53Fcy5jE5dwf6DOBoeqUwqeeNOXshebxLVoopr4rt31w9IAQ8Z7lusWQ2wP vjgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Oww4fB9F; 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-202578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202578-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68f79f5b46si341023366b.842.2024.06.05.06.16.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 06:16:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Oww4fB9F; 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-202578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202578-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 732691F2BC98 for ; Wed, 5 Jun 2024 13:03:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA35F1991C9; Wed, 5 Jun 2024 12:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Oww4fB9F" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 B08391B3F0B; Wed, 5 Jun 2024 12:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717589922; cv=none; b=Ed565RJTfbsKOQ/UQr9h4K0Mfc9OOyndxJv66p6A5x4+yEtsbNEbafRnDTwzeQPKd/WJyUp0O03076C67ZPV67rjFAKoxGMJ4J26VuKXMqp3S86DN/5Ip3tEYZoOmb8RUGkzZNqv8KudtX4HqNnEi5MSAWNAPDFbLTHstcys7K4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717589922; c=relaxed/simple; bh=JTXd0owb3+tQ8/8FrxwGwly9Ho7GLFtoj9k3Ublt/xc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UzNmCYMD2hGfWfIzsym2QP1UPedIdtJ7y7z/EUVd/UtSQ0qe4HRMcDdh9poNbAwRb85Qjs6vGr76EZY1Y22GqtyRNkDJ+OJSFRPVB1g1DAnK5rRG+FPliCXgRU2Ljqb/W6T/m+ccw7wjPGKE+GqD1E7faqA3E32hmscY2c3YtaA= 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=Oww4fB9F; arc=none smtp.client-ip=205.220.168.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 (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 455B1YwB031013; Wed, 5 Jun 2024 12:18:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= DuY6+z/GjfVcOE7IsQ8NQZT/GIAy/7LX4dlzaJULjg4=; b=Oww4fB9FuAy6bGm8 mCYnFjHtZ02yc6qCA178ET5vagqDYPhceX+f/5GM93Y1YVn+BoVYqxX6ER9LGBjP fyHWGxI02mVp3uFg4Wwb4Vy9M4OtLDkI8pKar8WgFnJ7Y5r6UsvlNl8DV51LM8eu 2O+ElitLIpnWd7EX/tC3bOiBZVYcOGC05dzp7F059dPNF6croqT+jopeR6BpmDmy jH68yjbOAt9Ry3h26aSpIxYFESMecQup1PdIt+nckziM9BCw2V0U2N8D47QXN/H1 i1DDxv3X2MPKMJ7GleTefU4a3499wiFi005LyQ6S72y+r+S6OHGgW9shQVRMQwoI ceD6qA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yj87rhxu6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 12:18:26 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 455CIPIL024658 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 5 Jun 2024 12:18:25 GMT Received: from hu-bibekkum-hyd.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 5 Jun 2024 05:18:20 -0700 From: Bibek Kumar Patro To: , , , , , , , , , , CC: , , , , "Bibek Kumar Patro" Subject: [PATCH v11 2/6] iommu/arm-smmu: refactor qcom_smmu structure to include single pointer Date: Wed, 5 Jun 2024 17:47:09 +0530 Message-ID: <20240605121713.3596499-3-quic_bibekkum@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605121713.3596499-1-quic_bibekkum@quicinc.com> References: <20240605121713.3596499-1-quic_bibekkum@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 3_sErrluGDSNoFurkcZC3W6sNrczqE-g X-Proofpoint-ORIG-GUID: 3_sErrluGDSNoFurkcZC3W6sNrczqE-g X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 phishscore=0 impostorscore=0 malwarescore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406050093 qcom_smmu_match_data is static and constant so refactor qcom_smmu to store single pointer to qcom_smmu_match_data instead of replicating multiple child members of the same and handle the further dereferences in the places that want them. Suggested-by: Robin Murphy Reviewed-by: Dmitry Baryshkov Signed-off-by: Bibek Kumar Patro --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c index 552199cbd9e2..885af324916b 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c @@ -73,7 +73,7 @@ void qcom_smmu_tlb_sync_debug(struct arm_smmu_device *smmu) if (__ratelimit(&rs)) { dev_err(smmu->dev, "TLB sync timed out -- SMMU may be deadlocked\n"); - cfg = qsmmu->cfg; + cfg = qsmmu->data->cfg; if (!cfg) return; diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c index 76db4c8d1a9b..573c4c9886f1 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -506,7 +506,7 @@ static struct arm_smmu_device *qcom_smmu_create(struct arm_smmu_device *smmu, return ERR_PTR(-ENOMEM); qsmmu->smmu.impl = impl; - qsmmu->cfg = data->cfg; + qsmmu->data = data; return &qsmmu->smmu; } diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h index 9bb3ae7d62da..addc07623c0b 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h @@ -8,7 +8,7 @@ struct qcom_smmu { struct arm_smmu_device smmu; - const struct qcom_smmu_config *cfg; + const struct qcom_smmu_match_data *data; bool bypass_quirk; u8 bypass_cbndx; u32 stall_enabled; -- 2.34.1