From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 8B56447254D for ; Thu, 6 Aug 2026 12:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786019267; cv=none; b=tSsNmJ/DKiHElI10ilXlF+8FmisVWAf5w3I/Hc8C/QmI4xuUaHGancLRCpFjuAyQiKSHFp1FxUnsnGKKojq3/M8/U0Uhdd7K9cQ0rkCNJbGWMuLvRcCYhshA9oPnBnp+o/zyAI+bSEuHpM69pi6aiBCVl+BsYorhJa0kk3ZNuKs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786019267; c=relaxed/simple; bh=zbxbgVABDpAz7Yl9dVLN94U6/Mw6TDrkPy4AolyE644=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sYA+QE6xNLZLFoPx61hGczgLTnl8S3UII3DVdijVhlNEMu23sDzgDj4yb7SSb9NJi2iH+INX+6MxeU2sB/6NIeK35rBfni2Ptq8k9XlmC8AE07vbRt8gzR8CFgw38f+OwDK+FtiSa32nouCLWy9kP9WOsdJy/hReVhJIKCZ+iDM= 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=iB3BVgXR; arc=none smtp.client-ip=209.85.216.53 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="iB3BVgXR" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-38e88b60121so1717411a91.3 for ; Thu, 06 Aug 2026 05:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786019266; x=1786624066; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:date:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=8lGDFFRjFwi4B9aeNDvA48Sw9DPRqkHPcAQDd/V37v8=; b=iB3BVgXRm+IisTx4/yul/sTg8zjpo4Bfl09wJdZ9Hp5Ha7zDj8yQWIf+uKOt7jzJT7 byove/q+0bp6NKLvep+7hNjNph9XDcvOMvRS6zcTNhABgZdiHqpW9sq8SEOpdQazrOOg 65wn5+s/y9tsUqqyOUTjuRDZQtpmO7WT6TgC4j6w6rtmOnlNEl4lEj9NU7ucu0KJjJkk MCAFbsg/LsBY41NLFnQIwv3obBbyZP5wbA/OusS40GUdTWNBE8gfcv43qPewAbXPN3nt vpd8IP//EM8qXvM15yFpVqQJeTfCw8NL/MUGxPwHpY5SfTutFU0WB/ZPri9RPKyYNFZd Dm4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786019266; x=1786624066; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=8lGDFFRjFwi4B9aeNDvA48Sw9DPRqkHPcAQDd/V37v8=; b=hYhZqqitp6s2MIF9S2oCkWpC8rSZY22ens5U+eQXUMOrSz6c43PKpiylxgtlvkyvmC s+ZgkTy4bSRAp1L7wRPeZDZSCo0oN1GW9JQ1ucw/De4ouwQC2nNjte3BEzNXas28oBwO r1Wf4biOCOTJbHPh1Irhd1CK1poaM6uBXfGqhVlAL0MwcsNlESSTvI9DbU4qF7dlX6/+ SmE5w5octEIz9dbgOro35W5SJi1cOlbGffwk6U6Iq1ugf1Pcx93UShIT7dcivTma32rx CJvRYMXnJISWCznUAZE3/VhK3gLs1bFx5geEG7LP9ZTdPHWvIr3bz9Bny9DWISiarb5V hoRw== X-Forwarded-Encrypted: i=1; AHgh+RqkUbj1K4d4OCzpkou0AmV32aS8C/hlGVMqO08TEniM/HGDf0S+Df0o07gwna5UU9e8SuF7qPVZMSGW//w=@vger.kernel.org X-Gm-Message-State: AOJu0Yxj6xOtkh2U4N5B/JVzK9WufHtj+mDW6/WG0l4GcL4VPrF3D0R9 vmD30MUgHwqt6RaBR9L0orcOcBwQQj0+uZQttghXHud77phirn6CfWdW X-Gm-Gg: AR+sD12rPFqHxBdqAyjb2Gwu9XTDr74UueYBTLeZjLC/ffaYJZT6W3KzSNuyvCu7Szr TxCs539AYyCRWy/LBz+0bdACkc8p+Ph6NPB/LqxpxRvQLBtrr2v+tXkv34sUIX0FahXU7QSYFU2 AxJp3uzPosAi2Rzd72iKhfG99XK3AwO4ejVBoWIP2WnQeHVqK1uQJPqWN47uowONvdnZS8XhVGO x/BX1fi/QvesE+yJczXDqMj8Owd/gTXJ6J77yYJTnQj0HQ0+uj7f7w+2at4eCLgK0OxHMUPDGFN AAHoSsbV51c9jDjzPEO4S4bD5NoAgPE1Mcr+KF6a9eBTgAX5ZzQmUZi52maVv0m9IzlPUH6cgFz 4Ey3irdwc/Y+xDIT6MztGKi1nTXMeaWEuJ5httXNhNMlJg03dMiFYcqVHx16IJoNUxaMD89U2WX 08pb1lHmYUeqZQv/jlGpMkzq4AOKUoIEz3fmjn1rwkcbksakKFrt3vRlYp503l8xfmxdrmFikcz +Mz1SIDU+0WwtNaJfaWaC+5++kiL/qxB8Rujp0JKoba X-Received: by 2002:a17:90b:2807:b0:38e:3fdc:62e5 with SMTP id 98e67ed59e1d1-3903c5ee958mr15947483a91.19.1786019265685; Thu, 06 Aug 2026 05:27:45 -0700 (PDT) Received: from AnisaLaptop.localdomain (c-73-170-217-179.hsd1.ca.comcast.net. [73.170.217.179]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39085dbe349sm1485613a91.4.2026.08.06.05.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 05:27:45 -0700 (PDT) From: Anisa Su X-Google-Original-From: Anisa Su Date: Thu, 6 Aug 2026 05:27:42 -0700 To: Alison Schofield Cc: Anisa Su , linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, Dave Jiang , Jonathan Cameron , Fan Ni , Li Ming , Vishal Verma , Davidlohr Bueso , Ira Weiny , Benjamin Cheatham , Wonjae Lee , Junhee Park , Heesoo Kim , Dan Williams Subject: Re: [PATCH v12 5/8] cxl/pci: Factor out interrupt policy check Message-ID: References: <20260731084901.1512819-1-anisa.su@samsung.com> <20260731084901.1512819-6-anisa.su@samsung.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: On Mon, Aug 03, 2026 at 04:55:01PM -0700, Alison Schofield wrote: > On Fri, Jul 31, 2026 at 01:48:10AM -0700, Anisa Su wrote: > > From: Ira Weiny > > > > 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. > > > > Factor out event interrupt setting validation. > > Hi Anisa, > > "Validation" seems like the wrong term here. The helper checks for > firmware ownership of the memory event logs. It is not validating > the event interrupt settings. > Fixed. Commit message now reads Factor out the check for firmware ownership of the memory event logs. > Which leads to my next comment - > > snip > > > > > > +static bool cxl_event_validate_mem_policy(struct cxl_memdev_state *mds, > > + struct cxl_event_interrupt_policy *policy) > > +{ > > + if (cxl_event_int_is_fw(policy->info_settings) || > > + cxl_event_int_is_fw(policy->warn_settings) || > > + cxl_event_int_is_fw(policy->failure_settings) || > > + cxl_event_int_is_fw(policy->fatal_settings)) { > > + dev_err(mds->cxlds.dev, > > + "FW still in control of Event Logs despite _OSC settings\n"); > > + return false; > > + } > > + > > + return true; > > +} > > Why such a general name here? This helper seems to have one very specific purpose. > > cxl_event_validate_mem_policy() doesn't validate the policy. It checks whether > firmware still owns the standard memory event logs despite _OSC granting OS > control. I'd prefer naming it after that condition rather than "validate". > Something like cxl_event_fw_owns_mem_logs() reads much closer to what the > code actually does. > Renamed -- Naming it after the condition means the return value has to invert, since true now means firmware does own them: static bool cxl_event_fw_owns_mem_logs(struct cxl_event_interrupt_policy *policy) { return cxl_event_int_is_fw(policy->info_settings) || cxl_event_int_is_fw(policy->warn_settings) || cxl_event_int_is_fw(policy->failure_settings) || cxl_event_int_is_fw(policy->fatal_settings); } so the caller loses its '!': if (cxl_event_fw_owns_mem_logs(&policy)) { dev_err(mds->cxlds.dev, "FW still in control of Event Logs despite _OSC settings\n"); return -EBUSY; } and I moved the dev_err out to the caller so cxl_event_fw_owns_mem_logs() only answers the question "Does the FW own event logs?" Thanks, Anisa > --Alison > > > > + > > static int cxl_event_config(struct pci_host_bridge *host_bridge, > > struct cxl_memdev_state *mds, bool irq_avail) > > { > > @@ -661,14 +676,8 @@ static int cxl_event_config(struct pci_host_bridge *host_bridge, > > if (rc) > > return rc; > > > > - if (cxl_event_int_is_fw(policy.info_settings) || > > - cxl_event_int_is_fw(policy.warn_settings) || > > - cxl_event_int_is_fw(policy.failure_settings) || > > - cxl_event_int_is_fw(policy.fatal_settings)) { > > - dev_err(mds->cxlds.dev, > > - "FW still in control of Event Logs despite _OSC settings\n"); > > + if (!cxl_event_validate_mem_policy(mds, &policy)) > > return -EBUSY; > > - } > > > > rc = cxl_event_config_msgnums(mds, &policy); > > if (rc) > > -- > > 2.43.0 > >