From patchwork Wed May 17 21:28:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 13245725 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19D1DC77B7A for ; Wed, 17 May 2023 21:28:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbjEQV2c (ORCPT ); Wed, 17 May 2023 17:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjEQV23 (ORCPT ); Wed, 17 May 2023 17:28:29 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3670A1732; Wed, 17 May 2023 14:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684358908; x=1715894908; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=NxykSF0yuigVRyhmiAOlC2C/CUOtx/RaDUQ0PKhnCCg=; b=ZOtsZOG03wjI4oGQUHS8j2qOdKNGc1Sl9kzWvbrgjgzE6/zI6LTMn5M8 wE4R05xPF2zl1W001Obi6f9SSU2PKXAOEhdlOlrPEf+ZHhQmlQUmepnem XBgb+up9Nkwn1DIK/q3Tct8pOrqffZhU/PBcmv17uW9E+D4o5WBHsCewc nK9lN28Y1PQsLpWUh/JA8vTdD0mEZZiSlDAk+cUOEp2H7JrNDu9sqWfYV 5I3RZyd0OCyO4IYk/R09wOIlT6UZpCrye2pz3MUpRUpa3adEdwZt+kGyA GG+5ZIO5mUBIeDkq/PiLujDe+6uG30/GnL/20oNqHBbBpfsxf9id6PHjV Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="341274725" X-IronPort-AV: E=Sophos;i="5.99,283,1677571200"; d="scan'208";a="341274725" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 14:28:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="826098073" X-IronPort-AV: E=Sophos;i="5.99,283,1677571200"; d="scan'208";a="826098073" Received: from iweiny-mobl.amr.corp.intel.com (HELO localhost) ([10.209.143.168]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 14:28:26 -0700 From: Ira Weiny Date: Wed, 17 May 2023 14:28:10 -0700 Subject: [PATCH 1/3] MAINTAINERS: Add additional reviewers for CXL MIME-Version: 1.0 Message-Id: <20230426-cxl-fixes-v1-1-870c4c8b463a@intel.com> References: <20230426-cxl-fixes-v1-0-870c4c8b463a@intel.com> In-Reply-To: <20230426-cxl-fixes-v1-0-870c4c8b463a@intel.com> To: Dan Williams , Alison Schofield , Vishal Verma , Dave Jiang , Ben Widawsky , Jonathan Cameron Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny X-Mailer: b4 0.13-dev-9a8cd X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358895; l=755; i=ira.weiny@intel.com; s=20221211; h=from:subject:message-id; bh=NxykSF0yuigVRyhmiAOlC2C/CUOtx/RaDUQ0PKhnCCg=; b=QAV7YBg+rjyFhoKdx2BYoFW+h9Y+R92ISgTQ+oAVUr1GJzyQCVNbkg3AXzuRztMBtZzHXCLhV Y/X8fc+3lCEDMNTqyDyAVqeqGz2QPr2KhO6ZMTgYQK3UkCdrYPmQ+EU X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=noldbkG+Wp1qXRrrkfY1QJpDf7QsOEthbOT7vm0PqsE= Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org To get better coverage add Dave Jiang and Jonathan Cameron as reviewers. Cc: Dave Jiang Cc: Jonathan Cameron Signed-off-by: Ira Weiny Acked-by: Dave Jiang Acked-by: Jonathan Cameron --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 90abe83c02f3..6f8568ec2731 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5169,6 +5169,8 @@ M: Vishal Verma M: Ira Weiny M: Ben Widawsky M: Dan Williams +R: Dave Jiang +R: Jonathan Cameron L: linux-cxl@vger.kernel.org S: Maintained F: drivers/cxl/ From patchwork Wed May 17 21:28:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 13245726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E7B3C77B7A for ; Wed, 17 May 2023 21:28:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229522AbjEQV2j (ORCPT ); Wed, 17 May 2023 17:28:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229756AbjEQV2g (ORCPT ); Wed, 17 May 2023 17:28:36 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C0711732; Wed, 17 May 2023 14:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684358914; x=1715894914; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=Jnx73iYy2J9K7uSzhh1UHCYltU9kWEDXMbRP1gAejdg=; b=XDnyEdJa3peeNKyCDIjED8FcQ21otfRujo+2azAu5X69ox+yYKswaV7X 8xstA+ZjtUCATAnR5B2EiAvg3TLY9B9GUBPkQpxXiJf/01Xcv8znYvj+R LU8eaCcGkZJXEJUVUgOmsbf1YheDoKo1OZTiZwBxHNGF9vmkmrTG5ECq6 ZkwTqZwQ/qP5R/TcXtHGHljPseIAZv024P37sUub72k9MBVcI7TtHCT2C ZXvrDQaV3cJAzt2fU/YWqbZQiyCXefz2wdi8CO0lU/2VRfyj0CwoHvb8W Li3TkEG3y+QMzlz8k4P0tJW/nOA4ONJ7eoOxAgJr31VJhQcxqRk2xVRU1 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="341274742" X-IronPort-AV: E=Sophos;i="5.99,283,1677571200"; d="scan'208";a="341274742" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 14:28:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="826098101" X-IronPort-AV: E=Sophos;i="5.99,283,1677571200"; d="scan'208";a="826098101" Received: from iweiny-mobl.amr.corp.intel.com (HELO localhost) ([10.209.143.168]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 14:28:32 -0700 From: Ira Weiny Date: Wed, 17 May 2023 14:28:11 -0700 Subject: [PATCH 2/3] cxl/pci: Update comment MIME-Version: 1.0 Message-Id: <20230426-cxl-fixes-v1-2-870c4c8b463a@intel.com> References: <20230426-cxl-fixes-v1-0-870c4c8b463a@intel.com> In-Reply-To: <20230426-cxl-fixes-v1-0-870c4c8b463a@intel.com> To: Dan Williams , Alison Schofield , Vishal Verma , Dave Jiang , Ben Widawsky , Jonathan Cameron Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny X-Mailer: b4 0.13-dev-9a8cd X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358895; l=1155; i=ira.weiny@intel.com; s=20221211; h=from:subject:message-id; bh=Jnx73iYy2J9K7uSzhh1UHCYltU9kWEDXMbRP1gAejdg=; b=qkGtd7nkrQtcgTRmtBxYsjv0Oc1zXIwHHux3AtXqjz9qyaq+hw/zPWjcNATj6yt+ENdzDow8F iumufjrji0iCD4P2hn2zZEoUxOnR8qIWwP8IHMo4EKO75otY7vulaXo X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=noldbkG+Wp1qXRrrkfY1QJpDf7QsOEthbOT7vm0PqsE= Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org The existence of struct cxl_dev_id containing a single member is odd. The comment made sense when I wrote it but could be clarified. Update the comment and place it next to the odd looking structure. Signed-off-by: Ira Weiny Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron --- drivers/cxl/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index f7a5b8e9c102..ad7a1276fdc5 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -469,6 +469,10 @@ static int cxl_alloc_irq_vectors(struct pci_dev *pdev) return 0; } +/* + * Threaded irq dev_id's must be globally unique. cxl_dev_id provides a unique + * wrapper object for each irq within the same cxlds. + */ struct cxl_dev_id { struct cxl_dev_state *cxlds; }; @@ -506,7 +510,6 @@ static int cxl_event_req_irq(struct cxl_dev_state *cxlds, u8 setting) if (FIELD_GET(CXLDEV_EVENT_INT_MODE_MASK, setting) != CXL_INT_MSI_MSIX) return -ENXIO; - /* dev_id must be globally unique and must contain the cxlds */ dev_id = devm_kzalloc(dev, sizeof(*dev_id), GFP_KERNEL); if (!dev_id) return -ENOMEM; From patchwork Wed May 17 21:28:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 13245727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 688D1C7EE23 for ; Wed, 17 May 2023 21:28:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjEQV2s (ORCPT ); Wed, 17 May 2023 17:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbjEQV2q (ORCPT ); Wed, 17 May 2023 17:28:46 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F05A1BFA; Wed, 17 May 2023 14:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684358920; x=1715894920; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=aLHFmTt4LCs0DVMtM1wqR56iyFuUZrZvjeZ079GZuMM=; b=LSlE81kzekanwsk1OVvrzqDUO7B+JtfACOPASAblRpN+s8qyITQPKms0 eFzOnk+hErrfOVlEP6jr5jNWaCvcmn5z5Bnl7J8bf9nbiH03eq8ok8sZd inN/0u6odJZJcjkdKMrSfutvVsFuSwLR/qYqgFz+WcM9T+7WXSab08kAp tt7/Id6emHvRglU8VlD/Xo6Rri+xe6Bh1Wl29jpqxyBRH1KC9orOWKnHk AoP/v+ZFa7RZPYBsGVZ4uslmJ5Xc5Sv29DBbGjsbs9j91WSsiJ/Z7WKuH Vd/zYgCupB7+x3GqZ82sQ0fOFvb2cILRMBEC49n9CFkloP6nHVn6+OsC/ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="336440450" X-IronPort-AV: E=Sophos;i="5.99,283,1677571200"; d="scan'208";a="336440450" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 14:28:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="734840829" X-IronPort-AV: E=Sophos;i="5.99,283,1677571200"; d="scan'208";a="734840829" Received: from iweiny-mobl.amr.corp.intel.com (HELO localhost) ([10.209.143.168]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 14:28:38 -0700 From: Ira Weiny Date: Wed, 17 May 2023 14:28:12 -0700 Subject: [PATCH 3/3] tools/testing/cxl: Document test configurations MIME-Version: 1.0 Message-Id: <20230426-cxl-fixes-v1-3-870c4c8b463a@intel.com> References: <20230426-cxl-fixes-v1-0-870c4c8b463a@intel.com> In-Reply-To: <20230426-cxl-fixes-v1-0-870c4c8b463a@intel.com> To: Dan Williams , Alison Schofield , Vishal Verma , Dave Jiang , Ben Widawsky , Jonathan Cameron Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny X-Mailer: b4 0.13-dev-9a8cd X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358895; l=5143; i=ira.weiny@intel.com; s=20221211; h=from:subject:message-id; bh=aLHFmTt4LCs0DVMtM1wqR56iyFuUZrZvjeZ079GZuMM=; b=lnYIC06SBPSEBRcGxl1jf+6AJvtpaqyMYXA5ROvRRHd1j57/oiqntMHaJk23ll5YvccYrwCCC 3wU8IZOpxoUDdBherDCi//mj5k39mugX0nL9tbW/bXd9uk4zzxqMYln X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=noldbkG+Wp1qXRrrkfY1QJpDf7QsOEthbOT7vm0PqsE= Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org The devices created, their relationship, and intended testing purpose is not extremely clear, especially for those unfamiliar with cxl-test. Document the purpose of each hierarchy. Add ASCII art to show the relationship of devices. Group the device declarations together based on the hierarchies. Signed-off-by: Ira Weiny Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron --- tools/testing/cxl/test/cxl.c | 75 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c index bf00dc52fe96..bd38a5fb60ae 100644 --- a/tools/testing/cxl/test/cxl.c +++ b/tools/testing/cxl/test/cxl.c @@ -23,6 +23,31 @@ static int interleave_arithmetic; #define NR_CXL_PORT_DECODERS 8 #define NR_BRIDGES (NR_CXL_HOST_BRIDGES + NR_CXL_SINGLE_HOST + NR_CXL_RCH) +/* + * Interleave testing + * + * +---------------+ +---------------+ + * | host_bridge[0]| | host_bridge[1]| + * +-/---------\---+ +--/---------\--+ + * /- -\ /- -\ + * /- -\ /- -\ + * +-------------+ +-------------+ +-------------+ +-------------+ + * |root_port[0] | |root_port[1] | |root_port[2] | |root_port[3] | + * +------|------+ +------|------+ +------|------+ +------|------+ + * | | | | + * +-------|-------+ +-------|-------+ +-------|-------+ +-------|-------+ + * |switch_uport[0]| |switch_uport[1]| |switch_uport[2]| |switch_uport[3]| + * +---|-------|---+ +---/-------|---+ +---/-------|---+ +---|-------\---+ + * | \ / \ / \ / \ + * +----|----++--|------++---------++----|----++---------++----|----++----|----++---------+ + * |switch ||switch ||switch ||switch ||switch ||switch ||switch ||switch | + * |_dport[0]||_dport[1]||_dport[2]||_dport[3]||_dport[4]||_dport[5]||_dport[6]||_dport[7]| + * +----|----++--|------++----|----++----|----++----|----++----|----++----|----++----|----+ + * | | | | | | | | + * +---|--+ +-|----+ +---|--+ +---|--+ +--|---+ +---|--+ +---|--+ +---|--+ + * |mem[0]| |mem[1]| |mem[2]| |mem[3]| |mem[4]| |mem[5]| |mem[6]| |mem[7]| + * +------+ +------+ +------+ +------+ +------+ +------+ +------+ +------+ + */ static struct platform_device *cxl_acpi; static struct platform_device *cxl_host_bridge[NR_CXL_HOST_BRIDGES]; #define NR_MULTI_ROOT (NR_CXL_HOST_BRIDGES * NR_CXL_ROOT_PORTS) @@ -31,16 +56,51 @@ static struct platform_device *cxl_switch_uport[NR_MULTI_ROOT]; #define NR_MEM_MULTI \ (NR_CXL_HOST_BRIDGES * NR_CXL_ROOT_PORTS * NR_CXL_SWITCH_PORTS) static struct platform_device *cxl_switch_dport[NR_MEM_MULTI]; +struct platform_device *cxl_mem[NR_MEM_MULTI]; +/* + * 1) Preconfigured region support (Simulated BIOS configured region) + * 2) 'Pass-through' decoder + * + * +---------------+ + * | hb_single | + * +------|--------+ + * | + * +------|--------+ + * | root_single | + * +------|--------+ + * | + * +----------|----------+ + * | swu_single | + * +-----|-----------|---+ + * | | + * +-----|-----+ +--|--------+ + * |swd_single | | swd_single| + * +-----|-----+ +----|------+ + * | | + * +------|-----+ +----|-------+ + * |mem_single | |mem_single | + * +------------+ +------------+ + */ static struct platform_device *cxl_hb_single[NR_CXL_SINGLE_HOST]; static struct platform_device *cxl_root_single[NR_CXL_SINGLE_HOST]; static struct platform_device *cxl_swu_single[NR_CXL_SINGLE_HOST]; #define NR_MEM_SINGLE (NR_CXL_SINGLE_HOST * NR_CXL_SWITCH_PORTS) static struct platform_device *cxl_swd_single[NR_MEM_SINGLE]; - -struct platform_device *cxl_mem[NR_MEM_MULTI]; struct platform_device *cxl_mem_single[NR_MEM_SINGLE]; +/* + * 1) RCD + * 2) Type-2 (Accelerator) + * + * +-----+ + * | rch | + * +--|--+ + * | + * +-|--+ + * |rcd | + * +----+ + */ static struct platform_device *cxl_rch[NR_CXL_RCH]; static struct platform_device *cxl_rcd[NR_CXL_RCH]; @@ -64,6 +124,17 @@ static inline bool is_single_bridge(struct device *dev) return false; } +/* + * +---------------+ +---------------+ + * | host_bridge[0]| | host_bridge[1]| + * +---------------+ +---------------+ + * +---------------+ + * | hb_single | (host_bridge[2]) + * +---------------+ + * +-----+ + * | rch | (host_bridge[3]) + * +-----+ + */ static struct acpi_device acpi0017_mock; static struct acpi_device host_bridge[NR_BRIDGES] = { [0] = {