From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796330561; b=AXrYlSE2cDMAjKtOimHGHeEEUO5trHladFj4qq+Wbr7lu7byvlC4/tff/eDu51wt1l6R H/3nKZZpQkQBVqC6ImyaIS0hM2ErT0RpzBuWTulzZccBcMHnH4cWdal6QYwo88tCY6IFa hNvbdbkF6/4RlvOWcgTTLirHy5ROxGF/x2QQA7ctu6w5/MeSWREhe3zxs3DjWx3B4EH+D nbflYDfC9W8WJtYxOGdbdBnLQlLXbf3B2LtbA++i2x1ZA+IxGIgOKYU43EunaO7pkeIQQ YCJFzOjAUwrcBzdqxL+e10r8ow2NA3RJfbYM4ISpJNa00m7HNBSU/+63lRKS7Ojpy4w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796330561; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:X-Google-Original-From:Date:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=4zGJAGOLR0EBRp/iPw3zUeOLFLQ23r8bOrSQ8jbKsis=; b=C7IlRPw0pjIYQjetdYD2D8CvN5MVQwEgyAjaXJ9rn1+uEqBV4NpBgMlwwBVYErp6kI0Z ztQEw4zFqjmyVGHT5mLNnoe9t7KRYplwgKrFgxSbVasHjlrfh/NqblPFT2VjXCq5PYsml m1p1mFJUvXPBQBO7FdWQAsCzO7ENZDLh8o6xqY2lG8t4s6nRxxXXQkgos469ySEHNGx47 aabr83qAHto175OoCV8r/Zz7+GslSasuusl/KQwJEt+UzoCE8I30kq8vWVlrdguKPYqDw SlwRXOeIRe/LQ/02P/0Ldp0pojb5ITeaEsZMFMTiuc/+JQGTYgEl7A9Mi4PU6VAshXQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Rhf3YF8L; arc=none smtp.remote-ip=209.85.214.174 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD096606A334 for ; Thu, 3 Dec 2026 20:42:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AD096606A334 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.a=rsa-sha256 header.s=20260707 header.b=Rhf3YF8L Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2f04bea9a93so2923085ad.3 for ; Thu, 03 Dec 2026 12:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796330560; x=1796935360; 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=4zGJAGOLR0EBRp/iPw3zUeOLFLQ23r8bOrSQ8jbKsis=; b=Rhf3YF8Lkg1FB41F4O5xn4nnI98BmrLfNwK6+YhzIP5e3kbl0YwYWB2OxXV8cS96/t t7Sf/FlEZEgB3AuA4JYpWFEac66Zvy3stkvyouGDYib3q7yMgcyF1KDYtnGgwkHQN1Qm sGpYFYlSE+leqWn0fOlaa6pFwAaC4xj9ICh6XRpy7no97qe6FoJf2G20hUK7DTBoi3Jh vrdCak2T3c/Sz1eyjoYMpsUt/TeXwNFAmYUw5bJ2Xm/IWWvoj/etMZzqoVtHOTvE834a KMUFutH3WvuzCCQJmV09TxPgX3Vd570i49jc6wYDEVO1wJvGcecvCBtBbSEygEK14uX8 eC9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796330560; x=1796935360; 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=4zGJAGOLR0EBRp/iPw3zUeOLFLQ23r8bOrSQ8jbKsis=; b=KK5pW03d7D40Z5SsxZ4Jzx+4M41JtsJ69pLs9U2J7OkDO568oiMPaK/vTu7jacoM+u OMqTFe7CKnVcJuaTR8DxEbH+/pF7fuQ34qGUxf5Gj6w/ZHI2qdCr+K9VWw+5OXoIS7Ic 8dyvs/933bsNWXKDPkHa/VRYML1YGGae+Ez7XbO3XHMj69KmkHQgSBA6tAkDvBsPNhPY t4Yly8BcLUBFMat35DSKJY0Hfdl8cG390tMcsFKvl5AGGwzq//Vy9+661UdsYFfJHpDA OLEcPfFfzhEcDm1Wyu8Zf2YNTtOv9kg2R0M+YwPfS/mkiMgSBEd4toKmAT+PA7uCGHPk /7Lw== X-Forwarded-Encrypted: i=1; AL+hErGnSaLbfzAHhX4WuVBdxiDXzXY2CLZB5lUElLpi8YDoAcX87eX+kkT0iig7Jbwhz7qr4zCBUufWFOI=@vger.kernel.org X-Gm-Message-State: APuU4Z9jECgigmbqddrr9ev82gM1LZh7aGtd7bW6fNKLz8qTP41Q4uUq HnpGMcETVp9JMw4Q0TmWx1aOWNHsBLn9U9E0kqKdr4H9MoNcmo8xvwM2 X-Gm-Gg: AZFdTZdBZy18QBOgoYhaDTTxmulGb2dKtOEGzgsxaHNtHsEy/9a5JQLvfHxi83ekck2 aFwgpsswU/oRw8YlAyCVkyYP9Xb5ic1HvCbtz7JILdfRSAZkyGK4MlGGDb3l2g+ET0Y3GN5Zsgb UYWZB5N2KrrXh1EqT4Oc8rsa0Jx6sm0WruaAA7KQX9wsGl3XU8PlGrYJpAzof+rHu/ctwDD/CQM lrPK9G5jK9HrQ43wfMY1WtvC6h6Xr3l2R5H1TxwfQ3e061aVy4HNoJChWbtpAzNl9oLn4bEWMdw qy1w9uXHR99f4mZ19fVbUzcSb7SH/JvXTRdULDqDjDeJph5vIYZyhTNE52ql1dn5LyrMw7G1VwR 6SYuoBUpnwBFjAcFKIiRkrEgkXw5I+VH/eIRBGJIU1Va6u5EujDqCi9J1WGOguzNVVED1vMkjCy NYdtREAj/FBgEuH7TZwtnYjB7SNaplLYMGwN3hC2gDMNkjBQZciWno9cFgzitzi7TSRCYSaiulW rcKrhX+1i9htL8JNgs8YtFChRIuWCp29AAdlMgNjcXDFWeexdNFEhU77IMiNlEjOFYbK0tcraKF M6CkPSqFvE41GruEBm05qirrAw== X-Received: by 2002:a17:903:19cb:b0:2e9:3dd0:c8d with SMTP id d9443c01a7336-2f03f1cf44emr500404205ad.14.1796330559906; Thu, 03 Dec 2026 12:42:39 -0800 (PST) Received: from cxlqual ([220.120.90.131]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b79422f6sm269265ad.53.2026.12.03.12.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 12:42:39 -0800 (PST) From: Anisa Su X-Google-Original-From: Anisa Su Date: Fri, 4 Dec 2026 05:44:32 +0900 To: Jonathan Cameron Cc: Anisa Su , linux-cxl@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, Dave Jiang , Alison Schofield , Davidlohr Bueso , Ira Weiny , Vishal Verma , Fan Ni , Li Ming , Benjamin Cheatham , Gregory Price , Richard Cheng Subject: Re: [PATCH v1 02/14] cxl/port: Add dynamic capacity options to endpoint decoder mode Message-ID: References: <20261104230445.66625-1-anisa.su@samsung.com> <20261104230445.66625-3-anisa.su@samsung.com> <20261117022228.43725ce7@jic23-hlaptop> X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261117022228.43725ce7@jic23-hlaptop> On Tue, Nov 17, 2026 at 02:22:28AM +0000, Jonathan Cameron wrote: > On Thu, 5 Nov 2026 08:02:26 +0900 > Anisa Su wrote: > > > Endpoints can now carry a dynamic ram partition following the > > persistent memory partition. A DC partition is further described by > > two properties reported in its CDAT DSMAS entry: shareable and > > read-only. > > > > Expand the decoder mode to accept 'dynamic_ram', 'dynamic_ram_shared', > Time to argue about bikeshed colors. > > So we want the subtle distinction between shared and shareable? > Shared implies it is happening, shareable that it might. > > I don't really care either way. > Went with shareable for v2. > > 'dynamic_ram_ro' and 'dynamic_ram_shared_ro'. cxl_dpa_set_part() > > selects the first dynamic ram partition whose properties match exactly. > > > > DCD may be disabled during validation after the DC partition(s) were > > added to the DPA layout, so a decoder may only be assigned to a DC > > partition while DCD is enabled for its memdev. Add a helper, > > cxled_dcd_enabled(), to check cxl_dcd_supported(). > > > > Signed-off-by: Anisa Su > > Tested-by: Wonjae Lee > > Tested-by: Junhee Park > > Tested-by: Heesoo Kim > > --- > > Documentation/ABI/testing/sysfs-bus-cxl | 25 +++++++---- > > drivers/cxl/core/core.h | 23 ++++++++++- > > drivers/cxl/core/hdm.c | 21 ++++++++-- > > drivers/cxl/core/port.c | 55 ++++++++++++++++++++++--- > > 4 files changed, 105 insertions(+), 19 deletions(-) > > > > diff --git a/Documentation/ABI/testing/sysfs-bus-cxl b/Documentation/ABI/testing/sysfs-bus-cxl > > index 7352dbd70bc7..bcbc44fea6db 100644 > > --- a/Documentation/ABI/testing/sysfs-bus-cxl > > +++ b/Documentation/ABI/testing/sysfs-bus-cxl > > @@ -339,22 +339,29 @@ Description: > > > > > > What: /sys/bus/cxl/devices/decoderX.Y/mode > > -Date: May, 2022 > > -KernelVersion: v6.0 > > +Date: May, 2022, November, 2026 > > +KernelVersion: v6.0, v7.5 (dynamic_ram) > > Contact: linux-cxl@vger.kernel.org > > Description: > > (RW) When a CXL decoder is of devtype "cxl_decoder_endpoint" it > > translates from a host physical address range, to a device > > local address range. Device-local address ranges are further > > - split into a 'ram' (volatile memory) range and 'pmem' > > - (persistent memory) range. The 'mode' attribute emits one of > > - 'ram', 'pmem', or 'none'. The 'none' indicates the decoder is > > - not actively decoding, or no DPA allocation policy has been > > - set. > > + split into a 'ram' (volatile memory) range, 'pmem' (persistent > > + memory) range, and dynamic capacity ranges. The 'mode' > > + attribute emits one of 'ram', 'pmem', 'none', or a dynamic > > + capacity selector: 'dynamic_ram', 'dynamic_ram_shared', > > + 'dynamic_ram_ro' or 'dynamic_ram_shared_ro', composed from the > > + shareable and read-only properties of the partition the decoder > > + points at. The 'none' indicates the decoder is not actively > > + decoding, or no DPA allocation policy has been set. > > > > 'mode' can be written, when the decoder is in the 'disabled' > > - state, with either 'ram' or 'pmem' to set the boundaries for the > > - next allocation. > > + state, with 'ram', 'pmem', or one of the dynamic capacity > > + selectors to set the boundaries for the next allocation. A > > + selector picks the first dynamic capacity partition whose > > + shareable and read-only properties match it exactly, and is > > + accepted only while the driver has dynamic capacity enabled > > + for the device. > > > > > > What: /sys/bus/cxl/devices/decoderX.Y/dpa_resource > > diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h > > index 8a81be004d00..24fbb5718abc 100644 > > --- a/drivers/cxl/core/core.h > > +++ b/drivers/cxl/core/core.h > > @@ -6,6 +6,7 @@ > > > > #include > > #include > > +#include > > > > extern const struct device_type cxl_nvdimm_bridge_type; > > extern const struct device_type cxl_nvdimm_type; > > @@ -18,6 +19,25 @@ enum cxl_detach_mode { > > DETACH_INVALIDATE, > > }; > > > > +static inline struct cxl_memdev_state * > > +cxled_to_mds(struct cxl_endpoint_decoder *cxled) > > +{ > > + struct cxl_memdev *cxlmd = cxled_to_memdev(cxled); > > + > > + return to_cxl_memdev_state(cxlmd->cxlds); > > +} > > + > > +/* Type-2 devices have no memdev state; nothing else leaves @cxlds NULL here */ > > Seems like an odd comment given cxlds isn't visibly used in here. > Perhaps needs to refer to it via a specific path? > Oops, meant to say mds is NULL for Type-2. Reworded to: "Type-2 devices have no memdev state, so @mds is NULL for them". > > +static inline bool cxled_dcd_enabled(struct cxl_endpoint_decoder *cxled) > > +{ > > + struct cxl_memdev_state *mds = cxled_to_mds(cxled); > > + > > + return mds && cxl_dcd_supported(mds); > > +} > > > > diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c > > index f3705ea44db7..9b71b58d4e36 100644 > > --- a/drivers/cxl/core/port.c > > +++ b/drivers/cxl/core/port.c > > @@ -203,6 +203,40 @@ static ssize_t target_list_show(struct device *dev, > > } > > static DEVICE_ATTR_RO(target_list); > > > > +/* Dynamic capacity selectors: the flags name one kind of DC partition */ > > +static const struct { > > + const char *name; > > + bool shareable; > > + bool read_only; > > +} cxl_dc_modes[] = { > > + { "dynamic_ram", false, false }, > > + { "dynamic_ram_shared", true, false }, > > This rather highlights the disconnect in naming. > Yep, renamed all to shareable Thanks, Anisa > > + { "dynamic_ram_ro", false, true }, > > + { "dynamic_ram_shared_ro", true, true }, > > +}; > > + > >