Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Fan Ni <nifan@outlook.com>, <linux-cxl@vger.kernel.org>,
	<dan.j.williams@intel.com>, <vishal.l.verma@intel.com>,
	<a.manzanares@samsung.com>, <nmtadam.samsung@gmail.com>,
	<fan.ni@samsung.com>
Subject: Re: [Question] How to set up DVSEC CXL Range Registers for DCD devices
Date: Tue, 11 Jul 2023 09:19:40 +0100	[thread overview]
Message-ID: <20230711091940.0000533b@Huawei.com> (raw)
In-Reply-To: <qvclgbexammsjxgnoqc7oeeisofl62escgjnzhqdgnapfj4pqi@zcl2jh2slajy>

On Mon, 10 Jul 2023 08:36:39 -0700
Davidlohr Bueso <dave@stgolabs.net> wrote:

> On Thu, 06 Jul 2023, Jonathan Cameron wrote:
> 
> >On Thu, 29 Jun 2023 10:10:48 -0700
> >Fan Ni <nifan@outlook.com> wrote:
> >  
> >> Hi,
> >>
> >> When preparing the DCD patches for QEMU emulation and testing, I hit an issue
> >> when trying to load the cxl modules. The issue happens when the kernel tries
> >> to do cxl pci probe where it checks whether the media is ready
> >> through cxl_await_media_ready. The function will check dvsec mem range.
> >>
> >> In current QEMU code, the dvsec range registers for type3 memdev is set
> >> only for static ram and pmem in function build_dvsecs, which will cause
> >> the kernel fails the check of media ready of DCD devices without static
> >> capacity.
> >>
> >> About the issue, I have following questions that want to ask and
> >> clarify,
> >>
> >> 1. do we allow DCD device have no static (RAM/PMEM) capacity at all and
> >> only dynamic capacity?  
> >
> >Yes.  That will probably be a reasonably common configuration so definitely
> >want that to work.
> >  
> >>
> >> 2. Do we need to set dvsec range registers for dynamic capacity? And how
> >> if needed?  
> >
> >hmm.  I think we should.  Given a DCD device is not an eRCD (though it may
> >be operating in RCD mode) the memory types are all from CDAT - so I think
> >we 'could' use either one or two ranges to cover the DCD range.
> >
> >Desired interleave is messy but it's only a hint anyway so meh.
> >Memory active timeout might potentially be different for say a PMEM region
> >between a volatile range and DCD range but I guess it just needs to be
> >the biggest of anything covered.  
> 
> Btw, we probably want to robustify cxl_await_media_ready() to 1) check for
> Mem_HwInit_Mode=1 and 2) rely more on Memory_Active_Timeout to set the module
> parameter.
> 
> Also, I was under the impression we wouldn't want to set the dvsec for dynamic
> capacity exactly because of the active memory timeout, which makes no sense
> for dcd.

Hmm. Not sure if it makes sense or not - there is still memory and you might
still want to let it finish waking up, even if definition of waking up is
different. Feels like this is a question to take to CXL SSWG for confirmation,
unless someone can find an explicit spec reference to say one way or the other.

Jonathan


> 
> Thanks,
> Davidlohr


  reply	other threads:[~2023-07-11  8:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 17:10 [Question] How to set up DVSEC CXL Range Registers for DCD devices Fan Ni
2023-07-06  1:46 ` Jonathan Cameron
2023-07-10 15:36   ` Davidlohr Bueso
2023-07-11  8:19     ` Jonathan Cameron [this message]
2023-07-12  8:48       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230711091940.0000533b@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=a.manzanares@samsung.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=fan.ni@samsung.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nifan@outlook.com \
    --cc=nmtadam.samsung@gmail.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox