From patchwork Thu Nov 7 20:58:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 13867119 X-Patchwork-Delegate: iweiny@gmail.com Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 1BCB5218596 for ; Thu, 7 Nov 2024 20:59:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731013147; cv=none; b=el0xnpGM1zSz4qa+RWqc3qQB0ntSnoTt6KGY3A2NsGSHWk4EpFYnzk0d+VVJAKN1UpZTbyy1fxbzNqt5+kbGdf06rokgdzWHg1oghtaogCMTM/NuH2wBoARLoBkB+BSzpor1AD2qwyOC15G4pbM6G4Tu/eNcIAccWXjZKBKEtKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731013147; c=relaxed/simple; bh=SiMgcrGnVQyiKC7DqMtxFALjaH10RqY0abQa+E/1rcw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oKF+L+VmxAl9tUWBzxs/5WdErp5i3WpW9MXnTVQ+QF02bYy1ORYRSNich6mLHlKnpFEQcUxD6tFiKXxBmcQNIpb/XCZQy9LXSKb/cqkEtl3gviDLNLpLrVLWQHoR9s6NioerJ9j1XVXpuTg9nyte5AJdYRHd9Q/zm3FKIJrwrGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=i9Wu+1dv; arc=none smtp.client-ip=198.175.65.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="i9Wu+1dv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1731013146; x=1762549146; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=SiMgcrGnVQyiKC7DqMtxFALjaH10RqY0abQa+E/1rcw=; b=i9Wu+1dvf6JvM3NnzR+OjZqJzmCb4v3h3qoxw+7KgxMtq4XKjjC4gLL5 aVgpumnLdlfndMuU6EQgo9PSJsEj9e32OaBtYhAvsqDcxgUoA8iaLQpkh ng6IfSIa6aChn//fbjuP2Ie9fN7UkqtFJsb1mpV0VdAjAKO4wURd8nGoe wL1I7y+GHZxVBI0usdLbAPNnSq298ry8RtpuWSy1iHwKH/SpP46EGEe59 Fq36MpD70gWyUz0WOuIjs7HJVIpCmAHnzD98FEPkKFfagagBwwsSajUEs O8Go6sgWjMSv9s1NsyMBljIKVPcMANT7yoC6Er0Y3KWDtq3eDbQOBN9YA Q==; X-CSE-ConnectionGUID: YZMOjjgVTzKtpoHQn8eVbg== X-CSE-MsgGUID: +tLkSLGxRwmQmyXu5I3kSA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="41441048" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="41441048" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2024 12:59:06 -0800 X-CSE-ConnectionGUID: fX/4Md7YSZOMvpLwF8KC6Q== X-CSE-MsgGUID: Gd+VReAbSjWqwBXnPd/s4A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,136,1728975600"; d="scan'208";a="122746027" Received: from aschofie-mobl2.amr.corp.intel.com (HELO localhost) ([10.125.110.195]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2024 12:59:05 -0800 From: Ira Weiny Date: Thu, 07 Nov 2024 14:58:34 -0600 Subject: [PATCH v7 16/27] cxl/events: Split event msgnum configuration from irq setup Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241107-dcd-type2-upstream-v7-16-56a84e66bc36@intel.com> References: <20241107-dcd-type2-upstream-v7-0-56a84e66bc36@intel.com> In-Reply-To: <20241107-dcd-type2-upstream-v7-0-56a84e66bc36@intel.com> To: Dave Jiang , Fan Ni , Jonathan Cameron , Navneet Singh , Jonathan Corbet , Andrew Morton Cc: Dan Williams , Davidlohr Bueso , Alison Schofield , Vishal Verma , Ira Weiny , linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, Li Ming X-Mailer: b4 0.15-dev-2a633 X-Developer-Signature: v=1; a=ed25519-sha256; t=1731013104; l=2685; i=ira.weiny@intel.com; s=20221211; h=from:subject:message-id; bh=SiMgcrGnVQyiKC7DqMtxFALjaH10RqY0abQa+E/1rcw=; b=gLguDKYrKbSjdQLupwC4Tsed76OxA1kxFpSILmqbqIxz0bGggLgY36x1KfZAgTmnGnBkXX2F6 DhAd1QIhN2FBRvLQ/OJcuV9I9VRfZyQTfVGeFQpE6UQgPL2Zy2mmL+n X-Developer-Key: i=ira.weiny@intel.com; a=ed25519; pk=noldbkG+Wp1qXRrrkfY1QJpDf7QsOEthbOT7vm0PqsE= Dynamic Capacity Devices (DCD) require event interrupts to process memory addition or removal. BIOS may have control over non-DCD event processing. DCD interrupt configuration needs to be separate from memory event interrupt configuration. Split cxl_event_config_msgnums() from irq setup in preparation for separate DCD interrupts configuration. Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Reviewed-by: Dave Jiang Reviewed-by: Li Ming Signed-off-by: Ira Weiny --- drivers/cxl/pci.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index c8454b3ecea5c053bf9723c275652398c0b2a195..8559b0eac011cadd49e67953b7560f49eedff94a 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -702,35 +702,31 @@ static int cxl_event_config_msgnums(struct cxl_memdev_state *mds, return cxl_event_get_int_policy(mds, policy); } -static int cxl_event_irqsetup(struct cxl_memdev_state *mds) +static int cxl_event_irqsetup(struct cxl_memdev_state *mds, + struct cxl_event_interrupt_policy *policy) { struct cxl_dev_state *cxlds = &mds->cxlds; - struct cxl_event_interrupt_policy policy; int rc; - rc = cxl_event_config_msgnums(mds, &policy); - if (rc) - return rc; - - rc = cxl_event_req_irq(cxlds, policy.info_settings); + rc = cxl_event_req_irq(cxlds, policy->info_settings); if (rc) { dev_err(cxlds->dev, "Failed to get interrupt for event Info log\n"); return rc; } - rc = cxl_event_req_irq(cxlds, policy.warn_settings); + rc = cxl_event_req_irq(cxlds, policy->warn_settings); if (rc) { dev_err(cxlds->dev, "Failed to get interrupt for event Warn log\n"); return rc; } - rc = cxl_event_req_irq(cxlds, policy.failure_settings); + rc = cxl_event_req_irq(cxlds, policy->failure_settings); if (rc) { dev_err(cxlds->dev, "Failed to get interrupt for event Failure log\n"); return rc; } - rc = cxl_event_req_irq(cxlds, policy.fatal_settings); + rc = cxl_event_req_irq(cxlds, policy->fatal_settings); if (rc) { dev_err(cxlds->dev, "Failed to get interrupt for event Fatal log\n"); return rc; @@ -777,11 +773,15 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge, return -EBUSY; } + rc = cxl_event_config_msgnums(mds, &policy); + if (rc) + return rc; + rc = cxl_mem_alloc_event_buf(mds); if (rc) return rc; - rc = cxl_event_irqsetup(mds); + rc = cxl_event_irqsetup(mds, &policy); if (rc) return rc;