mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Vadillo, Miguel" <miguel.vadillo@intel.com>
Cc: linux-media@vger.kernel.org, mchehab@kernel.org,
	linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	sakari.ailus@linux.intel.com, hansg@kernel.org,
	laurent.pinchart@ideasonboard.com, mehdi.djait@bootlin.com,
	mika.westerberg@linux.intel.com, srini@kernel.org,
	arun.t@intel.com
Subject: Re: [PATCH] media: i2c: cvs: Add NVMem-based firmware update support
Date: Fri, 2 Oct 2026 10:05:40 +0300	[thread overview]
Message-ID: <ar9XxEb6Kjvd6HXb@ashevche-desk.local> (raw)
In-Reply-To: <abb0daee-c5f2-47c2-9b0f-6018edb0ba6b@intel.com>

On Thu, Oct 01, 2026 at 04:03:50PM -0700, Vadillo, Miguel wrote:
> On 10/1/26 11:32 AM, Andy Shevchenko wrote:
> > On Wed, Sep 30, 2026 at 11:21:42AM -0700, Miguel Vadillo wrote:

...

> > > +	mutex_lock(&ctx->lock);
> > 
> > Why not guard()()? Also how ACQUIRE() macros are co-habit with goto:s?
> 
> You are right scoped_guard() should be the case here and to get rid of the
> gotos, this could be done like:
> ...
> 	scoped_guard(mutex, &ctx->lock) {

Why scoped_guard()? If you need something to be outside of the regular
guard()(), but double check that it's indeed the case, refactor to have to
functions, one with guard()() in it and one that wraps it.

> 		switch (val) {
> 		...
> 		}
> 
> 		nvm->auth_status = -ret;
> 	}

> 	if (ret)
> 		return ret;
> 
> 	if (do_uevent)
> 		kobject_uevent(&dev->kobj, KOBJ_CHANGE);
> 
> 	return count;

...

> > >   struct icvs {
> > >   	struct i2c_client *i2c_client;
> > 
> > >   	int irq;
> > >   	wait_queue_head_t hostwake_event;
> > >   	bool hostwake_event_arg;
> > > +	struct icvs_nvm nvm;
> > >   };
> > 
> > Is `pahole` happy with the layout?
> 
> Yes. struct icvs_nvm is itself hole-free and fits in one cacheline.
> That being said, there seems to be other holes in the full struct from the
> existing implementation, this order could make it better
> ...

Better by `pahole` doesn't always mean better in all aspects. You have to also
check it in conjunction with the output of `bloat-o-meter`. And in some
(performance-critical) cases with the runtime performance tests.

> 	struct media_pad pads[ICVS_CSI_NUM_PADS];
> 	struct device_link *ipu_link;
> 	unsigned long quirks;
> 	struct gpio_desc *rst;
> 	struct gpio_desc *req;
> 	struct gpio_desc *resp;
> 	wait_queue_head_t hostwake_event;
> 	struct icvs_nvm nvm;
> 	struct icvs_dev_capabilities caps;
> 	u32 nr_of_lanes;
> 	enum icvs_resources res;
> 	int irq;
> 	bool prefix;
> 	bool hostwake_event_arg;
> 
> but maybe send as a separate patch since it is not related to the patch
> intent (?)

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-10-02  7:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 18:21 Miguel Vadillo
2026-10-01 18:32 ` Andy Shevchenko
2026-10-01 23:03   ` Vadillo, Miguel
2026-10-02  7:05     ` Andy Shevchenko [this message]

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=ar9XxEb6Kjvd6HXb@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arun.t@intel.com \
    --cc=hansg@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@bootlin.com \
    --cc=miguel.vadillo@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=srini@kernel.org \
    /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

all inboxes | Powered by JetHome®