[Intel-gfx] [PATCH v4 05/15] mei: pxp: add command streamer API to the PXP driver
Winkler, Tomas
tomas.winkler at intel.com
Mon Sep 12 09:59:45 UTC 2022
>
> On Fri, Sep 09, 2022 at 06:38:33AM +0000, Winkler, Tomas wrote:
> > >
> > > On Thu, Sep 08, 2022 at 05:16:02PM -0700, Daniele Ceraolo Spurio wrote:
> > > > +static ssize_t mei_pxp_gsc_command(struct device *dev, u8
> > > > +client_id,
> > > u32 fence_id,
> > > > + struct scatterlist *sg_in, size_t total_in_len,
> > > > + struct scatterlist *sg_out) {
> > > > + struct mei_cl_device *cldev;
> > > > +
> > > > + if (!dev || !sg_in || !sg_out)
> > > > + return -EINVAL;
> > >
> > > How can these ever be NULL? Doesn't the core control this, so why
> > > would that happen?
> > This is any interface function between modules, I think it is not
> > healthy to take assumptions here about how caller behaves, this is not an
> inner functions. This is important even for catching programmatical mistakes.
>
> It is a static function being called from a framework. Enforce this in the
> framework, don't sprinkle this stuff everywhere, the kernel is NOT defensive
> about internal users like this otherwise it will overwhelm every function call.
I'm not sure, this is the case here. The function is passed to i915 (other driver) driver via struct i915_pxp_component_op.
This is outside of the component framework.
Thanks
Tomas
More information about the Intel-gfx
mailing list