[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa07c8d2-0943-b7d1-8d37-76e03bd527c0@gmail.com>
Date: Sun, 12 Mar 2017 13:36:32 -0700
From: Steve Longerbeam <slongerbeam@...il.com>
To: Russell King - ARM Linux <linux@...linux.org.uk>
Cc: mark.rutland@....com, andrew-ct.chen@...iatek.com,
minghsiu.tsai@...iatek.com, sakari.ailus@...ux.intel.com,
nick@...anahar.org, songjun.wu@...rochip.com, hverkuil@...all.nl,
Steve Longerbeam <steve_longerbeam@...tor.com>, pavel@....cz,
robert.jarzmik@...e.fr, devel@...verdev.osuosl.org,
markus.heiser@...marIT.de,
laurent.pinchart+renesas@...asonboard.com, shuah@...nel.org,
geert@...ux-m68k.org, linux-media@...r.kernel.org,
devicetree@...r.kernel.org, kernel@...gutronix.de, arnd@...db.de,
mchehab@...nel.org, bparrot@...com, robh+dt@...nel.org,
horms+renesas@...ge.net.au, tiffany.lin@...iatek.com,
linux-arm-kernel@...ts.infradead.org,
niklas.soderlund+renesas@...natech.se, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, jean-christophe.trotin@...com,
p.zabel@...gutronix.de, fabio.estevam@....com, shawnguo@...nel.org,
sudipm.mukherjee@...il.com
Subject: Re: [PATCH v5 00/39] i.MX Media Driver
On 03/12/2017 01:16 PM, Steve Longerbeam wrote:
>
>
> On 03/12/2017 12:44 PM, Steve Longerbeam wrote:
>>
>>
>> On 03/12/2017 12:29 PM, Russell King - ARM Linux wrote:
>>> On Sun, Mar 12, 2017 at 12:21:45PM -0700, Steve Longerbeam wrote:
>>>> There's actually nothing preventing userland from disabling a link
>>>> multiple times, and imx_media_link_notify() complies, and so
>>>> csi_s_power(OFF) gets called multiple times, and so that WARN_ON()
>>>> in there is silly, I borrowed this from other MC driver examples,
>>>> but it makes no sense to me, I'll remove it and prevent the power
>>>> count from going negative.
>>>
>>> Hmm. So what happens if one of the CSI's links is enabled, and we
>>> disable a different link from the CSI several times? Doesn't that
>>> mean the power count will go to zero despite there being an enabled
>>> link?
>>
>> Yes, the CSI will be powered off even if it still has an enabled link.
>> But one of its other links has been disabled, meaning the pipeline as
>> a whole is disabled. So I think it makes sense to power down the CSI,
>> the pipeline isn't usable at that point.
>>
>> And remember that the CSI does not allow both output pads to be enabled
>> at the same time. If that were so then indeed there would be a problem,
>> because it would mean there is another active pipeline that requires the
>> CSI being powered on, but that's not the case.
>>
>> I think this is consistent with the other entities as well, but I will
>> double check.
>
>
> At first I thought this could be a problem for one entity, the csi-2
> receiver.
>
> It can enable all four of its output pads at once (if the input stream
> contains all 4 virtual channels, the csi-2 receiver must support
> demuxing all of them onto all 4 of its output pads).
>
> But after more review, this should not be an issue. If a csi-2 sink
> (a CSI or a CSI mux) link is disabled, the csi-2 receiver is no longer
> reachable from that sink, so attempts to disable the csi-2 via that
> path again is not possible. The other potential problem is disabling
> from the csi-2's own sink pad, but in that case the csi-2 no longer
> has a source, so again it makes sense to power off the csi-2 even
> if it has enabled output pads.
>
But hold on, if my logic is correct, then why did the CSI power-off
get reached in your case, multiple times? Yes I think there is a bug,
link_notify() is not checking if the link has already been disabled.
I will fix this. But I'm surprised media core's link_notify handling
doesn't do this.
Steve
Powered by blists - more mailing lists