From nobody Sun Feb 8 09:12:57 2026 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11010056.outbound.protection.outlook.com [40.93.198.56]) (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 36CD2221FBA; Fri, 14 Nov 2025 00:27:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.198.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080028; cv=fail; b=ezbhUsCJjw56qg+AvD+aQSLkzVnBNF14yxN8Jns7+838qbi0+PQfJuvUb/r8ILU8xAmWwNMnlUDCdKS6XJo5UukehwMj6mOA6K32KFbeFy2UGNoi7c0QanQ2fCQyEQpMCdap51CNOeCbEiLi21LZ1j4TUHeynohPL15IAJJkb0g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080028; c=relaxed/simple; bh=9jkOMIC5tcU/+RJ5phcQSBNg9F9lhE1q4X+PxjWRVSo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fTs4rms+7lNwDztnAck+XKRwar4DoKnunKLjYA/GXlrNJ0MePVERd5fPe7GCze/ZXSYPsMZHT91NFuQgXKgg1D8NWPgp0OeMns014uKpgW5haB7rl2Q1OpTELLXvnW9p+yXaLgyN3j7oI4K0E5dfaAifUns7DKhJfR6dQY5yf8E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=kuOLPM29; arc=fail smtp.client-ip=40.93.198.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="kuOLPM29" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tXdQM+hMU7YPJgP1GTvUXAmSpuUF0SCefHqWjqHg7ADM1yWVTWHqAeSDr3XE8vreGDa5A9w+y7jnkSGgrU31XMLTHxPJbdonVAvBatjZLzUWgD7JOcTeOrjJXMimaVhvq/DAXm1KBDKOFw+94GNeDPbKPOdcSwTaMk6BRU0PjFjhfy7Tn0mG1COG8k6Bv7n8+C6llD9RKcrByidRL7wSOCbOWRDViKrJaq+gkOTRPlU97xmn7VaJwvj1bXNOEEZHXAdJvXCMhuVOhdiYVa4RVgwmGcjMVoSCdu+WeLIiKDU4Yr63FDzGl9uHzFXxBbMF3q4FmpLrhm4y2FO6zEAY+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JnT94NWXXv7D3BznwodwKzNz8sS5Wa79yqnXZQpXqGc=; b=sdeYOvMeYyvsQnmuW6L8M6hjIXdyO1TV42gd95UkhrRv2DE0O0LhvZlX/vbi+Tc5Pkjq2MB/oc9KyG5oflGEzxB3Tnf/WhsczhpX4pryLu7qxMoAN2DOSfMISalI0qy33m6E30OPl4vFEJWNIzMrvGXroORtsMfZqO9X5EClRxJsy5zr0+EnNPcE7i5lvGOeg88R+8zu7Qq0XTVYnxPgJ2uSHH9EW77+iA38efbEVHqhggjpxleCzUbq8sXf89Pdue+jCUy28XfwM63Lkr7ugUIMN/AdJxdd2JPEAeYGp8BfK3zyV3FUcFV14QfFl9tdIL1rNClXR0NR4f/8v1fOMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JnT94NWXXv7D3BznwodwKzNz8sS5Wa79yqnXZQpXqGc=; b=kuOLPM29i16d+dOjCb1ZaOJ7KUmmwXkEjjhU8QG6JlY86GMOQsPLP9pOjTc9WkDW3G6xzk3c06ESyKQ0oqf7Ml7VMYT8iCtDeqB6pGDqsnMMz3V8/nZEx2NFAatW7ELXFwPoo49yPTrPi63LIeG8BgNQi/xZ3iWZF76wKAR4eNw= Received: from SN1PR12CA0075.namprd12.prod.outlook.com (2603:10b6:802:20::46) by SJ0PR12MB6805.namprd12.prod.outlook.com (2603:10b6:a03:44f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.15; Fri, 14 Nov 2025 00:27:00 +0000 Received: from SA2PEPF00001509.namprd04.prod.outlook.com (2603:10b6:802:20:cafe::cb) by SN1PR12CA0075.outlook.office365.com (2603:10b6:802:20::46) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.17 via Frontend Transport; Fri, 14 Nov 2025 00:26:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SA2PEPF00001509.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.13 via Frontend Transport; Fri, 14 Nov 2025 00:27:00 +0000 Received: from rric.localdomain (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Thu, 13 Nov 2025 16:26:53 -0800 From: Robert Richter To: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso CC: , , Gregory Price , "Fabio M. De Francesco" , Terry Bowman , Joshua Hahn , Robert Richter Subject: [PATCH v3 1/3] cxl: Simplify cxl_rd_ops allocation and handling Date: Fri, 14 Nov 2025 01:26:28 +0100 Message-ID: <20251114002632.1309139-2-rrichter@amd.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251114002632.1309139-1-rrichter@amd.com> References: <20251114002632.1309139-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001509:EE_|SJ0PR12MB6805:EE_ X-MS-Office365-Filtering-Correlation-Id: 9002d60f-22f5-4b9b-3d6c-08de231486d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?opkOOOs3sCJYRHlU/9yV9wNkjuqMlS0gl5F4ie/HQ35ty+TNPnH/uzWBQN+t?= =?us-ascii?Q?HkDQqqeDfy+PiMeidc56hNdWEkNFOSDoogqGEgVZCBSPv3IpBAx6SyY7tiSt?= =?us-ascii?Q?If322AbzJC1d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Q?= =?us-ascii?Q?DdeBlLg6lFWSG9Yzjtelh7xFnT8zwT+RHiAKjgn8XnBj+q3DSfVyxMZYeEUp?= =?us-ascii?Q?QI58EZzDATNihp6kbjII62elOo2lC88uM+0Tj+X1rimKAHLbYjtybY5DOfjN?= =?us-ascii?Q?CDl0CybX9kvvHl862jOx4oJm8Z3fCU7fHj5/ze/Cwf3l97iYIQ9T6iawBqOA?= =?us-ascii?Q?6vVQOO13OAkXj8mXBY5UdbHW+agQqym58TpKuOL61N1FOGEzxURmLPs7tRzF?= =?us-ascii?Q?ZK4CGKxjpqIaxqulEi0WWaiEDROEtQ1g0hfcQuMwEWTyH8uUSj6W0ugLa2Qg?= =?us-ascii?Q?0lzGq3DkXt4NXrJuGEBcKWntx0dZNvxwEEJf8u1OMpfrQmZYFQ3lB7ZZvAXf?= =?us-ascii?Q?lIl416WmXYplA5toK0dEFqKKLpRZwhVWm5vUQ5ciVC14Ky6i/nKVqxLd/Utk?= =?us-ascii?Q?CFAhuMnLnvXWoZZHoIwVuEgxGi/1iIc0udjWNuyAGn/hJJ7m3t1MeZeQHWXx?= =?us-ascii?Q?6aKg5MXdSbGyizy6a5xkYJCpyCRGVHkECkcJKIiiSHDmWaHmxKGT9ErNkDaR?= =?us-ascii?Q?xRTCJyC9lnRixhMLmgA=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2025 00:27:00.0807 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9002d60f-22f5-4b9b-3d6c-08de231486d2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001509.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6805 Content-Type: text/plain; charset="utf-8" A root decoder's callback handlers are collected in struct cxl_rd_ops. The structure is dynamically allocated, though it contains only a few pointers in it. This also requires to check two pointes to check for the existance of a callback. Simplify the allocation, release and handler check by embedding the ops statically in struct cxl_root_decoder. Implementation is equivalent to how struct cxl_root_ops handles the callbacks. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Robert Richter --- drivers/cxl/acpi.c | 8 ++------ drivers/cxl/core/port.c | 1 - drivers/cxl/core/region.c | 20 +++++--------------- drivers/cxl/cxl.h | 2 +- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index bd2e282ca93a..cef3e07244fd 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -475,12 +475,8 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *c= fmws, cxlrd->qos_class =3D cfmws->qtg_id; =20 if (cfmws->interleave_arithmetic =3D=3D ACPI_CEDT_CFMWS_ARITHMETIC_XOR) { - cxlrd->ops =3D kzalloc(sizeof(*cxlrd->ops), GFP_KERNEL); - if (!cxlrd->ops) - return -ENOMEM; - - cxlrd->ops->hpa_to_spa =3D cxl_apply_xor_maps; - cxlrd->ops->spa_to_hpa =3D cxl_apply_xor_maps; + cxlrd->ops.hpa_to_spa =3D cxl_apply_xor_maps; + cxlrd->ops.spa_to_hpa =3D cxl_apply_xor_maps; } =20 rc =3D cxl_decoder_add(cxld); diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index 8128fd2b5b31..fef3aa0c6680 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -459,7 +459,6 @@ static void cxl_root_decoder_release(struct device *dev) if (atomic_read(&cxlrd->region_id) >=3D 0) memregion_free(atomic_read(&cxlrd->region_id)); __cxl_decoder_release(&cxlrd->cxlsd.cxld); - kfree(cxlrd->ops); kfree(cxlrd); } =20 diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index b06fee1978ba..095af0f4760f 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -2924,16 +2924,6 @@ static bool cxl_is_hpa_in_chunk(u64 hpa, struct cxl_= region *cxlr, int pos) return false; } =20 -static bool has_hpa_to_spa(struct cxl_root_decoder *cxlrd) -{ - return cxlrd->ops && cxlrd->ops->hpa_to_spa; -} - -static bool has_spa_to_hpa(struct cxl_root_decoder *cxlrd) -{ - return cxlrd->ops && cxlrd->ops->spa_to_hpa; -} - u64 cxl_dpa_to_hpa(struct cxl_region *cxlr, const struct cxl_memdev *cxlmd, u64 dpa) { @@ -2988,8 +2978,8 @@ u64 cxl_dpa_to_hpa(struct cxl_region *cxlr, const str= uct cxl_memdev *cxlmd, hpa =3D hpa_offset + p->res->start + p->cache_size; =20 /* Root decoder translation overrides typical modulo decode */ - if (has_hpa_to_spa(cxlrd)) - hpa =3D cxlrd->ops->hpa_to_spa(cxlrd, hpa); + if (cxlrd->ops.hpa_to_spa) + hpa =3D cxlrd->ops.hpa_to_spa(cxlrd, hpa); =20 if (!cxl_resource_contains_addr(p->res, hpa)) { dev_dbg(&cxlr->dev, @@ -2998,7 +2988,7 @@ u64 cxl_dpa_to_hpa(struct cxl_region *cxlr, const str= uct cxl_memdev *cxlmd, } =20 /* Simple chunk check, by pos & gran, only applies to modulo decodes */ - if (!has_hpa_to_spa(cxlrd) && (!cxl_is_hpa_in_chunk(hpa, cxlr, pos))) + if (!cxlrd->ops.hpa_to_spa && !cxl_is_hpa_in_chunk(hpa, cxlr, pos)) return ULLONG_MAX; =20 return hpa; @@ -3033,8 +3023,8 @@ static int region_offset_to_dpa_result(struct cxl_reg= ion *cxlr, u64 offset, * If the root decoder has SPA to CXL HPA callback, use it. Otherwise * CXL HPA is assumed to equal SPA. */ - if (has_spa_to_hpa(cxlrd)) { - hpa =3D cxlrd->ops->spa_to_hpa(cxlrd, p->res->start + offset); + if (cxlrd->ops.spa_to_hpa) { + hpa =3D cxlrd->ops.spa_to_hpa(cxlrd, p->res->start + offset); hpa_offset =3D hpa - p->res->start; } else { hpa_offset =3D offset; diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h index 231ddccf8977..6524b242e8c4 100644 --- a/drivers/cxl/cxl.h +++ b/drivers/cxl/cxl.h @@ -451,7 +451,7 @@ struct cxl_root_decoder { void *platform_data; struct mutex range_lock; int qos_class; - struct cxl_rd_ops *ops; + struct cxl_rd_ops ops; struct cxl_switch_decoder cxlsd; }; =20 --=20 2.47.3 From nobody Sun Feb 8 09:12:57 2026 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012036.outbound.protection.outlook.com [40.93.195.36]) (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 94F4C21D3EA; Fri, 14 Nov 2025 00:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.36 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080037; cv=fail; b=CjLUT5jKZC+qguC5Vz95+eKG2IfL260vVEXoZR7ASWdJ0UegUHEhucYyhIOOAqcZ4kqkh7BdHKcgyG4uR9ZO4uWk0I+t44KV96MMb5MNODP4nCy4n0E538uPPyYlzsEkpSRcFIgWRwdXmiA1nzg26MoFWRi5wZLeHdgjMBFxmo8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080037; c=relaxed/simple; bh=PDKTvTvCBFECUgIrHqVAB8OlQ7BYiZ/cV9+GWP8oRB4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jl6Mo2+EACPq1seMK5WKkGBQ3Imw1XfNDku0pCahqacoaBHReVlymrww+ZHCQHIAu6h1vS0azvZfsYcqBkEmWdfmT/wcqXy1xxuzjrZlIA5mpIpMajvfLYOC9dJwIKTdsrF7BTZZT91GcW4kFaAPNpH8bmT5iFhv2/wVrVMj8/w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=0f9GBu4e; arc=fail smtp.client-ip=40.93.195.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="0f9GBu4e" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jSpjAMBDbUGDOPkiRoaxz+xgCiBomtF1GJE618jVtd/GqYzatgplp/gWL0Dps/rFXwdjAAU50usAs8fSZh4K8M+aKGWiw281cp5ELNeetzTteFLtvWXdTGVgsdqw2vyVAmtHmbTVhrLHqE9SA9AH/d+77Yi4dy+intV9Ds95MiiKB8uyiI6z2Gs3uARnzcItnvZMgapQkp8zLcC/2664D7FpSipNblwYJHkkxoswkrvYnvNyxeyUBrko/98wQnoXLifQtHbIp/1T1YgBYwYztceS8Hg87K12N2Vj0qr7OlTrLwFm0S56pu9MNYPy5U/DT0eLPUwMQcl9uAIgPkGGQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E7YjhxisUyINIEIMGA3R8nL9MOC8tdnfrtPYcdW7Dgk=; b=rrSkMW8C1N2l0Z1kTHqREmegPzrcD4poylh0teYJnp8hzggUs8F+v9h3ApIED3FszHr0gUrl4PBUu5pJG3n/uEbum50a49OgryP85L6RwM5dSB0G0+VugM3Z2nFmDU7HknzWDpNNhG7A591D+klMvaCl32YynAxNf0gQvtPfvZt7L6LxYATlQsApVFvL6KwAgK2BuvAxlxH6rLUxxIsn9nykOUvz/SGW1uyntBQ386wCWiiwuCc0gFHDW6pag8bvb9IdpkNEusHv4H/t0rVMiVb9XCal1W93ETskvmGaeIKr+Z2KGh8sjWIr/uRrXbvqDQOnLN3aMqS2rLLpFQrzXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E7YjhxisUyINIEIMGA3R8nL9MOC8tdnfrtPYcdW7Dgk=; b=0f9GBu4eQpchW7i9868+BUhGSUm1686Z6lRIm1NcTFUrcWEK0SYdg5WDw0rokFy77Xt6KiAqhDFUtx7poqbCry67DaZNEyQ6a7+2nZpcb0r60Uh2CeXK3OFHg0llHnx6MhSqSF5YZLozCH0WWHoJ0plktzt485Vknyb/i0KPpqY= Received: from SN1PR12CA0078.namprd12.prod.outlook.com (2603:10b6:802:20::49) by DS7PR12MB9042.namprd12.prod.outlook.com (2603:10b6:8:ed::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Fri, 14 Nov 2025 00:27:08 +0000 Received: from SA2PEPF00001509.namprd04.prod.outlook.com (2603:10b6:802:20:cafe::38) by SN1PR12CA0078.outlook.office365.com (2603:10b6:802:20::49) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.17 via Frontend Transport; Fri, 14 Nov 2025 00:27:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SA2PEPF00001509.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.13 via Frontend Transport; Fri, 14 Nov 2025 00:27:08 +0000 Received: from rric.localdomain (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Thu, 13 Nov 2025 16:26:59 -0800 From: Robert Richter To: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso CC: , , Gregory Price , "Fabio M. De Francesco" , Terry Bowman , Joshua Hahn , Robert Richter Subject: [PATCH v3 2/3] cxl/acpi: Group xor arithmetric setup code in a single block Date: Fri, 14 Nov 2025 01:26:29 +0100 Message-ID: <20251114002632.1309139-3-rrichter@amd.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251114002632.1309139-1-rrichter@amd.com> References: <20251114002632.1309139-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001509:EE_|DS7PR12MB9042:EE_ X-MS-Office365-Filtering-Correlation-Id: f50e7252-a9b4-4dcd-426e-08de23148c01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qoHL3ni7/V7l7C9ArshBC+XAKVIjw1nzAYRB6hofb6yLu6e+FrHbLQuF3hJF?= =?us-ascii?Q?T1P37w5ViORotDSMuvYpSUDvkPaUvH9Boq5WgnxFj69KUFA9yNYKNLPxdgjK?= =?us-ascii?Q?yx/yIl5cHhzz3l5xKr4e9FsU2DAPN657p1yvt5KeyS2du8/DBznUpgiKSKqA?= =?us-ascii?Q?CxYgFcSOPplk05Etie48RLfhtRravZW0vuA02h5Lo1/+GTwjlWX5v14EdtnC?= =?us-ascii?Q?p228YYFVb/iYAY9EXnEpfPoR821+ZOLIoleUmy7HyYh5baPesT8gMrbPN6sT?= =?us-ascii?Q?4TUPr3ftYjZ022B2fiGJbX8GFSrXOj1Rqu2GVr7q7QomrRl05zs1dVMU/lA5?= =?us-ascii?Q?Jn5ng0Vf/S0zyzHzSbgGxQmes7a+mrBkfNg9BuT06Iw5/xT4tnYKR4YTlPoP?= =?us-ascii?Q?iQTHQKO5Neh8IiRNMgmbU9kUKoh/L0EcJiB6Stnr36661dF1naxeEhuHD8YU?= =?us-ascii?Q?DQoYquDtsR7QyuDshFsa0PN+PGU0qqXYYSdgOcNLy402VTEintGwEdzb+v35?= =?us-ascii?Q?X4DnPIw82UKzWV9Y186TiEs0JhPpBatiF3ShfJHvSomy4/CS/G4Z2na0fdxb?= =?us-ascii?Q?J15Hz6XdlujXIIN8K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-ascii?Q?HGT03mWxqpAau7y9VxpP0IkG4mSffhosFPKsLBv/ruqunZEdsP1qkX/L088O?= =?us-ascii?Q?9ao6eDCcgEav4JNvk1A=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2025 00:27:08.7777 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f50e7252-a9b4-4dcd-426e-08de23148c01 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001509.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB9042 Content-Type: text/plain; charset="utf-8" Simplify the xor arithmetric setup code by grouping it in a single block. No need to split the block for QoS setup. It is safe to reorder the call of cxl_setup_extended_linear_cache() because there are no dependencies. Reviewed-by: Jonathan Cameron Signed-off-by: Robert Richter --- v2: spell fix in descripton (Jonathan), --- --- drivers/cxl/acpi.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c index cef3e07244fd..0a1bad3cafa7 100644 --- a/drivers/cxl/acpi.c +++ b/drivers/cxl/acpi.c @@ -453,8 +453,6 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cf= mws, ig =3D CXL_DECODER_MIN_GRANULARITY; cxld->interleave_granularity =3D ig; =20 - cxl_setup_extended_linear_cache(cxlrd); - if (cfmws->interleave_arithmetic =3D=3D ACPI_CEDT_CFMWS_ARITHMETIC_XOR) { if (ways !=3D 1 && ways !=3D 3) { cxims_ctx =3D (struct cxl_cxims_context) { @@ -470,15 +468,14 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *= cfmws, return -EINVAL; } } - } - - cxlrd->qos_class =3D cfmws->qtg_id; - - if (cfmws->interleave_arithmetic =3D=3D ACPI_CEDT_CFMWS_ARITHMETIC_XOR) { cxlrd->ops.hpa_to_spa =3D cxl_apply_xor_maps; cxlrd->ops.spa_to_hpa =3D cxl_apply_xor_maps; } =20 + cxl_setup_extended_linear_cache(cxlrd); + + cxlrd->qos_class =3D cfmws->qtg_id; + rc =3D cxl_decoder_add(cxld); if (rc) return rc; --=20 2.47.3 From nobody Sun Feb 8 09:12:57 2026 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11010025.outbound.protection.outlook.com [40.93.198.25]) (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 7267821D3E2; Fri, 14 Nov 2025 00:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.198.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080036; cv=fail; b=gghiUL5HFsJJSFtOGGtwDy8eLfFGgo5gO/7fC39SJfAivQ4b0athe5FNPyC2TGuKjWfu+Nl4Ebqt8ZtAvNREP7mZKBR6nGqhvEahycp/Be/8/+48/+Tuttobbd6HoWjXuFz/00j2BJ2B+fGutbGkUwpcjyWgR9qa0INSq39FYyo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763080036; c=relaxed/simple; bh=ckXg6ciMIKMNSuzZ6QwXlf0MOR62pL44IbCPR6yOMIw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jEbiLcqb0U60QTjibHXyrD+fRxmEjvnX2sTV8gxYkVwpHxfXhvYWc0Kw2dkGHdGJ639k53Y+r5SP3tJvz4qMbhNl8k2u4aJZr+BD0snvIaYtT6aMYEQ7vx5pDWwidprD15L/PME5c+1KSIpWwKJg2VWpdzcBWjJolfTVJzipzbA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=SGMo6+TF; arc=fail smtp.client-ip=40.93.198.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="SGMo6+TF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R3pEEG/QyChXSy3GTWjXKTPGoVpHzrW8Zmtnx/wBRrDbu5EyLpHLARZ870VJEbF3v4MeOxDztsQ7umtEANSO/YGiqGTbMoAnmuDSsxzL5XnkeGid3Gy7sbX8Bc6poqI/bfSI8ghAmbQjbMXhnbaeBuQiY2L5vrMH8AaZ/dkzPLWQ+aX0PldwntXVGaSYKHwtt6xTCFxLSElJoJ5q0AvPPfvsGkrxFFWeT6NegzO6o1djAmiCy7wlDC8gbeb636b8QQrDFMiGtZ8MinlRzSJoC9YqSr5LrLDWu53uayyxGS1u+toGD7SulIEbX4Y9dYON+Xkq/Jb6oUymczA12kwGqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JHUM8Cr2aTovnKH/qcEnQmX2YWUtgtlZRHY7Ca3gNDo=; b=ODmwDaDsdEfVtOU4EHgqqYXORfZul+lC7mHNv7CeM40k2p2nj1ozsHkERNZnntSOrA7YnVAazrGnTcjj80nnZ/MRZWxGDj2DgaTZupllDRan/lacS6MXCm7UwW6Kmt5nZqju8Tmu1h+I7n8+w6kizjGF/pFwtg/oyZ6P/l3eIDA4wZq5EAE62xmzvrxRJkW5JtPQkKu2gjj0A9zy6WQMsTHmtLVnVAroYJpPOkcYM1xDX6IkZ0gXoyCsmdMdzjUoSsibAXIGgaPJbBLf97JeykF2UrJ8gCVxvubPId+sS9m5nHKmOU07L5Vlg6A/ajRmo+/XFuAVOQu3taHa4DSxag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JHUM8Cr2aTovnKH/qcEnQmX2YWUtgtlZRHY7Ca3gNDo=; b=SGMo6+TFhAzKM5sxx3Do1ww/YIqSMlZlb+Y3tXQBah65UDUIHj7hnxWZuatxX+eVBfonC+Gz8E6EfR67eMZT64XWb3FoS6F3+VZLkeJorRbbCviShQQcQE4cK0z0YZ3wm4dYkCrLtexs9/uyscUu8bTqjdIipzZPH2AN2MtFW8g= Received: from SN1PR12CA0068.namprd12.prod.outlook.com (2603:10b6:802:20::39) by SA1PR12MB6797.namprd12.prod.outlook.com (2603:10b6:806:259::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.16; Fri, 14 Nov 2025 00:27:11 +0000 Received: from SA2PEPF00001509.namprd04.prod.outlook.com (2603:10b6:802:20:cafe::91) by SN1PR12CA0068.outlook.office365.com (2603:10b6:802:20::39) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.17 via Frontend Transport; Fri, 14 Nov 2025 00:27:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SA2PEPF00001509.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.13 via Frontend Transport; Fri, 14 Nov 2025 00:27:10 +0000 Received: from rric.localdomain (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Thu, 13 Nov 2025 16:27:04 -0800 From: Robert Richter To: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso CC: , , Gregory Price , "Fabio M. De Francesco" , Terry Bowman , Joshua Hahn , Robert Richter Subject: [PATCH v3 3/3] cxl/region: Remove local variable @inc in cxl_port_setup_targets() Date: Fri, 14 Nov 2025 01:26:30 +0100 Message-ID: <20251114002632.1309139-4-rrichter@amd.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251114002632.1309139-1-rrichter@amd.com> References: <20251114002632.1309139-1-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001509:EE_|SA1PR12MB6797:EE_ X-MS-Office365-Filtering-Correlation-Id: ff8722c3-e5f3-4427-3543-08de23148d4f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|7416014|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?aoAfzm62xqWgNy+9hUtLNmVwnf0g6CSNhBwwHP9WjtXOrnwgFP1lLHjhcOGv?= =?us-ascii?Q?FZcf8dHUXFKCxE3ygApDc8meNRMaTcR7sgDZ4SzQ3j+TWJMOhrFUKb093pPU?= =?us-ascii?Q?qGysb0MGuO82gS/DTYP5gSce71N+05VYq07+d9Ar6UB7zQ9J2ACxrpLp3Cky?= =?us-ascii?Q?Z7g3N/FLKa5etHwsrfWyrVeZXDOKSLGzhdiGviVDIv9Z8KCAq5B0PxLfxSvI?= =?us-ascii?Q?UxWfPC2+taQTILFTca+P5BQBquuso8Jzkd03AbbO60qOqWd3u0QN8of9wDoC?= =?us-ascii?Q?WLvGay2D2nJVNfuLjhtrR1LEhmOUW+RSslDQR6PVSQRKnx/W5s2WCusjhNvQ?= =?us-ascii?Q?M171pB1HzZb2Zm/dT+S6ccEwNnoFeUaW+MGm4CTFF1CFUZk+PNk5JBiK0b4b?= =?us-ascii?Q?5iJV9iAlMw5TsRDnZxQpLVSKuB+QtUsEfMPzaeRoU7hL5zT1wbbxUGgU0Elu?= =?us-ascii?Q?DJXpGvnojZvlCHcABNJcJehdphta2wAKqrRM0j7ez4lUzYulax6kQ2lqdrei?= =?us-ascii?Q?yLwZ09XeyVVJAbM8mjDo928AhpoIbkBPiRrBtixxRECXVCAoWUJ0OO4AS92I?= =?us-ascii?Q?iFYiePu6+xeNmOJDHFu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zu?= =?us-ascii?Q?wwNDgo10/kle4mThb5wLWPrrlSd4iJNn1Uexzz5nqIS3nIokACcHAA366XiR?= =?us-ascii?Q?BEvQsNxEOvjFjqC9xn8=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(7416014)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2025 00:27:10.9654 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff8722c3-e5f3-4427-3543-08de23148d4f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001509.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6797 Content-Type: text/plain; charset="utf-8" Simplify the code by removing local variable @inc. The variable is not used elsewhere, remove it and directly increment the target number. Reviewed-by: Jonathan Cameron Signed-off-by: Robert Richter --- drivers/cxl/core/region.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 095af0f4760f..8cdb6a935289 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1328,7 +1328,7 @@ static int cxl_port_setup_targets(struct cxl_port *po= rt, struct cxl_endpoint_decoder *cxled) { struct cxl_root_decoder *cxlrd =3D to_cxl_root_decoder(cxlr->dev.parent); - int parent_iw, parent_ig, ig, iw, rc, inc =3D 0, pos =3D cxled->pos; + int parent_iw, parent_ig, ig, iw, rc, pos =3D cxled->pos; struct cxl_port *parent_port =3D to_cxl_port(port->dev.parent); struct cxl_region_ref *cxl_rr =3D cxl_rr_load(port, cxlr); struct cxl_memdev *cxlmd =3D cxled_to_memdev(cxled); @@ -1520,9 +1520,8 @@ static int cxl_port_setup_targets(struct cxl_port *po= rt, cxlsd->target[cxl_rr->nr_targets_set] =3D ep->dport; cxlsd->cxld.target_map[cxl_rr->nr_targets_set] =3D ep->dport->port_id; } - inc =3D 1; + cxl_rr->nr_targets_set++; out_target_set: - cxl_rr->nr_targets_set +=3D inc; dev_dbg(&cxlr->dev, "%s:%s target[%d] =3D %s for %s:%s @ %d\n", dev_name(port->uport_dev), dev_name(&port->dev), cxl_rr->nr_targets_set - 1, dev_name(ep->dport->dport_dev), --=20 2.47.3