mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: "jackson.lee" <jackson.lee@chipsnmedia.com>,
	"mchehab@kernel.org"	 <mchehab@kernel.org>,
	"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>,
	 "bob.beckett@collabora.com"	 <bob.beckett@collabora.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org"	 <linux-kernel@vger.kernel.org>,
	"lafley.kim" <lafley.kim@chipsnmedia.com>,
	 "b-brnich@ti.com"	 <b-brnich@ti.com>,
	"hverkuil@xs4all.nl" <hverkuil@xs4all.nl>,
	Nas Chung	 <nas.chung@chipsnmedia.com>
Subject: Re: [PATCH v6 4/4] media: chips-media: wave5: Improve performance of decoder
Date: Mon, 17 Nov 2025 08:45:27 -0500	[thread overview]
Message-ID: <018ef330788ac4d5f3cc6a9b9b98578eefabbbb9.camel@collabora.com> (raw)
In-Reply-To: <SLXP216MB1148F3ED4920B12EECF84C03EDC9A@SLXP216MB1148.KORP216.PROD.OUTLOOK.COM>

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

Hi,

Le lundi 17 novembre 2025 à 02:07 +0000, jackson.lee a écrit :
> > >  		} else {
> > > +			spin_lock_irqsave(&inst->state_spinlock, flags);
> > 
> > Move the locking inside the set_state function.
> > 
> > cheers,
> > Nicolas
> 
> I think the locking should not be move into the set_state
> function(switch_state).
> Because the send_eos_event, handle_dynamic_resolution_change and
> flag_last_buffer_done already have the lockdep_assert_held(&inst-
> >state_spinlock); inside those function,
> So to concisify the above code, even if the locking is moved into
> switch_statue, the locking should be called again outside.

My suggestion is to try and reduce code redundancy, another method commonly used
is to have a small version of the function that takes the locking, this you can
turn 3 lines into one in many places.

Nicolas

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2025-11-17 13:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14  1:21 [PATCH v6 0/4] Performance improvement " Jackson.lee
2025-11-14  1:21 ` [PATCH v6 1/4] media: chips-media: wave5: Fix SError of kernel panic when closed Jackson.lee
2025-11-14  1:21 ` [PATCH v6 2/4] media: chips-media: wave5: Fix Null reference while testing fluster Jackson.lee
2025-11-14  1:21 ` [PATCH v6 3/4] media: chips-media: wave5: Add WARN_ON to check if dec_output_info is NULL Jackson.lee
2025-11-14  1:21 ` [PATCH v6 4/4] media: chips-media: wave5: Improve performance of decoder Jackson.lee
2025-11-14  3:38   ` Nicolas Dufresne
2025-11-17  2:07     ` jackson.lee
2025-11-17 13:45       ` Nicolas Dufresne [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=018ef330788ac4d5f3cc6a9b9b98578eefabbbb9.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=b-brnich@ti.com \
    --cc=bob.beckett@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=hverkuil@xs4all.nl \
    --cc=jackson.lee@chipsnmedia.com \
    --cc=lafley.kim@chipsnmedia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nas.chung@chipsnmedia.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

all inboxes | Powered by JetHome®