Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1675492
| Path | csiph.com!goblin3!goblin2!goblin.stu.neva.ru!news.unit0.net!news.mixmin.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Andrzej Hajda <a.hajda@samsung.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] drm: exynos: dsi: release DSI_PORT_OUT node right after of_drm_find_bridge() |
| Date | Tue, 27 Jun 2017 12:10:02 +0200 |
| Message-ID | <tWVBw-7pX-23@gated-at.bofh.it> (permalink) |
| References | <tWwjM-7FR-11@gated-at.bofh.it> <tVHAB-Ra-3@gated-at.bofh.it> <tWwjM-7FR-9@gated-at.bofh.it> <tWUP8-6Rd-17@gated-at.bofh.it> |
| X-Original-To | Inki Dae <inki.dae@samsung.com>, Shuah Khan <shuahkh@osg.samsung.com>, sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@linux.ie, kgene@kernel.org, krzk@kernel.org, javier@osg.samsung.com |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| X-Auditid | cbfec7f2-f797e6d000004438-18-59522e75d7ee |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 |
| Content-Transfer-Encoding | 8bit |
| Content-Language | en-US |
| X-Brightmail-Tracker | H4sIAAAAAAAAA01Sa0gUYRTtm5mdGTc3xtX0pr3YsLTIFEWGFMvox0L9KOuHCmmLDiq6Krur aBFKofiofK2li+WrLCwzVjFJMR+5mraulkj+8I2Wjy1fG26l5DoK/jv3O+fcc+/lo3HxZ4Ej HRWr4hSxshgJKSQadGbD6US3gCD3rALEPuj7hLGDpl8kmz+WS7ALxtcYmzM1j7MGw1uK1d9d oFjt1JCA/fq+hGSLDC0YW7i6SLBFBbPkeWuptjqTlL77PS6QjmV3YdK6ZynS+pwRSvqwvhpJ V7SHr1DBQt9wLiYqkVOc8bspjC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xZUouRM0zRon+oweYQWqEBZIlpnxoYAKxRQTOMkrMv+wNUsQs0MMo8XLiCiaIjueMEmf2 3AebyiagKfF3802oDXYSi/5MZQXZwCKgKnFgOQdIWFQgQmLX9QOsIDangLbE/o/zwBYwC8hL HLzynAXCFpdobr3JMoFRcBaSW2ch3DoLSccsJB0LGFlWMYqklhbnpucWG+oVJ+YWl+al6yXn 525iBEbztmM/N+9gvLQx+BCjAAejEg/vD6bASCHWxLLiytxDjBIczEoivL+ZgyKFeFMSK6tS i/Lji0pzUosPMZoCvTCRWUo0OR+YaPJK4g1NDM0tDY2MLSzMjYyUxHlLPlwJFxJITyxJzU5N LUgtgulj4uCUamAsWHp7nx4P+2nJRYXPK22cble4C+63W+C1mGHXN7UMy9MKkoLWIvtvsIV/ eMZofmu7ixrrk5tLm3d17LIT/iUqupJp7ieXtM7qppAAj5kNUUIfXnEdeh2SlX988uNvSg3f BX02nnXw+1Ox+vkHXZNJwct/2TpGpbw//9D53P/NRvW7Xd8m3/RTYinOSDTUYi4qTgQAK+QK M/wCAAA= |
| X-Mtr | 20000000000000000@CPGS |
| X-Cms-Mailid | 20170627100749eucas1p10e7b079ab413f28dc9b1cbbb587e2639 |
| X-Msg-Generator | CA |
| X-Sender-IP | 182.198.249.179 |
| X-Local-Sender | Andrzej HajdaSRPOL-Kernel (TP)μΌμ±μ μSenior Software Engineer |
| X-Global-Sender | Andrzej HajdaSRPOL-Kernel (TP)Samsung ElectronicsSenior Software Engineer |
| X-Sender-Code | C10EHQC10CD02CD027392 |
| Cms-Type | 201P |
| X-Hopcount | 7 |
| X-Cms-Rootmailid | 20170626004946epcas4p40785020666ae6d43476822d067604baa |
| X-Rootmtr | 20170626004946epcas4p40785020666ae6d43476822d067604baa |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 99 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org |
| X-Original-Date | Tue, 27 Jun 2017 12:07:48 +0200 |
| X-Original-Message-ID | <cd0eb692-5f8c-0137-8cc7-fa0ae9d7cf9b@samsung.com> |
| X-Original-References | <CGME20170626004946epcas4p40785020666ae6d43476822d067604baa@epcas4p4.samsung.com> <20170624005628.5896-1-shuahkh@osg.samsung.com> <5d308e03-e92a-7bac-f65e-23c2ccbe161a@samsung.com> <5952219F.1030902@samsung.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1675492 |
Show key headers only | View raw
On 27.06.2017 11:13, Inki Dae wrote:
> Hi Andrzej,
>
> 2017λ
06μ 26μΌ 16:02μ Andrzej Hajda μ΄(κ°) μ΄ κΈ:
>> Hi Shuah,
>>
>>
>> On 24.06.2017 02:56, Shuah Khan wrote:
>>> Fix to call of_node_put() right after of_drm_find_bridge() instead of
>>> holding on to it until exynos_dsi_remove().
>> I think the current implementation is OK, node is get in probe and put
>> in remove.
>> There could be many bind/unbind during lifetime of the bound driver.
>> For example, there is possible sequence:
>> 1. probe -
>> 2. bind
>> 3. unbind
>> 4. bind
>>
>> With this patch on 2nd bind (point 4) driver will call
>> of_drm_find_bridge on dsi->bridge_node which was put earlier (point 2.).
>>
> Right. This is a problem.
>
> How about moving of_drm_find_bridge function call to probe and keeping drm_bridge_attach call in bind for cleanup?
> Seems it doesn't need to call of_drm_find_bridge function every time bind callback is called.
I think the reason to call of_drm_find_bridge in bind is to avoid probe
deferring, and with current code it will probably defer forever,
explanation below:
The only bridge connected to DSI is bridge provided by MIC driver, and
MIC driver is componentized, but it registers his bridge in bind callback.
So with drm_bridge_attach moved to probe of DSI initialization would
never succeed because:
1. MIC->bind will be called only if all DRM components are present.
2. DSI driver will defer probing because the bridge is not present, thus
DSI component will never be present.
So the current code looks better to me, but there are two thing which
could be improved:
A. Maybe it would be good thing to move MIC bridge registration to
probe, I see no reason to postpone it to bind phase, this way it should
be safer if for some reason DSI->bind callback would be called before
MIC->bind.
B. Add error checking to of_drm_find_bridge in DSI driver, I know MIC is
generally optional, but if the graph link is present (ie.
dsi->bridge_node is valid) MIC bridge should be present, if it is not,
it indicates some problem.
Regards
Andrzej
>
> Thanks,
> Inki Dae
>
>> Regards
>> Andrzej
>>
>>
>>> Suggested-by: Inki Dae <inki.dae@samsung.com>
>>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>>> ---
>>> drivers/gpu/drm/exynos/exynos_drm_dsi.c | 5 +----
>>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>>> index e337cd2..7513b88 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>>> @@ -1689,6 +1689,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
>>>
>>> if (dsi->bridge_node) {
>>> bridge = of_drm_find_bridge(dsi->bridge_node);
>>> + of_node_put(dsi->bridge_node);
>>> if (bridge)
>>> drm_bridge_attach(encoder, bridge, NULL);
>>> }
>>> @@ -1807,10 +1808,6 @@ static int exynos_dsi_probe(struct platform_device *pdev)
>>>
>>> static int exynos_dsi_remove(struct platform_device *pdev)
>>> {
>>> - struct exynos_dsi *dsi = platform_get_drvdata(pdev);
>>> -
>>> - of_node_put(dsi->bridge_node);
>>> -
>>> pm_runtime_disable(&pdev->dev);
>>>
>>> component_del(&pdev->dev, &exynos_dsi_component_ops);
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] drm: exynos: dsi: release DSI_PORT_OUT node right after of_drm_find_bridge() Shuah Khan <shuahkh@osg.samsung.com> - 2017-06-24 03:00 +0200
Re: [PATCH] drm: exynos: dsi: release DSI_PORT_OUT node right after of_drm_find_bridge() Andrzej Hajda <a.hajda@samsung.com> - 2017-06-26 09:10 +0200
Re: [PATCH] drm: exynos: dsi: release DSI_PORT_OUT node right after of_drm_find_bridge() Inki Dae <inki.dae@samsung.com> - 2017-06-27 11:20 +0200
Re: [PATCH] drm: exynos: dsi: release DSI_PORT_OUT node right after of_drm_find_bridge() Andrzej Hajda <a.hajda@samsung.com> - 2017-06-27 12:10 +0200
csiph-web