From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>,
<intel-xe@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
<alexander.usyskin@intel.com>, <gregkh@linuxfoundation.org>,
<daniele.ceraolospurio@intel.com>
Subject: Re: [RFC 9/9] {fwctl,drm}/xe/pcode: Introduce xe_pcode_fwctl
Date: Wed, 7 May 2025 15:49:15 -0400 [thread overview]
Message-ID: <aBu5O5odAKaxhhym@intel.com> (raw)
In-Reply-To: <20250506181353.GA89958@nvidia.com>
On Tue, May 06, 2025 at 03:13:53PM -0300, Jason Gunthorpe wrote:
Hi Jason,
first of all, thank you so much for creating this and for the review here.
> On Tue, Apr 29, 2025 at 09:39:56PM +0530, Badal Nilawar wrote:
>
> > diff --git a/drivers/gpu/drm/xe/xe_pcode_fwctl.c b/drivers/gpu/drm/xe/xe_pcode_fwctl.c
> > new file mode 100644
>
> I really do prefer it if you can find a way to put the code in
> drivers/fwctl instead of in DRM subsystem.
I was really in doubt about this and decided to go more towards the CXL way,
but if there's a stronger preference it would be okay by me if it is okay by
Sima and Dave as well.
> > +static int xe_pcode_fwctl_uctx_open(struct fwctl_uctx *uctx)
> > +{
> > + struct xe_pcode_fwctl_dev *fwctl_dev =
> > + container_of(uctx->fwctl, struct xe_pcode_fwctl_dev, fwctl);
> > + struct xe_device *xe = fwctl_dev->xe;
> > +
> > + xe_pm_runtime_get(xe);
>
> Shouldn't this be in the RPC function? Why keep the device awake as
> long as a the FD is open?
In general I prefer the runtime on the outer bounds to avoid funny deadlock
cases. But right, in this case here it could be inside the xe_pcode calls
itself, that is when the mmio/mailboxes accesses will really happen.
>
> > +static void *xe_pcode_fwctl_rpc(struct fwctl_uctx *uctx,
> > + enum fwctl_rpc_scope scope,
> > + void *in, size_t in_len, size_t *out_len)
> > +{
> > + struct xe_pcode_fwctl_dev *fwctl_dev =
> > + container_of(uctx->fwctl, struct xe_pcode_fwctl_dev, fwctl);
> > + struct xe_tile *root_tile = xe_device_get_root_tile(fwctl_dev->xe);
> > + struct fwctl_rpc_xe_pcode *rpc = in;
> > + int err;
> > +
> > + if (in_len != sizeof(struct fwctl_rpc_xe_pcode) ||
> > + *out_len != sizeof(struct fwctl_rpc_xe_pcode))
> > + return ERR_PTR(-EMSGSIZE);
> > +
> > + if (!xe_pcode_fwctl_rpc_validate(rpc, scope))
> > + return ERR_PTR(-EBADMSG);
>
> There should be an EPERM here if the scope is not good enough..
EPERM seems better indeed
> > +/**
> > + * struct fwctl_rpc_xe_pcode - FWCTL Remote Procedure Calls for Xe PCODE
> > + */
> > +struct fwctl_rpc_xe_pcode {
> > + /** @command: The main Mailbox command */
> > + __u8 command;
> > + /** @param1: A subcommand or a parameter of the main command */
> > + __u16 param1;
> > + /** @param2: A parameter of a subcommand or a subsubcommand */
> > + __u16 param2;
> > + /** @data0: The first 32 bits of data. In general data-in as param */
> > + __u32 data0;
> > + /** @data1: The other 32 bits of data. In general data-out */
> > + __u32 data1;
> > + /** @pad: Padding the uAPI struct - Must be 0. Not sent to firmware */
> > + __u8 pad[3];
> > +};
>
> This has implicit padding? Make the padding explicit or use packed..
> > +/**
> > + * DOC: Late Binding Commands
> > + *
> > + * FWCTL info.uctx_caps: FWCTL_XE_PCODE_LATEBINDING
> > + * FWCTL rpc.scope: FWCTL_RPC_CONFIGURATION
> > + *
> > + * Command 0x5C - LATE_BINDING
> > + * Param1 0x0 - GET_CAPABILITY_STATUS
> > + * Param2 0
> > + * Data in None
> > + * Data out:
> > + *
> > + * - Bit0: ate binding for V1 Fan Tables is supported.
>
> "ate" is a typo?
yes, for 'Late'
>
> This seems fine, though very simple in what it can do. Do you imagine
> more commands down the road?
Indeed, and this first RFC was to test the waters and the overall acceptance,
reception. PCODE has more mailboxes that we might start using FWCTL more
instead of growing per platform spread sysfs files.
One last thing since I have your attention here. Was any time in the previous
fwctl discussions talked about the possibility of some extra usages for like
FW flashing or in-field-repair/tests where big data needs to filled bypassing
lockdown mode?
>
> Jason
next prev parent reply other threads:[~2025-05-07 19:49 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 16:09 [RFC 0/9] Introducing firmware late binding Badal Nilawar
2025-04-29 16:09 ` [RFC 1/9] mei: bus: add mei_cldev_mtu interface Badal Nilawar
2025-04-29 16:09 ` [RFC 2/9] mei: late_bind: add late binding component driver Badal Nilawar
2025-05-07 22:42 ` Daniele Ceraolo Spurio
2025-05-08 5:41 ` Usyskin, Alexander
2025-06-03 12:01 ` Nilawar, Badal
2025-04-29 16:09 ` [RFC 3/9] drm/xe/late_bind_fw: Introducing late_bind_fw Badal Nilawar
2025-05-07 21:38 ` Daniele Ceraolo Spurio
2025-06-03 13:52 ` Nilawar, Badal
2025-04-29 16:09 ` [RFC 4/9] drm/xe/xe_late_bind_fw: Initialize late binding firmware Badal Nilawar
2025-05-07 23:11 ` Daniele Ceraolo Spurio
2025-06-03 13:57 ` Nilawar, Badal
2025-04-29 16:09 ` [RFC 5/9] drm/xe/xe_late_bind_fw: Load " Badal Nilawar
2025-05-07 23:44 ` Daniele Ceraolo Spurio
2025-06-04 5:36 ` Nilawar, Badal
2025-04-29 16:09 ` [RFC 6/9] drm/xe/xe_late_bind_fw: Reload late binding fw in rpm resume Badal Nilawar
2025-04-29 16:09 ` [RFC 7/9] drm/xe/xe_late_bind_fw: Reload late binding fw in S2Idle/S3 resume Badal Nilawar
2025-04-29 16:09 ` [RFC 8/9] drm/xe/xe_late_bind_fw: Introduce debug fs node to disable late binding Badal Nilawar
2025-04-29 16:09 ` [RFC 9/9] {fwctl,drm}/xe/pcode: Introduce xe_pcode_fwctl Badal Nilawar
2025-05-01 15:44 ` Rodrigo Vivi
2025-05-06 18:13 ` Jason Gunthorpe
2025-05-07 19:49 ` Rodrigo Vivi [this message]
2025-05-07 22:04 ` Jason Gunthorpe
2025-08-22 19:33 ` Rodrigo Vivi
2025-08-28 12:48 ` Jason Gunthorpe
2025-06-06 13:47 ` Nilawar, Badal
2025-06-06 13:45 ` Nilawar, Badal
2025-06-30 22:01 ` Rodrigo Vivi
2025-06-30 22:45 ` Jason Gunthorpe
2025-04-30 11:47 ` [RFC 0/9] Introducing firmware late binding Jani Nikula
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=aBu5O5odAKaxhhym@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=alexander.usyskin@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jgg@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;
as well as URLs for NNTP newsgroup(s).