From: Alejandro Lucero Palau <alucerop@amd.com>
To: Ira Weiny <ira.weiny@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>
Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] cxl/memdev: Remove temporary variables from cxl_memdev_state
Date: Wed, 29 Jan 2025 09:08:02 +0000 [thread overview]
Message-ID: <783abee1-e06d-45bf-2dc9-920c729978de@amd.com> (raw)
In-Reply-To: <20250128-rfc-rearch-mem-res-v1-2-26d1ca151376@intel.com>
On 1/28/25 18:51, Ira Weiny wrote:
> As was mentioned by Dan[1] cxl_memdev_state stores values which are only
> used during device probe. This clutters the data structure and is a
> hindrance on code maintenance. Those values are best handled with
> temporary variables.
>
> Adjust the query of memory devices to read byte sizes in one call which
> takes partition information into account. Use the values to create
> partitions for device state initialization. Take care to separate the
> mailbox queries from the initialization of device state to steer the
> mbox code toward taking mailbox objects rather than memdev states.
> Update spec references while changing these calls.
>
> Link: https://lore.kernel.org/all/67871f05cd767_20f32947f@dwillia2-xfh.jf.intel.com.notmuch/ [1]
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Alejandro Lucero <alucerop@amd.com>
FWIW, I had (as part of current in-progress v10) similar struct than
used here for Type2 initialization when there is no mailbox.
I had added a specific function for initialising that struct, but my
idea now with this change is to have cxl_mem_dev_info initialized by the
driver before calling cxl_dev_state_identify, and inside that function
checking if total_bytes already != 0 for avoiding call the mbox command
for getting the info. This will support both cases for Type2, with and
without mailbox.
next prev parent reply other threads:[~2025-01-29 9:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 18:51 [PATCH RFC 0/2] cxl: Further clean up of memdev state Ira Weiny
2025-01-28 18:51 ` [PATCH RFC 1/2] cxl/memdev: Remove unused partition values Ira Weiny
2025-01-29 8:58 ` Alejandro Lucero Palau
2025-01-29 15:09 ` Davidlohr Bueso
2025-01-29 16:51 ` Dave Jiang
2025-01-30 13:44 ` Jonathan Cameron
2025-02-04 20:59 ` Dan Williams
2025-02-04 23:59 ` Fan Ni
2025-01-28 18:51 ` [PATCH RFC 2/2] cxl/memdev: Remove temporary variables from cxl_memdev_state Ira Weiny
2025-01-29 9:08 ` Alejandro Lucero Palau [this message]
2025-01-29 16:32 ` Ira Weiny
2025-01-29 18:17 ` Alejandro Lucero Palau
2025-01-29 21:16 ` Ira Weiny
2025-01-29 16:52 ` Dave Jiang
2025-01-30 0:15 ` Davidlohr Bueso
2025-01-30 13:52 ` Jonathan Cameron
2025-01-30 15:14 ` Ira Weiny
2025-02-04 21:39 ` Dan Williams
2025-02-04 23:37 ` Ira Weiny
2025-02-05 0:15 ` Dan Williams
2025-02-05 9:01 ` Alejandro Lucero Palau
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=783abee1-e06d-45bf-2dc9-920c729978de@amd.com \
--to=alucerop@amd.com \
--cc=alison.schofield@intel.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=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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