From: "Nelson, Shannon" <shannon.nelson@amd.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: andrew.gospodarek@broadcom.com, aron.silverton@oracle.com,
dan.j.williams@intel.com, daniel.vetter@ffwll.ch,
dave.jiang@intel.com, dsahern@kernel.org,
gregkh@linuxfoundation.org, hch@infradead.org,
itayavr@nvidia.com, jiri@nvidia.com, Jonathan.Cameron@huawei.com,
kuba@kernel.org, lbloch@nvidia.com, leonro@nvidia.com,
linux-cxl@vger.kernel.org, linux-rdma@vger.kernel.org,
netdev@vger.kernel.org, saeedm@nvidia.com, brett.creeley@amd.com
Subject: Re: [PATCH v2 4/6] pds_fwctl: initial driver framework
Date: Wed, 5 Mar 2025 18:05:02 -0800 [thread overview]
Message-ID: <d67da285-14a2-46d4-97d1-29aad9a53e60@amd.com> (raw)
In-Reply-To: <20250304193954.GT133783@nvidia.com>
On 3/4/2025 11:39 AM, Jason Gunthorpe wrote:
> On Fri, Feb 28, 2025 at 05:35:52PM -0800, Shannon Nelson wrote:
>> +static int pdsfc_identify(struct pdsfc_dev *pdsfc)
>> +{
>> + struct device *dev = &pdsfc->fwctl.dev;
>> + union pds_core_adminq_comp comp = {0};
>> + union pds_core_adminq_cmd cmd;
>> + struct pds_fwctl_ident *ident;
>> + dma_addr_t ident_pa;
>> + int err = 0;
>> +
>> + ident = dma_alloc_coherent(dev->parent, sizeof(*ident), &ident_pa, GFP_KERNEL);
>> + err = dma_mapping_error(dev->parent, ident_pa);
>> + if (err) {
>> + dev_err(dev, "Failed to map ident buffer\n");
>> + return err;
>> + }
>> +
>> + cmd = (union pds_core_adminq_cmd) {
>> + .fwctl_ident = {
>> + .opcode = PDS_FWCTL_CMD_IDENT,
>> + .version = 0,
>> + .len = cpu_to_le32(sizeof(*ident)),
>> + .ident_pa = cpu_to_le64(ident_pa),
>> + }
>> + };
>> +
>> + err = pds_client_adminq_cmd(pdsfc->padev, &cmd, sizeof(cmd), &comp, 0);
>> + if (err)
>> + dev_err(dev, "Failed to send adminq cmd opcode: %u err: %d\n",
>> + cmd.fwctl_ident.opcode, err);
>> + else
>> + pdsfc->ident = *ident;
>> +
>> + dma_free_coherent(dev->parent, sizeof(*ident), ident, ident_pa);
>> +
>> + return 0;
>
> Is it intential to loose the pds_client_adminq_cmd err? Maybe needs a
> comment if so
Good catch - thanks, will fix.
>
>> +/**
>> + * struct pds_fwctl_cmd - Firmware control command structure
>> + * @opcode: Opcode
>> + * @rsvd: Word boundary padding
>> + * @ep: Endpoint identifier.
>> + * @op: Operation identifier.
>> + */
>> +struct pds_fwctl_cmd {
>> + u8 opcode;
>> + u8 rsvd[3];
>> + __le32 ep;
>> + __le32 op;
>> +} __packed;
>
> What's your plan for the scope indication? Right now this would be
> restricted to the most restricted FWCTL_RPC_CONFIGURATION scope in FW.
As you noticed in the next patch, the scope restrictions will come from
the FW when we request endpoint and operation information.
>
>> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
>> +/* Copyright(c) Advanced Micro Devices, Inc */
>> +
>> +/*
>> + * fwctl interface info for pds_fwctl
>> + */
>> +
>> +#ifndef _UAPI_FWCTL_PDS_H_
>> +#define _UAPI_FWCTL_PDS_H_
>> +
>> +#include <linux/types.h>
>> +
>> +/*
>> + * struct fwctl_info_pds
>> + *
>> + * Return basic information about the FW interface available.
>> + */
>> +struct fwctl_info_pds {
>> + __u32 uid;
>
> I think Jonathon remarked, the uid should go since it isn't used.
yep
Thanks,
sln
>
> Jason
next prev parent reply other threads:[~2025-03-06 2:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-01 1:35 [PATCH v2 0/6] pds_fwctl: fwctl for AMD/Pensando core devices Shannon Nelson
2025-03-01 1:35 ` [PATCH v2 1/6] pds_core: make pdsc_auxbus_dev_del() void Shannon Nelson
2025-03-04 1:57 ` Jonathan Cameron
2025-03-04 4:09 ` Kalesh Anakkur Purayil
2025-03-01 1:35 ` [PATCH v2 2/6] pds_core: specify auxiliary_device to be created Shannon Nelson
2025-03-04 7:44 ` Jonathan Cameron
2025-03-01 1:35 ` [PATCH v2 3/6] pds_core: add new fwctl auxiliary_device Shannon Nelson
2025-03-04 8:03 ` Jonathan Cameron
2025-03-06 1:48 ` Nelson, Shannon
2025-03-01 1:35 ` [PATCH v2 4/6] pds_fwctl: initial driver framework Shannon Nelson
2025-03-03 16:45 ` Dave Jiang
2025-03-03 17:29 ` Jason Gunthorpe
2025-03-03 17:35 ` Nelson, Shannon
2025-03-04 1:50 ` Jonathan Cameron
2025-03-03 17:31 ` Nelson, Shannon
2025-03-03 17:46 ` Dave Jiang
2025-03-04 8:30 ` Jonathan Cameron
2025-03-06 1:52 ` Nelson, Shannon
2025-03-04 19:39 ` Jason Gunthorpe
2025-03-06 2:05 ` Nelson, Shannon [this message]
2025-03-01 1:35 ` [PATCH v2 5/6] pds_fwctl: add rpc and query support Shannon Nelson
2025-03-04 9:08 ` Jonathan Cameron
2025-03-04 17:24 ` Jason Gunthorpe
2025-03-06 2:02 ` Nelson, Shannon
2025-03-06 1:55 ` Nelson, Shannon
2025-03-04 19:52 ` Jason Gunthorpe
2025-03-06 2:07 ` Nelson, Shannon
2025-03-01 1:35 ` [PATCH v2 6/6] pds_fwctl: add Documentation entries Shannon Nelson
2025-03-04 9:12 ` Jonathan Cameron
2025-03-06 1:56 ` Nelson, Shannon
2025-03-02 12:34 ` [PATCH v2 0/6] pds_fwctl: fwctl for AMD/Pensando core devices Leon Romanovsky
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=d67da285-14a2-46d4-97d1-29aad9a53e60@amd.com \
--to=shannon.nelson@amd.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andrew.gospodarek@broadcom.com \
--cc=aron.silverton@oracle.com \
--cc=brett.creeley@amd.com \
--cc=dan.j.williams@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dave.jiang@intel.com \
--cc=dsahern@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=itayavr@nvidia.com \
--cc=jgg@nvidia.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=lbloch@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.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