lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 06 Sep 2015 15:49:56 +0800
From:	Yakir Yang <ykk@...k-chips.com>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Heiko Stuebner <heiko@...ech.de>,
	Thierry Reding <treding@...dia.com>,
	Jingoo Han <jingoohan1@...il.com>,
	Inki Dae <inki.dae@...sung.com>, joe@...ches.com,
	Kukjin Kim <kgene@...nel.org>,
	Mark Yao <mark.yao@...k-chips.com>
CC:	Russell King <rmk+kernel@....linux.org.uk>, djkurtz@...omium.com,
	dianders@...omium.com, seanpaul@...omium.com, ajaynumb@...il.com,
	Andrzej Hajda <a.hajda@...sung.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	David Airlie <airlied@...ux.ie>,
	Gustavo Padovan <gustavo.padovan@...labora.co.uk>,
	Andy Yan <andy.yan@...k-chips.com>,
	Kumar Gala <galak@...eaurora.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Kishon Vijay Abraham I <kishon@...com>,
	architt@...eaurora.org, robherring2@...il.com,
	dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
	linux-rockchip@...ts.infradead.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v4 03/16] drm: bridge: analogix/dp: split exynos dp driver
 to bridge dir

Hi Krzysztof,

在 09/04/2015 08:41 AM, Krzysztof Kozlowski 写道:
> On 03.09.2015 14:30, Yakir Yang wrote:
>> Hi Krzysztof,
>>
>> 在 09/03/2015 08:58 AM, Krzysztof Kozlowski 写道:
>>> On 01.09.2015 14:49, Yakir Yang wrote:
>>>> Split the dp core driver from exynos directory to bridge
>>>> directory, and rename the core driver to analogix_dp_*,
>>>> leave the platform code to analogix_dp-exynos.
>>>>
>>>> Signed-off-by: Yakir Yang <ykk@...k-chips.com>
>>>> ---
>>>> Changes in v4:
>>>> - Take Rob suggest, update "analogix,hpd-gpios" to "hpd-gpios" DT
>>>> propery.
>>>> - Take Jingoo suggest, rename "analogix_dp-exynos.c" file name to
>>>> "exynos_dp.c"
>>>> - Take Archit suggest, create a separate folder for analogix code in
>>>> bridge/
>>>>
>>>> Changes in v3:
>>>> - Take Thierry Reding suggest, move exynos's video_timing code
>>>>     to analogix_dp-exynos platform driver, add get_modes method
>>>>     to struct analogix_dp_plat_data.
>>>> - Take Heiko suggest, rename some "samsung*" dts propery to "analogix*".
>>>>
>>>> Changes in v2:
>>>> - Take Jingoo Han suggest, remove new copyright
>>>> - Fix compiled failed dut to analogix_dp_device misspell

[.....]

>>>> -static int exynos_dp_bridge_attach(struct drm_bridge *bridge)
>>>> +static int analogix_dp_bridge_attach(struct drm_bridge *bridge)
>>>>    {
>>>> -    struct exynos_dp_device *dp = bridge->driver_private;
>>>> -    struct drm_encoder *encoder = &dp->encoder;
>>>> +    struct analogix_dp_device *dp = bridge->driver_private;
>>>> +    struct drm_encoder *encoder = dp->encoder;
>>>>        struct drm_connector *connector = &dp->connector;
>>>>        int ret;
>>>>    -    /* Pre-empt DP connector creation if there's a bridge */
>>>> -    if (dp->ptn_bridge) {
>>>> -        ret = exynos_drm_attach_lcd_bridge(dp, encoder);
>>>> -        if (!ret)
>>>> -            return 0;
>>>> +    if (!bridge->encoder) {
>>>> +        DRM_ERROR("Parent encoder object not found");
>>>> +        return -ENODEV;
>>>>        }
>>>>    +    encoder->bridge = bridge;
>>>> +
>>>>        connector->polled = DRM_CONNECTOR_POLL_HPD;
>>>>          ret = drm_connector_init(dp->drm_dev, connector,
>>>> -                 &exynos_dp_connector_funcs,
>>>> +                 &analogix_dp_connector_funcs,
>>>>                     DRM_MODE_CONNECTOR_eDP);
>>>>        if (ret) {
>>>>            DRM_ERROR("Failed to initialize connector with drm\n");
>>>>            return ret;
>>>>        }
>>>>    -    drm_connector_helper_add(connector,
>>>> &exynos_dp_connector_helper_funcs);
>>>> +    drm_connector_helper_add(connector,
>>>> +                 &analogix_dp_connector_helper_funcs);
>>>>        drm_connector_register(connector);
>>>>        drm_mode_connector_attach_encoder(connector, encoder);
>>>>    -    if (dp->panel)
>>>> -        ret = drm_panel_attach(dp->panel, &dp->connector);
>>>> +    if (dp->plat_data && dp->plat_data->panel) {
>>>> +        ret = drm_panel_attach(dp->plat_data->panel, &dp->connector);
>>>> +        if (ret) {
>>>> +            DRM_ERROR("Failed to attach panel\n");
>>>> +            return ret;
>>>> +        }
>>>> +    }
>>>> +
>>>> +    /*
>>>> +     * This should be the end of attach function, caused
>>>> +     * we should ensure dp bridge could attach first.
>>>> +     */
>>>> +     if (dp->plat_data && dp->plat_data->attach) {
>>>> +         ret = dp->plat_data->attach(dp->plat_data, bridge);
>>>> +         if (ret) {
>>>> +             DRM_ERROR("Failed at platform attch func\n");
>>> Two new error paths appeared here and above. Don't you have to
>>> cleanup something? I don't know, just wondering...
>> Hmm... I think both panel & platform_attch need ERROR remind when
>> it failed. But if it still need clean, I though it should clean the platform attch
>> error,
>> this is not relate to DRM directly, just analogix driver logic, so code would like,
>>
>> -    if (dp->panel)
>> -        ret = drm_panel_attach(dp->panel, &dp->connector);
>> +    if (dp->plat_data && dp->plat_data->panel) {
>> +        ret = drm_panel_attach(dp->plat_data->panel, &dp->connector);
>> +        if (ret) {
>> +            DRM_ERROR("Failed to attach panel\n");
>> +            return ret;
>> +        }
>> +    }
>>
>> +    /*
>> +     * This should be the end of attach function, caused
>> +     * we should ensure dp bridge could attach first.
>> +     */
>> +     if (dp->plat_data && dp->plat_data->attach) {
>> +         ret = dp->plat_data->attach(dp->plat_data, bridge);
>>
>>            return ret;
> I am lost... the code looks the same. What did you change?

I just remove the DRM_ERROR after dp->plat_data->attach(),
maybe I should paste the change that rebase on this patch,
here are they,

     /*
      * This should be the end of attach function, caused
      * we should ensure dp bridge could attach first.
      */
-     if (dp->plat_data && dp->plat_data->attach) {
+     if (dp->plat_data && dp->plat_data->attach)
            ret = dp->plat_data->attach(dp->plat_data, bridge);
-          if (ret) {
-              DRM_ERROR("Failed at platform attch func\n");
-              return ret;
-          }
-      }

-    return 0;
+   return ret;


If this haven't meet your comment, I maybe start to think that
your comment  "Two new error paths appeared here and above"
indicated that those two function is the same.
     "dp->plat_data->attach(dp->plat_data, bridge); "
     "drm_panel_attach(dp->plat_data->panel, &dp->connector); "

Thanks,
- Yakir
> Best regards,
> Krzysztof
>
>
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ