diff mbox

[v5,3/5] drm/exynos: dsi: Fix the parse_dt function

Message ID 1488948852-5380-4-git-send-email-hoegeun.kwon@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hoegeun Kwon March 8, 2017, 4:54 a.m. UTC
The dsi + panel is a parental relationship, so OF grpah is not needed.
Therefore, the current dsi_parse_dt function will throw an error,
because there is no linked OF graph for the case fimd + dsi + panel.

Parse the Pll burst and esc clock frequency properties in dsi_parse_dt()
and create a bridge_node only if there is an OF graph associated with dsi.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 32 ++++++++------------------------
 1 file changed, 8 insertions(+), 24 deletions(-)

Comments

Hoegeun Kwon March 22, 2017, 1:36 a.m. UTC | #1
Hi inki,

Could you check the this patch?
For reference, patch 1/5 and 2/5 have already been applied to Krzysztof 
tree.

Best regards,
Hoegeun


On 03/08/2017 01:54 PM, Hoegeun Kwon wrote:
> The dsi + panel is a parental relationship, so OF grpah is not needed.
> Therefore, the current dsi_parse_dt function will throw an error,
> because there is no linked OF graph for the case fimd + dsi + panel.
>
> Parse the Pll burst and esc clock frequency properties in dsi_parse_dt()
> and create a bridge_node only if there is an OF graph associated with dsi.
>
> Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
> Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
> ---
>   drivers/gpu/drm/exynos/exynos_drm_dsi.c | 32 ++++++++------------------------
>   1 file changed, 8 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> index f5c04d0..2d4e118 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
> @@ -1652,39 +1652,23 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi)
>   	if (ret < 0)
>   		return ret;
>   
> -	ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0);
> -	if (!ep) {
> -		dev_err(dev, "no output port with endpoint specified\n");
> -		return -EINVAL;
> -	}
> -
> -	ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency",
> +	ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency",
>   				     &dsi->burst_clk_rate);
>   	if (ret < 0)
> -		goto end;
> +		return ret;
>   
> -	ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",
> +	ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency",
>   				     &dsi->esc_clk_rate);
>   	if (ret < 0)
> -		goto end;
> -
> -	of_node_put(ep);
> +		return ret;
>   
>   	ep = of_graph_get_next_endpoint(node, NULL);
> -	if (!ep) {
> -		ret = -EINVAL;
> -		goto end;
> -	}
> -
> -	dsi->bridge_node = of_graph_get_remote_port_parent(ep);
> -	if (!dsi->bridge_node) {
> -		ret = -EINVAL;
> -		goto end;
> +	if (ep) {
> +		dsi->bridge_node = of_graph_get_remote_port_parent(ep);
> +		of_node_put(ep);
>   	}
> -end:
> -	of_node_put(ep);
>   
> -	return ret;
> +	return 0;
>   }
>   
>   static int exynos_dsi_bind(struct device *dev, struct device *master,
Inki Dae March 28, 2017, 8:26 a.m. UTC | #2
Merged.

Thanks,
Inki Dae

2017년 03월 22일 10:36에 Hoegeun Kwon 이(가) 쓴 글:
> Hi inki,
> 
> Could you check the this patch?
> For reference, patch 1/5 and 2/5 have already been applied to Krzysztof tree.
> 
> Best regards,
> Hoegeun
> 
> 
> On 03/08/2017 01:54 PM, Hoegeun Kwon wrote:
>> The dsi + panel is a parental relationship, so OF grpah is not needed.
>> Therefore, the current dsi_parse_dt function will throw an error,
>> because there is no linked OF graph for the case fimd + dsi + panel.
>>
>> Parse the Pll burst and esc clock frequency properties in dsi_parse_dt()
>> and create a bridge_node only if there is an OF graph associated with dsi.
>>
>> Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
>> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
>> Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
>> ---
>>   drivers/gpu/drm/exynos/exynos_drm_dsi.c | 32 ++++++++------------------------
>>   1 file changed, 8 insertions(+), 24 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>> index f5c04d0..2d4e118 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>> @@ -1652,39 +1652,23 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi)
>>       if (ret < 0)
>>           return ret;
>>   -    ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0);
>> -    if (!ep) {
>> -        dev_err(dev, "no output port with endpoint specified\n");
>> -        return -EINVAL;
>> -    }
>> -
>> -    ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency",
>> +    ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency",
>>                        &dsi->burst_clk_rate);
>>       if (ret < 0)
>> -        goto end;
>> +        return ret;
>>   -    ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",
>> +    ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency",
>>                        &dsi->esc_clk_rate);
>>       if (ret < 0)
>> -        goto end;
>> -
>> -    of_node_put(ep);
>> +        return ret;
>>         ep = of_graph_get_next_endpoint(node, NULL);
>> -    if (!ep) {
>> -        ret = -EINVAL;
>> -        goto end;
>> -    }
>> -
>> -    dsi->bridge_node = of_graph_get_remote_port_parent(ep);
>> -    if (!dsi->bridge_node) {
>> -        ret = -EINVAL;
>> -        goto end;
>> +    if (ep) {
>> +        dsi->bridge_node = of_graph_get_remote_port_parent(ep);
>> +        of_node_put(ep);
>>       }
>> -end:
>> -    of_node_put(ep);
>>   -    return ret;
>> +    return 0;
>>   }
>>     static int exynos_dsi_bind(struct device *dev, struct device *master,
> 
> -- 
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
>
Krzysztof Kozlowski March 28, 2017, 8:38 a.m. UTC | #3
On Tue, Mar 28, 2017 at 11:26 AM, Inki Dae <inki.dae@samsung.com> wrote:
> Merged.

Hi,

I do not see the tag (with DT patches) merged by you which I provided
to you before. These are essential for bisectability. Without them,
kernel bisectability is broken. Did you merged the tag somewhere?

Best regards,
Krzysztof

> Thanks,
> Inki Dae
>
> 2017년 03월 22일 10:36에 Hoegeun Kwon 이(가) 쓴 글:
>> Hi inki,
>>
>> Could you check the this patch?
>> For reference, patch 1/5 and 2/5 have already been applied to Krzysztof tree.
>>
>> Best regards,
>> Hoegeun
>>
>>
>> On 03/08/2017 01:54 PM, Hoegeun Kwon wrote:
>>> The dsi + panel is a parental relationship, so OF grpah is not needed.
>>> Therefore, the current dsi_parse_dt function will throw an error,
>>> because there is no linked OF graph for the case fimd + dsi + panel.
>>>
>>> Parse the Pll burst and esc clock frequency properties in dsi_parse_dt()
>>> and create a bridge_node only if there is an OF graph associated with dsi.
>>>
>>> Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
>>> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
>>> Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
>>> ---
>>>   drivers/gpu/drm/exynos/exynos_drm_dsi.c | 32 ++++++++------------------------
>>>   1 file changed, 8 insertions(+), 24 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>>> index f5c04d0..2d4e118 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
>>> @@ -1652,39 +1652,23 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi)
>>>       if (ret < 0)
>>>           return ret;
>>>   -    ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0);
>>> -    if (!ep) {
>>> -        dev_err(dev, "no output port with endpoint specified\n");
>>> -        return -EINVAL;
>>> -    }
>>> -
>>> -    ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency",
>>> +    ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency",
>>>                        &dsi->burst_clk_rate);
>>>       if (ret < 0)
>>> -        goto end;
>>> +        return ret;
>>>   -    ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",
>>> +    ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency",
>>>                        &dsi->esc_clk_rate);
>>>       if (ret < 0)
>>> -        goto end;
>>> -
>>> -    of_node_put(ep);
>>> +        return ret;
>>>         ep = of_graph_get_next_endpoint(node, NULL);
>>> -    if (!ep) {
>>> -        ret = -EINVAL;
>>> -        goto end;
>>> -    }
>>> -
>>> -    dsi->bridge_node = of_graph_get_remote_port_parent(ep);
>>> -    if (!dsi->bridge_node) {
>>> -        ret = -EINVAL;
>>> -        goto end;
>>> +    if (ep) {
>>> +        dsi->bridge_node = of_graph_get_remote_port_parent(ep);
>>> +        of_node_put(ep);
>>>       }
>>> -end:
>>> -    of_node_put(ep);
>>>   -    return ret;
>>> +    return 0;
>>>   }
>>>     static int exynos_dsi_bind(struct device *dev, struct device *master,
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>>
Krzysztof Kozlowski April 4, 2017, 3:38 p.m. UTC | #4
On Tue, Mar 28, 2017 at 11:38 AM, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Tue, Mar 28, 2017 at 11:26 AM, Inki Dae <inki.dae@samsung.com> wrote:
>> Merged.
>
> Hi,
>
> I do not see the tag (with DT patches) merged by you which I provided
> to you before. These are essential for bisectability. Without them,
> kernel bisectability is broken. Did you merged the tag somewhere?
>
> Best regards,
> Krzysztof
>
>> Thanks,
>> Inki Dae

Inki,

I still do not see the DTS tag [1] merged in your tree but you applied
patches breaking the display. I looked at exynos-drm-next branch.

We talked already about bisectability and with Hoegeun we provided
proper solution. Hoegeun split the patchset and I sent you a stable
tag to merge. Be aware not to apply the DTS patch because you would
effectively duplicate it. Instead, deal like with any pull request -
merge the tag as dependency *before* applying DRM DSI patch.

I saw also a branch like this:
https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git/log/?h=exynos-drm-next-tm2
but this is something obviously wrong. I do not know what are your
plans to do with it, but please drop it as it brings only confusion.

Best regards,
Krzysztof

[1] https://www.spinics.net/lists/arm-kernel/msg567053.html

>> 2017년 03월 22일 10:36에 Hoegeun Kwon 이(가) 쓴 글:
>>> Hi inki,
>>>
>>> Could you check the this patch?
>>> For reference, patch 1/5 and 2/5 have already been applied to Krzysztof tree.
>>>
>>> Best regards,
>>> Hoegeun
>>>
Inki Dae April 6, 2017, 4:33 a.m. UTC | #5
2017년 04월 05일 00:38에 Krzysztof Kozlowski 이(가) 쓴 글:
> On Tue, Mar 28, 2017 at 11:38 AM, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>> On Tue, Mar 28, 2017 at 11:26 AM, Inki Dae <inki.dae@samsung.com> wrote:
>>> Merged.
>>
>> Hi,
>>
>> I do not see the tag (with DT patches) merged by you which I provided
>> to you before. These are essential for bisectability. Without them,
>> kernel bisectability is broken. Did you merged the tag somewhere?
>>
>> Best regards,
>> Krzysztof
>>
>>> Thanks,
>>> Inki Dae
> 
> Inki,
> 
> I still do not see the DTS tag [1] merged in your tree but you applied
> patches breaking the display. I looked at exynos-drm-next branch.
> 
> We talked already about bisectability and with Hoegeun we provided
> proper solution. Hoegeun split the patchset and I sent you a stable
> tag to merge. Be aware not to apply the DTS patch because you would
> effectively duplicate it. Instead, deal like with any pull request -
> merge the tag as dependency *before* applying DRM DSI patch.

Krzysztof,

I think merging the DTS tag is not necessary because dt and drm patches will go to -next separately.
Anyway, confirmed your email just now. Seems better so did what you want.


Thanks,
Inki Dae

> 
> I saw also a branch like this:
> https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git/log/?h=exynos-drm-next-tm2
> but this is something obviously wrong. I do not know what are your
> plans to do with it, but please drop it as it brings only confusion.
> 
> Best regards,
> Krzysztof
> 
> [1] https://www.spinics.net/lists/arm-kernel/msg567053.html
> 
>>> 2017년 03월 22일 10:36에 Hoegeun Kwon 이(가) 쓴 글:
>>>> Hi inki,
>>>>
>>>> Could you check the this patch?
>>>> For reference, patch 1/5 and 2/5 have already been applied to Krzysztof tree.
>>>>
>>>> Best regards,
>>>> Hoegeun
>>>>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
>
Inki Dae April 6, 2017, 6:48 a.m. UTC | #6
2017년 04월 05일 00:38에 Krzysztof Kozlowski 이(가) 쓴 글:
> On Tue, Mar 28, 2017 at 11:38 AM, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>> On Tue, Mar 28, 2017 at 11:26 AM, Inki Dae <inki.dae@samsung.com> wrote:
>>> Merged.
>>
>> Hi,
>>
>> I do not see the tag (with DT patches) merged by you which I provided
>> to you before. These are essential for bisectability. Without them,
>> kernel bisectability is broken. Did you merged the tag somewhere?
>>
>> Best regards,
>> Krzysztof
>>
>>> Thanks,
>>> Inki Dae
> 
> Inki,
> 
> I still do not see the DTS tag [1] merged in your tree but you applied
> patches breaking the display. I looked at exynos-drm-next branch.
> 
> We talked already about bisectability and with Hoegeun we provided
> proper solution. Hoegeun split the patchset and I sent you a stable
> tag to merge. Be aware not to apply the DTS patch because you would
> effectively duplicate it. Instead, deal like with any pull request -
> merge the tag as dependency *before* applying DRM DSI patch.
> 
> I saw also a branch like this:
> https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git/log/?h=exynos-drm-next-tm2
> but this is something obviously wrong. I do not know what are your
> plans to do with it, but please drop it as it brings only confusion.

Krzysztof,

Do not make you confusing with above branch which is used just for internal test so never go -next maybe you know.
Why are you suffering from this?


Thanks,
Inki Dae

> 
> Best regards,
> Krzysztof
> 
> [1] https://www.spinics.net/lists/arm-kernel/msg567053.html
> 
>>> 2017년 03월 22일 10:36에 Hoegeun Kwon 이(가) 쓴 글:
>>>> Hi inki,
>>>>
>>>> Could you check the this patch?
>>>> For reference, patch 1/5 and 2/5 have already been applied to Krzysztof tree.
>>>>
>>>> Best regards,
>>>> Hoegeun
>>>>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index f5c04d0..2d4e118 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1652,39 +1652,23 @@  static int exynos_dsi_parse_dt(struct exynos_dsi *dsi)
 	if (ret < 0)
 		return ret;
 
-	ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0);
-	if (!ep) {
-		dev_err(dev, "no output port with endpoint specified\n");
-		return -EINVAL;
-	}
-
-	ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency",
+	ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency",
 				     &dsi->burst_clk_rate);
 	if (ret < 0)
-		goto end;
+		return ret;
 
-	ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",
+	ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency",
 				     &dsi->esc_clk_rate);
 	if (ret < 0)
-		goto end;
-
-	of_node_put(ep);
+		return ret;
 
 	ep = of_graph_get_next_endpoint(node, NULL);
-	if (!ep) {
-		ret = -EINVAL;
-		goto end;
-	}
-
-	dsi->bridge_node = of_graph_get_remote_port_parent(ep);
-	if (!dsi->bridge_node) {
-		ret = -EINVAL;
-		goto end;
+	if (ep) {
+		dsi->bridge_node = of_graph_get_remote_port_parent(ep);
+		of_node_put(ep);
 	}
-end:
-	of_node_put(ep);
 
-	return ret;
+	return 0;
 }
 
 static int exynos_dsi_bind(struct device *dev, struct device *master,