devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Devarsh Thakkar <devarsht@ti.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	<mchehab@kernel.org>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
	<hverkuil-cisco@xs4all.nl>, <laurent.pinchart@ideasonboard.com>,
	<eugen.hristev@collabora.com>, <ezequiel@vanguardiasur.com.ar>,
	<u.kleine-koenig@pengutronix.de>, <sakari.ailus@linux.intel.com>,
	<linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <praneeth@ti.com>, <nm@ti.com>, <vigneshr@ti.com>,
	<a-bhatia1@ti.com>, <j-luthra@ti.com>, <b-brnich@ti.com>,
	<detheridge@ti.com>, <p-mantena@ti.com>, <vijayp@ti.com>
Subject: Re: [PATCH v2 2/2] media: imagination: Add E5010 JPEG Encoder driver
Date: Thu, 27 Jul 2023 20:18:19 +0530	[thread overview]
Message-ID: <c9629a19-c400-5553-754b-ee17b19e0970@ti.com> (raw)
In-Reply-To: <51e4ece5250c3345dae4956fbb4d4dbb5ffdde38.camel@ndufresne.ca>

Hi Krzysztof, Nicholas,

Thanks for the quick review.

On 27/07/23 19:49, Nicolas Dufresne wrote:
> Hi Krzysztof,
> 
> Le jeudi 27 juillet 2023 à 14:13 +0200, Krzysztof Kozlowski a écrit :
>> On 27/07/2023 13:25, Devarsh Thakkar wrote:
>> ...
>>
>>> +
>>> +static int e5010_release(struct file *file)
>>> +{
>>> +	struct e5010_dev *dev = video_drvdata(file);
>>> +	struct e5010_context *ctx = file->private_data;
>>> +
>>> +	dprintk(dev, 1, "Releasing instance: 0x%p, m2m_ctx: 0x%p\n", ctx, ctx->fh.m2m_ctx);
>>
>> Why do you print pointers? Looks like code is buggy and you still keep
>> debugging it.
> 
> Its relatively common practice in linux-media to leave a certain level of traces
> to help future debugging if a bug is seen. These uses v4l2 debug helper, and are
> only going to print if users enable them through the associated sysfs
> configuration. I do hope though there isn't any issue with IRQ triggering after
> the instance is released, that would be buggy for sure, but I don't think this
> is the case considering the level of documented testing that have been done.
> 
> I'd be happy to see what others have to say on the subject, as its been a
> recurrent subject of confrontation lately. With pretty agressive messages
> associated with that.
> 
> regards,
> Nicolas
> 
> p.s. does not invalidate the question, since for this driver, there is only ever
> going to be one m2m_ctx, so the question "Why do you print pointers?" is
> entirely valid I believe.
> 

There is a possible scenario with multiple applications accessing the device
node simultaneously (and so multiple m2m_ctx are possible as seen in below
logs) and these prints were helpful to debug/analyze these scenarios.

[181955.443632] e5010 fd20000.e5010: e5010_open: Created instance:
0x00000000bea83b70, m2m_ctx: 0x00000000d068a951
[181955.449587] e5010 fd20000.e5010: e5010_open: Created instance:
0x0000000046749df9, m2m_ctx: 0x000000000ff56aa6
[181955.450407] e5010 fd20000.e5010: e5010_open: Created instance:
0x00000000e33791b5, m2m_ctx: 0x00000000217634a8
[181955.457067] e5010 fd20000.e5010: e5010_open: Created instance:
0x00000000d77f83fe, m2m_ctx: 0x000000000c8ec99e


Infact, actually I had added these prints while debugging an issue with this
type of multistream scenario, where I was launching like 20 instances of JPEG
encoding and some of the instances were hanging, these prints were helpful to
fix that scenario and I later still kept these prints as they may help in
future in case any issue is encountered while adding a new feature or in
further testing.

I have also already put the logs for this multi-stream scenario in gist shared
in commit message, below is the exact line :

https://gist.github.com/devarsht/ea31179199393c2026ae457219bb6321#file-e5010_jpeg_upstream_manualtests-txt-L89


Regards
Devarsh
> . . .

  reply	other threads:[~2023-07-27 14:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 11:25 [PATCH v2 0/2] Add V4L2 M2M Driver for E5010 JPEG Encoder Devarsh Thakkar
2023-07-27 11:25 ` [PATCH v2 1/2] dt-bindings: media: Add bindings for Imagination E5010 JPEG Encoder driver Devarsh Thakkar
2023-07-27 12:03   ` Krzysztof Kozlowski
2023-07-27 12:27     ` Devarsh Thakkar
2023-07-27 11:25 ` [PATCH v2 2/2] media: imagination: Add " Devarsh Thakkar
2023-07-27 12:13   ` Krzysztof Kozlowski
2023-07-27 14:19     ` Nicolas Dufresne
2023-07-27 14:48       ` Devarsh Thakkar [this message]
2023-08-08 13:37     ` Devarsh Thakkar
2023-07-27 14:10   ` Nicolas Dufresne
2023-07-27 21:04     ` Laurent Pinchart
2023-08-08 12:34     ` Devarsh Thakkar

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=c9629a19-c400-5553-754b-ee17b19e0970@ti.com \
    --to=devarsht@ti.com \
    --cc=a-bhatia1@ti.com \
    --cc=b-brnich@ti.com \
    --cc=conor+dt@kernel.org \
    --cc=detheridge@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eugen.hristev@collabora.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=j-luthra@ti.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=nm@ti.com \
    --cc=p-mantena@ti.com \
    --cc=praneeth@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vigneshr@ti.com \
    --cc=vijayp@ti.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).