Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp49101pxj; Thu, 27 May 2021 20:59:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy++sHzvYa8OOuyilD8GlIPluevvpJufmKKg9MPXAn3hqCogn5g9Z/JBWrUA4Fh4gJ6Djam X-Received: by 2002:a17:906:a110:: with SMTP id t16mr3085924ejy.360.1622174354357; Thu, 27 May 2021 20:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622174354; cv=none; d=google.com; s=arc-20160816; b=TpoFp678mp7iS+3CkCGOyPl5JHg4veytzLYsQcBu07iuN3FXlhblUvnD3svjYPirLy /nQLfzJ0wVDQDVsf+gVRCHpTXi3Qez/CcDcS4ZN3a4AGkcHYGIqP7Q7vVvfq+I0I0s2E 9MDugl3psmhGIEbLA+JbOEeJVZkoF0HIem8P95ZzaCa2LrtvxmDuzUUC5MqibDquZtHG 8lNn4yxp9OQY6SeQ6Gq4dqA2in9mqM9gkqpLPGMdlVTHFPmutli2ZHiJ30VTlbXE9OPO nMH24Vjoy4jsKUTPVflijyOqAdVK8GmdG8kjwl1Z470AeztGok5c4e3zaVu4Us3IwPqm F15A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=ROMenOlyebrSMpTyr7gLpYoelSxDraZB8Q4OWyUX06s=; b=E6oYHbAD3aScBU2U5XW4WHNe2HCc+o8lYF2Paw+SiLt67CAl8nMsgV1FILQu2c18fK f8XidT1ZgO2WM3MZON/uRABUEqyntTeZoXPkBufGVIj/GPcOj4Lo1OTMyqpoN80NVe0g 7U94Ia2XvTioRvgB4MtDNO7/5QCEe/V3KxOaSjkMD967IsTJzZ1GljIB4NpO510j0+SG GsfdoE6bXwVnBLsxbbqh2HT65MAVSDe51p4sNFQXdVBRb6LyA/Y5gm8o/9jJ540plGDz toNubHfDsCVSz4tc6xAGL27wTIFVSEEyvrQv1A9gyHrJSmfep1IOsma9dbr6OQzDfC0v 6YLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si3838322eds.196.2021.05.27.20.58.51; Thu, 27 May 2021 20:59:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234583AbhE1AvE (ORCPT + 99 others); Thu, 27 May 2021 20:51:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:54485 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbhE1AvB (ORCPT ); Thu, 27 May 2021 20:51:01 -0400 IronPort-SDR: PQFiKI63xyPAZHovu8cVx75jS7AzMyKviNk5O9g1glJLsWhxJyUR+27wHRcXaGiwLKrnRct1Q6 cKLIXDp1Gslg== X-IronPort-AV: E=McAfee;i="6200,9189,9997"; a="200977676" X-IronPort-AV: E=Sophos;i="5.83,228,1616482800"; d="scan'208";a="200977676" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 17:49:26 -0700 IronPort-SDR: zVQQH3v2xd+LxDnXvdv09uRsLErVWOQZoyeCN2eLQD+vtbxK1hPaSPXsKySNkm7C1NDqDNpe05 wvSjPIZTQnjg== X-IronPort-AV: E=Sophos;i="5.83,228,1616482800"; d="scan'208";a="445261698" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 17:49:26 -0700 From: ira.weiny@intel.com To: Ben Widawsky , Dan Williams , Jonathan Cameron Cc: Ira Weiny , Alison Schofield , Vishal Verma , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V3 0/5] Map register blocks individually Date: Thu, 27 May 2021 17:49:17 -0700 Message-Id: <20210528004922.3980613-1-ira.weiny@intel.com> X-Mailer: git-send-email 2.28.0.rc0.12.gb6a658bd00c9 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ira Weiny Changes for v3: From Jonathan: Add Reviews. Thanks! Add back the kernel doc comment and enhance it a bit Update commit messages with more details. Remove CXL_REGLOC_RBI_MAX Dan Add pcim_enable_device() back in because it is needed and is not incompatible with pci_release_mem_regions() like I originally though. Change cxl_ioremap_block() to devm_cxl_iomap_block() Add kernel doc comment for cxl_probe_component_regs() Update HDM patch to devm_cxl_iomap_block() call. Some hardware implementations mix component and device registers into the same BAR and the driver stack is going to have independent mapping implementations for those 2 cases. Furthermore, it will be nice to have finer grained mappings should user space want to map some register blocks. Unfortunately, the information for the register blocks is contained inside the BARs themselves. Which means the BAR must be mapped, probed, and unmapped prior to the registers being mapped individually. The series starts by introducing the helper function cxl_decode_register_block(). Then breaks out region reservation and register mapping. Separates mapping the registers into a probe stage and mapping stage. The probe stage creates a list of register blocks which is then iterated to map the individual register blocks. Once mapping is performed in 2 steps the pci device management is removed and the resource reservation can be done per register block as well. Finally, mapping the HDM decoder register block is added. Ben Widawsky (1): cxl/pci: Add HDM decoder capabilities Ira Weiny (4): cxl/mem: Introduce cxl_decode_register_block() cxl/mem: Reserve all device regions at once cxl/mem: Map registers based on capabilities cxl/mem: Reserve individual register block regions drivers/cxl/core.c | 193 ++++++++++++++++++++++++++++++++++++++++++--- drivers/cxl/cxl.h | 98 ++++++++++++++++++++--- drivers/cxl/pci.c | 164 ++++++++++++++++++++++++++++++-------- 3 files changed, 402 insertions(+), 53 deletions(-) -- 2.28.0.rc0.12.gb6a658bd00c9