[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0074a468-b324-a015-b346-2c49332d161b@amd.com>
Date: Fri, 24 Jan 2025 13:38:07 +0000
From: Alejandro Lucero Palau <alucerop@....com>
To: Dan Williams <dan.j.williams@...el.com>, alejandro.lucero-palau@....com,
linux-cxl@...r.kernel.org, netdev@...r.kernel.org, martin.habets@...inx.com,
edward.cree@....com, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, edumazet@...gle.com, dave.jiang@...el.com
Subject: Re: [PATCH v8 01/27] cxl: add type2 device basic support
On 1/8/25 01:33, Dan Williams wrote:
> Dan Williams wrote:
>> alejandro.lucero-palau@ wrote:
>>> From: Alejandro Lucero <alucerop@....com>
>>>
>>> Differentiate CXL memory expanders (type 3) from CXL device accelerators
>>> (type 2) with a new function for initializing cxl_dev_state.
>>>
>>> Create accessors to cxl_dev_state to be used by accel drivers.
>>>
>>> Based on previous work by Dan Williams [1]
>>>
>>> Link: [1] https://lore.kernel.org/linux-cxl/168592160379.1948938.12863272903570476312.stgit@dwillia2-xfh.jf.intel.com/
>>> Signed-off-by: Alejandro Lucero <alucerop@....com>
>>> Co-developed-by: Dan Williams <dan.j.williams@...el.com>
>>> Reviewed-by: Dave Jiang <dave.jiang@...el.com>
>>> Reviewed-by: Fan Ni <fan.ni@...sung.com>
>> This patch causes
> Whoops, forgot to complete this thought. Someting in this series causes:
>
> depmod: ERROR: Cycle detected: ecdh_generic
> depmod: ERROR: Cycle detected: tpm
> depmod: ERROR: Cycle detected: cxl_mock -> cxl_core -> cxl_mock
> depmod: ERROR: Cycle detected: encrypted_keys
> depmod: ERROR: Found 2 modules in dependency cycles!
>
> I think the non CXL ones are false likely triggered by the CXL causing
> depmod to exit early.
>
> Given cxl-test is unfamiliar territory to many submitters I always offer
> to fix up the breakage. I came up with the below incremental patch to
> fold in that also addresses my other feedback.
snip
>
> -struct cxl_memdev_state *cxl_memdev_state_create(struct device *dev)
> +struct cxl_memdev_state *cxl_memdev_state_create(struct device *dev, u64 serial, u16 dvsec)
> {
> struct cxl_memdev_state *mds;
I wonder if we need to differentiate this initialization from ...
>
> -struct cxl_dev_state *cxl_accel_state_create(struct device *dev)
> +void cxl_dev_state_init(struct cxl_dev_state *cxlds, struct device *dev,
> + enum cxl_devtype type, u64 serial, u16 dvsec)
> {
... this one for a Type2 device. It is for sure needed for Type1, but I
think it can be shared with Type2 since there is a mem, a pmem or both
for Type2. The only thing to be different is the memory type.
This helps with cxl_mem_dpa_fetch being called by accel drivers with a
mailbox supporting the CXL_MBOX_OP_GET_PARTITION_INFO command, and for
those with no mailbox the same information can already be there
hardcoded by the accel driver, same for those values obtained from the
CXL_MBOX_OP_IDENTIFY command. That function would need an extra param
for not requiring the CXL_MBOX_OP_GET_PARTITION_INFO command implying
all needed cxl_memdev_state fields already initialized.
Powered by blists - more mailing lists