Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Saeed Mahameed <saeed@kernel.org>
Cc: linux-cxl@vger.kernel.org, dan.j.williams@intel.com,
	ira.weiny@intel.com, vishal.l.verma@intel.com,
	alison.schofield@intel.com, Jonathan.Cameron@huawei.com,
	dave@stgolabs.net, jgg@nvidia.com, shiju.jose@huawei.com,
	Li Ming <ming.li@zohomail.com>
Subject: Re: [PATCH v5 08/15] cxl: Add support for FWCTL get driver information callback
Date: Thu, 13 Feb 2025 10:27:54 -0700	[thread overview]
Message-ID: <f54675eb-2bf2-41b0-82c3-f27169d54283@intel.com> (raw)
In-Reply-To: <Z60QCS6o-3VInenG@x130>



On 2/12/25 2:18 PM, Saeed Mahameed wrote:
> On 11 Feb 11:28, Dave Jiang wrote:
>> Add definition for fwctl_ops->info() to return driver information. The
>> function will return a data structure with a reserved u32. This is setup
>> for future usages.
>>
>> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
>> Reviewed-by: Li Ming <ming.li@zohomail.com>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>> drivers/cxl/core/features.c | 11 +++++++++--
>> include/cxl/mailbox.h       |  1 +
>> include/uapi/fwctl/cxl.h    | 19 +++++++++++++++++++
>> 3 files changed, 29 insertions(+), 2 deletions(-)
>> create mode 100644 include/uapi/fwctl/cxl.h
>>
>> diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c
>> index db48a8fbde81..923c054599ad 100644
>> --- a/drivers/cxl/core/features.c
>> +++ b/drivers/cxl/core/features.c
>> @@ -354,8 +354,15 @@ static void cxlctl_close_uctx(struct fwctl_uctx *uctx)
>>
>> static void *cxlctl_info(struct fwctl_uctx *uctx, size_t *length)
>> {
>> -    /* Place holder */
>> -    return ERR_PTR(-EOPNOTSUPP);
>> +    struct fwctl_info_cxl *info;
>> +
>> +    info = kzalloc(sizeof(*info), GFP_KERNEL);
>> +    if (!info)
>> +        return ERR_PTR(-ENOMEM);
>> +
>> +    *length = sizeof(*info);
>> +
>> +    return info;
>> }
>>
>> static void *cxlctl_fw_rpc(struct fwctl_uctx *uctx, enum fwctl_rpc_scope scope,
>> diff --git a/include/cxl/mailbox.h b/include/cxl/mailbox.h
>> index c4e99e2e3a9d..60a26a0d8f1f 100644
>> --- a/include/cxl/mailbox.h
>> +++ b/include/cxl/mailbox.h
>> @@ -4,6 +4,7 @@
>> #define __CXL_MBOX_H__
>> #include <linux/rcuwait.h>
>> #include <cxl/features.h>
>> +#include <uapi/fwctl/cxl.h>
>> #include <uapi/linux/cxl_mem.h>
>>
>> /**
>> diff --git a/include/uapi/fwctl/cxl.h b/include/uapi/fwctl/cxl.h
>> new file mode 100644
>> index 000000000000..d21fd6b80c20
>> --- /dev/null
>> +++ b/include/uapi/fwctl/cxl.h
>> @@ -0,0 +1,19 @@
>> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
>> +/*
>> + * Copyright (c) 2024, Intel Corporation
>> + *
>> + * These are definitions for the mailbox command interface of CXL subsystem.
>> + */
>> +#ifndef _UAPI_FWCTL_CXL_H_
>> +#define _UAPI_FWCTL_CXL_H_
>> +
>> +#include <linux/types.h>
>> +
>> +/**
>> + * struct fwctl_info_cxl - ioctl(FWCTL_INFO) out_device_data
>> + * @reserved: zero
>> + */
>> +struct fwctl_info_cxl {
>> +    __u32 reserved;
>> +};
> 
> I would add some useful info such as: num_user_features, mbox->feature_cap,
> etc ...

Yes those can be useful to the user. I'll add them. 
> 
> Maybe if the callback is not implemented by the fwctl driver, then fwctl
> subsystem should make sure to return a default info struct or some zero
> response buffer.
> 
>> +#endif
>> -- 
>> 2.48.1
>>
>>
> 


  parent reply	other threads:[~2025-02-13 17:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 18:27 [PATCH v5 00/15] cxl: Add CXL feature commands support via fwctl Dave Jiang
2025-02-11 18:27 ` [PATCH v5 01/15] cxl: Enumerate feature commands Dave Jiang
2025-02-11 18:27 ` [PATCH v5 02/15] cxl: Add Get Supported Features command for kernel usage Dave Jiang
2025-02-11 18:27 ` [PATCH v5 03/15] cxl/test: Add Get Supported Features mailbox command support Dave Jiang
2025-02-11 18:27 ` [PATCH v5 04/15] cxl/mbox: Add GET_FEATURE mailbox command Dave Jiang
2025-02-11 18:27 ` [PATCH v5 05/15] cxl/mbox: Add SET_FEATURE " Dave Jiang
2025-02-12 17:35   ` Jonathan Cameron
2025-02-11 18:28 ` [PATCH v5 06/15] cxl: Setup exclusive CXL features that are reserved for the kernel Dave Jiang
2025-02-11 18:28 ` [PATCH v5 07/15] cxl: Add FWCTL support to CXL Dave Jiang
2025-02-12 17:44   ` Jonathan Cameron
2025-02-12 17:47     ` Jonathan Cameron
2025-02-11 18:28 ` [PATCH v5 08/15] cxl: Add support for FWCTL get driver information callback Dave Jiang
2025-02-12 21:18   ` Saeed Mahameed
2025-02-13 15:32     ` Jason Gunthorpe
2025-02-13 17:29       ` Dave Jiang
2025-02-13 18:33       ` Dan Williams
2025-02-13 18:43         ` Jason Gunthorpe
2025-02-13 17:27     ` Dave Jiang [this message]
2025-02-13 18:12     ` Dan Williams
2025-02-13 22:11       ` Dave Jiang
2025-02-13 19:36   ` Jason Gunthorpe
2025-02-13 22:11     ` Dave Jiang
2025-02-11 18:28 ` [PATCH v5 09/15] cxl: Move cxl feature command structs to user header Dave Jiang
2025-02-11 18:28 ` [PATCH v5 10/15] cxl: Add support for fwctl RPC command to enable CXL feature commands Dave Jiang
2025-02-12 17:55   ` Jonathan Cameron
2025-02-12 23:37     ` Jason Gunthorpe
2025-02-13  2:49   ` Saeed Mahameed
2025-02-13 18:05     ` Jason Gunthorpe
2025-02-13 18:22     ` Dan Williams
2025-02-13 22:16     ` Dave Jiang
2025-02-11 18:28 ` [PATCH v5 11/15] cxl: Add support to handle user feature commands for get feature Dave Jiang
2025-02-11 18:28 ` [PATCH v5 12/15] cxl: Add support to handle user feature commands for set feature Dave Jiang
2025-02-11 18:28 ` [PATCH v5 13/15] cxl/test: Add Get Feature support to cxl_test Dave Jiang
2025-02-11 18:28 ` [PATCH v5 14/15] cxl/test: Add Set " Dave Jiang
2025-02-11 18:28 ` [PATCH v5 15/15] fwctl/cxl: Add documentation to FWCTL CXL Dave Jiang

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=f54675eb-2bf2-41b0-82c3-f27169d54283@intel.com \
    --to=dave.jiang@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jgg@nvidia.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.com \
    --cc=saeed@kernel.org \
    --cc=shiju.jose@huawei.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