public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Alejandro Lucero Palau <alucerop@amd.com>,
	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 15:16:46 -0600	[thread overview]
Message-ID: <679a9abe292a4_210e3e294d@iweiny-mobl.notmuch> (raw)
In-Reply-To: <074f421c-1f2b-b92e-3e92-c3974f9f471f@amd.com>

Alejandro Lucero Palau wrote:
> 
> <snip>
> 
> >
> >> 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,
> > Why is the accelerator calling cxl_dev_state_identify?  I did not see that
> > in v9.  My idea was that was a mailbox only call which is only needed for
> > memdevs.  And cxl_add_partition() can be called by accelerators as a
> > convenience function to aid in creating cxl_dpa_info.  (This and cxl_test
> > needed that function shared so it just got left in mbox.c)
> 
> 
> No in v9 ... that predates Dan's DPA patches.
> 
> 
> Type2 without an mbox needs to give those values obtained from 
> CXL_MBOX_OP_IDENTIFY. I'm using an struct for passing those values to 
> cxl_dev_state_identify for having same function serving Type2 with and 
> without mbox.

But in the case of no mbox where does the type2 get those values from
within cxl_dev_state_identify()?

The idea with this patch change is to only call cxl_dev_state_identify IFF
the device has a mailbox.  Are you saying the same thing?

> I could have another function instead and calling that one 
> for Type2 with mbox. My idea is to keep similar initialization than 
> Type3 pci driver.

Agreed.  But without an mbox I'm hoping you don't need to call
cxl_dev_state_identify at all if you don't need to query the device...  ie
don't have a mailbox.

> 
> 
> >> and inside that function
> > I'm not clear which 'that function' you are referring to here.
> 
> 
> cxl_dev_state_identify
> 
> 
> >> 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.
> > I think I agree with you except the != 0 to avoid mailbox commands.
> >
> > Unless I am miss-understanding Dan we need to get to a place where mailbox
> > commands stop filling in structures unless those work for both type 2 and
> > 3 __and__ are optional.  Because putting in special checks for the type
> > within a cxl/core/mailbox call is wrong IMO.
> 
> 
> As I said, I can avoid that check with a wrapper for Type2, then only 
> Type2 with mbox and supporting that command (is it mandatory if an 
> mbox?) will end up calling cxl_dev_state_identify.

Even if type 2 has a mailbox the partition information may or may not need
to be in the identify command.

Why force any type 2 to call that mailbox command?

Ira

  reply	other threads:[~2025-01-29 21:17 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
2025-01-29 16:32     ` Ira Weiny
2025-01-29 18:17       ` Alejandro Lucero Palau
2025-01-29 21:16         ` Ira Weiny [this message]
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=679a9abe292a4_210e3e294d@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=alucerop@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --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