All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhi Wang <zhiw@nvidia.com>
To: Dan Williams <dan.j.williams@intel.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Cc: "alison.schofield@intel.com" <alison.schofield@intel.com>,
	"dave.jiang@intel.com" <dave.jiang@intel.com>,
	"dave@stgolabs.net" <dave@stgolabs.net>,
	"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
	"ira.weiny@intel.com" <ira.weiny@intel.com>,
	"vishal.l.verma@intel.com" <vishal.l.verma@intel.com>,
	Andy Currid <ACurrid@nvidia.com>, Neo Jia <cjia@nvidia.com>,
	Surath Mitra <smitra@nvidia.com>,
	Ankit Agrawal <ankita@nvidia.com>,
	Aniket Agashe <aniketa@nvidia.com>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	"Tarun Gupta (SW-GPU)" <targupta@nvidia.com>,
	"zhiwang@kernel.org" <zhiwang@kernel.org>
Subject: Re: [PATCH] cxl: read MEMDEV_STATUS register iff the device has it
Date: Thu, 12 Dec 2024 19:41:44 +0000	[thread overview]
Message-ID: <4f2e1930-bdef-410d-a9b1-3fcf6c46424a@nvidia.com> (raw)
In-Reply-To: <675b39f177675_3e0fe29471@dwillia2-mobl3.amr.corp.intel.com.notmuch>

On 12/12/2024 21.30, Dan Williams wrote:
> Zhi Wang wrote:
>> Before accessing the CXL device memory after reset/power-on, the driver
>> needs to ensure the device memory media is ready.
>>
>> However, not every CXL device implements the CXL memory device register
>> groups. E.g. a CXL type-2 device. Thus calling cxl_await_media_ready()
>> on these devcie will lead to a kernel panic. This problem was found when
>> testing the emulated CXL type-2 device without a CXL memory device
>> register.
> 
> Why is a type-2 driver, that should know the device's capabilities like
> missing typical type-3 registers calling cxl_await_media_ready() that
> has type-3 assumptions?
> 
> These feels like a band-aid for a higher level issue, no?

I think the reason that we would like to tweak cxl_await_media_ready() 
to be usable for type-2 is: even a type-2 might not have CXL memory 
device register group for the MEMDEV_STATUS register to justify "media 
ready", the rest parts in cxl_await_media_ready() are still valid for a 
type-2. E.g. MEM_{VALID, ACTIVE} bits in DVSEC_RANGE* registers. A 
type-2 with HDM decoder support shows the "media ready" via those registers.

Z.

  reply	other threads:[~2024-12-12 19:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 12:39 [PATCH] cxl: read MEMDEV_STATUS register iff the device has it Zhi Wang
2024-12-12 15:45 ` Dave Jiang
2024-12-12 17:14   ` Li Ming
2024-12-12 17:55     ` Dave Jiang
2024-12-12 18:02       ` Zhi Wang
2024-12-12 18:04       ` Alejandro Lucero Palau
2024-12-13  3:16         ` Li Ming
2024-12-12 19:30 ` Dan Williams
2024-12-12 19:41   ` Zhi Wang [this message]
2024-12-12 20:02     ` Dan Williams

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=4f2e1930-bdef-410d-a9b1-3fcf6c46424a@nvidia.com \
    --to=zhiw@nvidia.com \
    --cc=ACurrid@nvidia.com \
    --cc=alison.schofield@intel.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=cjia@nvidia.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kwankhede@nvidia.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=smitra@nvidia.com \
    --cc=targupta@nvidia.com \
    --cc=vishal.l.verma@intel.com \
    --cc=zhiwang@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.