From: "Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>
To: "Teres Alexis, Alan Previn" <alan.previn.teres.alexis@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"Usyskin, Alexander" <alexander.usyskin@intel.com>,
"Winkler, Tomas" <tomas.winkler@intel.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 2/4] mei: gsc_proxy: add gsc proxy driver
Date: Thu, 20 Apr 2023 15:04:23 -0700 [thread overview]
Message-ID: <553a192a-f52a-a3fb-4f20-ed79bf75f0c6@intel.com> (raw)
In-Reply-To: <612b04c9c35f1f67083ce5cb889f909fb89bb066.camel@intel.com>
On 4/18/2023 11:57 PM, Teres Alexis, Alan Previn wrote:
> On Wed, 2023-03-29 at 09:56 -0700, Ceraolo Spurio, Daniele wrote:
>> From: Alexander Usyskin <alexander.usyskin@intel.com>
>>
>> Add GSC proxy driver. It to allows messaging between GSC component
>> on Intel on board graphics card and CSE device.
> alan:nit: isn't "Intel integrated GPU" clearer than "Intel on-board graphics card"?
> Same thing for the Kconfig description later (or am i missing something else here).
Will change
>
> alan:snip
>
>
>
>> + MEI GSC proxy enables messaging between GSC service on
>> + Intel graphics on-board card and services on CSE (MEI)
> alan:nit: same as above
>
>
>
>
>> diff --git a/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
>> new file mode 100644
>> index 000000000000..953eda1a16fb
>> --- /dev/null
>> +++ b/drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c
>> @@ -0,0 +1,208 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * Copyright (c) 2022-2023 Intel Corporation
>> + */
>> +
>> +#include <linux/module.h>
>> +#include <linux/pci.h>
>> +#include <linux/slab.h>
>> +#include <linux/uuid.h>
>> +#include <linux/mei_cl_bus.h>
> alan: [nit?] i thought we need to have the headers alphabetically ordered? (below too)
Will fix
>> +#include <linux/component.h>
>> +#include <drm/drm_connector.h>
>> +#include <drm/i915_component.h>
>> +#include <drm/i915_gsc_proxy_mei_interface.h>
>> +
>> +/**
>> + * mei_gsc_proxy_send - Sends a proxy message to ME FW.
>> + * @dev: device corresponding to the mei_cl_device
>> + * @buf: a message buffer to send
>> + * @size: size of the message
>> + * Return: bytes sent on Success, <0 on Failure
>> + */
>> +static int mei_gsc_proxy_send(struct device *dev, const void *buf, size_t size)
>> +{
>> + ssize_t ret;
>> +
>> + if (!dev || !buf)
> alan: nit: not sure if we should be checking for !size here - i do see that next patch
> is checking for this from i915 side of the interface... but just wasnt sure which is the prefered style
> (in terms of where to check for this condition). Either way, its a nit for me since i traced down
> all the way to mei_cl_alloc_cb and it looks like mei bus can tolerate zero sized messages.
>> + return -EINVAL;
> alan:snip
>
>> +static int mei_gsc_proxy_recv(struct device *dev, void *buf, size_t size)
>> +{
>> + ssize_t ret;
>> +
>> + if (!dev || !buf)
> alan: nit: same as in the 'send' above,.. not sure if we should be checking for !size here...
> or perhaps 0 sized recv is supported.
AFAICS the lower level of the mei code do allow for size 0 for both send
and recv. Also, this is the same check as what we do for the PXP component.
>
>> + return -EINVAL;
> alan:snip
>
>> +static int mei_gsc_proxy_component_match(struct device *dev, int subcomponent,
>> + void *data)
>> +{
>> + struct pci_dev *pdev;
>> +
>> + if (!dev_is_pci(dev))
>> + return 0;
>> +
>> + pdev = to_pci_dev(dev);
>> +
>> + if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
>> + pdev->vendor != PCI_VENDOR_ID_INTEL)
>> + return 0;
>> +
>> + if (subcomponent != I915_COMPONENT_GSC_PROXY)
>> + return 0;
>> +
>> + return component_compare_dev(dev->parent, ((struct device *)data)->parent);
> alan: do we care if both these parents are non-null? i notice in other mei component
> drivers match functions we do check that.
Those should always both be non-NULL, since both the mei and the GFX
device have the PCI bus as parent (and the previous check on pdev
ensures those are the 2 devices we're handling at this point).
>
>> +}
>> +
> alan:snip
>
>> +#define MEI_UUID_GSC_PROXY UUID_LE(0xf73db04, 0x97ab, 0x4125, \
>> + 0xb8, 0x93, 0xe9, 0x4, 0xad, 0xd, 0x54, 0x64)
> alan: apologies for the newbie question, but why are we using UUID for the gsc_proxy
> as opposed to GUID like the other mei components? i am not sure if i read the right
> archived patch review but it sounded like GUID is for internal to kernel only whereas
> UUID is for external too? (in which case why are we not using GUID for gsc-proxy?)
> Consider this a non-blocking inquiry since i assume mei folks have reviewed this
> prior and this is an explicit design decision that I'm just not versed on.
AFAICS all other mei components use UUID_LE as well. The code was
updated from GUID to UUID_LE in:
https://lore.kernel.org/all/20221228160558.21311-1-andriy.shevchenko@linux.intel.com/
Daniele
>
> alan:snip
next prev parent reply other threads:[~2023-04-20 22:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 16:56 [Intel-gfx] [PATCH 0/4] drm/i915: Add support for MTL GSC SW Proxy Daniele Ceraolo Spurio
2023-03-29 16:56 ` [Intel-gfx] [PATCH 1/4] drm/i915/mtl: Define GSC Proxy component interface Daniele Ceraolo Spurio
2023-04-18 23:52 ` Teres Alexis, Alan Previn
2023-04-20 11:12 ` Jani Nikula
2023-03-29 16:56 ` [Intel-gfx] [PATCH 2/4] mei: gsc_proxy: add gsc proxy driver Daniele Ceraolo Spurio
2023-04-19 6:57 ` Teres Alexis, Alan Previn
2023-04-20 22:04 ` Ceraolo Spurio, Daniele [this message]
2023-04-20 23:44 ` Ceraolo Spurio, Daniele
2023-04-21 0:05 ` Teres Alexis, Alan Previn
2023-03-29 16:56 ` [Intel-gfx] [PATCH 3/4] drm/i915/gsc: add initial support for GSC proxy Daniele Ceraolo Spurio
2023-04-20 1:01 ` Teres Alexis, Alan Previn
2023-03-29 16:56 ` [Intel-gfx] [PATCH 4/4] drm/i915/gsc: add support for GSC proxy interrupt Daniele Ceraolo Spurio
2023-04-20 18:49 ` Teres Alexis, Alan Previn
2023-04-20 20:21 ` Ceraolo Spurio, Daniele
2023-04-21 0:17 ` Teres Alexis, Alan Previn
2023-03-29 19:52 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Add support for MTL GSC SW Proxy Patchwork
2023-03-29 19:52 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-29 20:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-30 13:04 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
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=553a192a-f52a-a3fb-4f20-ed79bf75f0c6@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=alan.previn.teres.alexis@intel.com \
--cc=alexander.usyskin@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=tomas.winkler@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