From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 117E2390990 for ; Thu, 11 Jun 2026 18:19:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781201995; cv=none; b=t+q0qUI9efrZf9+3W7If1CkDqXdO8DrsSKvYmwRDTo9iej+s6AreWw0HA0vM4t7RJEq211Lz0gl6AYPuN/x7RjzHtkw85JeoewsdkHhWfQQ2brr76ACEY0hxqMhk0Ngn/ylyi3vc6cmI8nuyNIfmlEsHnY2kP1QAqsoYQr4bSPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781201995; c=relaxed/simple; bh=1omX2rC5hpD8TszoQX/iIoOUdNYlcNz3F7LNrVXmo3Y=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tsOpI+nCh2J8x8wsP2c3lFf0132+tAapyw74dSXFkKeOetExI6lOW16dI3hwauR4JITXVM0hWEDDXWjZS1coE5N0xthmShWzZ5VKD6JC0jDJnixMIGtGSNUyCjDhBdUXUfPAWTdB8VPv5FfQ/n/wv1IQTpw/jOQOJwhLZ9tbBmA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qFbuFGDq; arc=none smtp.client-ip=209.85.128.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qFbuFGDq" Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-7dfceeaf168so2081697b3.0 for ; Thu, 11 Jun 2026 11:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781201993; x=1781806793; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=ddH+eXH24NtmehhRI7L/9GO3TOPMJUuuZMHBikOY13M=; b=qFbuFGDqoJKOcpMZ2Ham0lBi5yKdvkYgiLMbE1efwDo2BEIvM1wR3A3TFVNE1f9LKS BZfVnQkqsa0Umh8RWTbY7UG6a6xHFNyCmZiVnnh/jflGZa97+AmrCyt0Yp/BcXJdQLtr 13yiyG4NuCVN4Nbq4Yel1Q6emDLgKDArRmCkpR3hthzy3qbXmR6zmIELcgJUpCfMkmej fIZpDQk8Dlaw/H7icpNDrzHurBKEQz0wguVjAN5++dWphaasP641ZwMBq1OeF1VNm44a Q6jVGZVl2iHzD4s7xpwM9d6FxtSc3A0hyBMCStQB/XpLXFKL8q37Pn3G6mDv/bmuI+7s bA2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781201993; x=1781806793; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ddH+eXH24NtmehhRI7L/9GO3TOPMJUuuZMHBikOY13M=; b=qiv5nQi3+/kTuWcqhqA7oudwC+W3XW5c2JBN7OHjwYApZaGDq7M90v0oXsTbvpODcB qzMfuEGTbPyhLx+ucKhQIkEvBfNRPM8x/ggD3sG+ewjKwItb4n42ZyCvu/5m49j4c/a7 qFHdsu10443orX+jLObba5J5Rh2YxlFUi3gqGOgH3gWXmT47MVa28Y/03uI2cCTLLnI5 yMPXeXso6crIoXdjg/o2R6xSOwIXtLlp2/3o1AlwRplkGmBT16eSt8YW66ORB3jkcrUB r/o0GCeWmwmOxNvQ6CBT4dSSqxcCEqVtgfXjbNIoF3+SwCuo6EKZZH+dl8rMFEkBjJlH HKUg== X-Forwarded-Encrypted: i=1; AFNElJ9hvsTCGIjFbMXhBCB1IRWtjdYWr/zgsHkdaBWlTG2UStto8KkKHRevwSJS2KUNirFQEQbitrAUT5WKs0Q=@vger.kernel.org X-Gm-Message-State: AOJu0YzQqqM1JdK4wSZzmO6cEsp9egc7pQDjv/geUCQ9Ofnj9x7BWm3m QG7/Q5Hnerm689MumrszSQUTT5oFFsRA51z0kPcB3eo0T6q7F46MuM+R X-Gm-Gg: Acq92OHugk6heOrnxql8UkdPyHdZHXiTSaLaX240NpMvADEJ8+tLIcSHKLL4vXsGoBD P5ramLwZiX7h4utMC9wQoPlJXQwiHXYWEFb1BCx8byg24Gx//hUV+7iJK93AkLMUWW9Y6JwqvaX ycjWoblbeRAyvNM0dDQU3tVQw5ut9rlaF6Kj+eJaBA4FHWNuyObrCVN2lgIdVfwSCtv78dwqy8C KqyTc6dpqpK7rupBAYyGxko7BFUWhf9O+2c5q+bFe+YH4VQX9Ex2LfqnLzVkCqDXB0JQH4887Eo q5Ies6tBh9JxMU18t58eiymcKk5hBLtVZi8V9+gPz0zC9pN1n7HLU1N0diGvkHXWrCrc9CSoyLH ljkHUwXVxK4UIb1b2Nq8hJb+U4rBgXnpY4lWErueqWuJyZGyKfiI0qiDb3jX1zN8QUQrML/cqDU 8rl3O1fXmddI3c5IxWc4srqdQ+IEzee19K0X6knMWq1w== X-Received: by 2002:a05:690c:e3ef:b0:7dc:a5a8:8b8 with SMTP id 00721157ae682-7f6553fa56amr44840507b3.7.1781201992856; Thu, 11 Jun 2026 11:19:52 -0700 (PDT) Received: from 4470NRD-ASU.ssi.samsung.com ([50.205.20.42]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7f76e2b5564sm1275747b3.6.2026.06.11.11.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2026 11:19:52 -0700 (PDT) From: Anisa Su X-Google-Original-From: Anisa Su Date: Thu, 11 Jun 2026 11:19:50 -0700 To: Dave Jiang Cc: Anisa Su , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, Dan Williams , Jonathan Cameron , Davidlohr Bueso , Vishal Verma , Ira Weiny , Alison Schofield , John Groves , Gregory Price , Ira Weiny Subject: Re: [PATCH v10 10/31] cxl/mem: Configure dynamic capacity interrupts Message-ID: References: <7f2e4fe385415e0b77b58f4bd988bc5895557dcf.1779528761.git.anisa.su@samsung.com> <28a8e58d-5bf8-438e-b337-76944d67e297@intel.com> <9c3ab868-27b7-4d33-865b-9308269f764f@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c3ab868-27b7-4d33-865b-9308269f764f@intel.com> On Wed, Jun 10, 2026 at 09:57:35AM -0700, Dave Jiang wrote: > > > On 6/8/26 1:16 AM, Anisa Su wrote: > > On Thu, May 28, 2026 at 09:21:59AM -0700, Dave Jiang wrote: > >> > >> > >> On 5/23/26 2:43 AM, Anisa Su wrote: > >>> From: Ira Weiny > >>> > >>> Dynamic Capacity Devices (DCD) support extent change notifications > >>> through the event log mechanism. The interrupt mailbox commands were > >>> extended in CXL 3.1 to support these notifications. Firmware can't > >>> configure DCD events to be FW controlled but can retain control of > >>> memory events. > >>> > >>> Configure DCD event log interrupts on devices supporting dynamic > >>> capacity. Disable DCD if interrupts are not supported. > >>> > >>> Care is taken to preserve the interrupt policy set by the FW if FW first > >>> has been selected by the BIOS. > >>> > >>> Accept the 4-byte CXL 2.0 reply on GET Event Interrupt Policy by setting > >>> min_out to CXL_EVENT_INT_POLICY_BASE_SIZE; pre-CXL 3.1 firmware omits > >>> dcd_settings and would otherwise fail the size check. > >>> > >>> Based on an original patch by Navneet Singh. > >>> > >>> Signed-off-by: Ira Weiny > >>> Signed-off-by: Anisa Su > >>> > >>> --- > >>> Changes: > >>> [anisa: rebase] > >>> [anisa: accept 4-byte CXL 2.0 GET reply via min_out] > >>> [anisa: drop Reviewed-by tags now that the patch carries new changes] > >>> --- [snip] > >>> static int cxl_event_config(struct pci_host_bridge *host_bridge, > >>> struct cxl_memdev_state *mds, bool irq_avail) > >>> { > >>> - struct cxl_event_interrupt_policy policy; > >>> + struct cxl_event_interrupt_policy policy = { 0 }; > >>> + bool native_cxl = host_bridge->native_cxl_error; > >>> int rc; > >>> > >>> /* > >>> * When BIOS maintains CXL error reporting control, it will process > >>> * event records. Only one agent can do so. > >>> + * > >>> + * If BIOS has control of events and DCD is not supported skip event > >>> + * configuration. > >>> */ > >>> - if (!host_bridge->native_cxl_error) > >>> + if (!native_cxl && !cxl_dcd_supported(mds)) > >>> return 0; > >>> > >>> if (!irq_avail) { > >>> dev_info(mds->cxlds.dev, "No interrupt support, disable event processing.\n"); > >>> + if (cxl_dcd_supported(mds)) { > >>> + dev_info(mds->cxlds.dev, "DCD requires interrupts, disable DCD\n"); > >>> + cxl_disable_dcd(mds); > >>> + } > >>> return 0; > >>> } > >>> > >>> @@ -676,10 +721,10 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge, > >>> if (rc) > >>> return rc; > >>> > >>> - if (!cxl_event_validate_mem_policy(mds, &policy)) > >>> + if (native_cxl && !cxl_event_validate_mem_policy(mds, &policy)) > >>> return -EBUSY; > >>> > >>> - rc = cxl_event_config_msgnums(mds, &policy); > >>> + rc = cxl_event_config_msgnums(mds, &policy, native_cxl); > >>> if (rc) > >>> return rc; > >>> > >>> @@ -687,12 +732,16 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge, > >>> if (rc) > >>> return rc; > >>> > >>> - rc = cxl_event_irqsetup(mds, &policy); > >>> + rc = cxl_irqsetup(mds, &policy, native_cxl); > >>> if (rc) > >>> return rc; > >>> > >>> cxl_mem_get_event_records(mds, CXLDEV_EVENT_STATUS_ALL); > >> > >> Issue that was always there probably, should this check native_cxl so the BIOS owned events are not retrieved? > >> > >> if (native_cxl) > >> cxl_mem_get_event_records(mds, CXLDEV_EVENT_STATUS_ALL); > >> > >> > > That makes sense. Would you prefer the fix as a separate patch? > > Yes please. > > DJ > Oops I was wrong; the issue wasn't there before. This function used to return 0 if !native_cxl at the top of the function but this patchset added && !cxl_dcd_supported() to the condition. Added the fix to this commit. Thanks, Anisa