From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932421AbcFHKxc (ORCPT ); Wed, 8 Jun 2016 06:53:32 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:50120 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753638AbcFHKx2 (ORCPT ); Wed, 8 Jun 2016 06:53:28 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: ykk@rock-chips.com X-FST-TO: linux-arm-kernel@lists.infradead.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: ykk@rock-chips.com X-UNIQUE-TAG: <4b93714ca152f0ad551051616bfcbabf> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v14.1 01/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory To: Marc Zyngier References: <1455534485-1154-1-git-send-email-ykk@rock-chips.com> <1455534576-1486-1-git-send-email-ykk@rock-chips.com> <1811552.qvsCm7GUs1@diego> <417ed48e-74e1-f747-34b9-0d1031a3d862@osg.samsung.com> <575774C0.4000900@rock-chips.com> <20160608084419.602f02d2@arm.com> Cc: Javier Martinez Canillas , =?UTF-8?Q?Heiko_St=c3=bcbner?= , Inki Dae , Andrzej Hajda , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Jingoo Han , Thierry Reding , Krzysztof Kozlowski , Rob Herring , Mark Yao , Russell King , djkurtz@chromium.org, Sean Paul , Kukjin Kim , Kumar Gala , emil.l.velikov@gmail.com, Ian Campbell , Gustavo Padovan , Kishon Vijay Abraham I , Pawel Moll , ajaynumb@gmail.com, robherring2@gmail.com, Andy Yan , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org From: Yakir Yang Message-ID: <5757F917.2030506@rock-chips.com> Date: Wed, 8 Jun 2016 18:53:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160608084419.602f02d2@arm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Marc, Javier On 06/08/2016 03:44 PM, Marc Zyngier wrote: > On Wed, 8 Jun 2016 09:28:32 +0800 > Yakir Yang wrote: > >> Hi Javier, >> >> On 06/08/2016 01:06 AM, Javier Martinez Canillas wrote: >>> Hello Yakir, >>> >>> On 03/17/2016 05:47 PM, Heiko Stübner wrote: >>>> Split the dp core driver from exynos directory to bridge directory, >>>> and rename the core driver to analogix_dp_*, rename the platform >>>> code to exynos_dp. >>>> >>>> Beside the new analogix_dp driver would export six hooks. >>>> "analogix_dp_bind()" and "analogix_dp_unbind()" >>>> "analogix_dp_suspned()" and "analogix_dp_resume()" >>>> "analogix_dp_detect()" and "analogix_dp_get_modes()" >>>> >>>> The bind/unbind symbols is used for analogix platform driver to connect >>>> with analogix_dp core driver. And the detect/get_modes is used for analogix >>>> platform driver to init the connector. >>>> >>>> They reason why connector need register in helper driver is rockchip drm >>>> haven't implement the atomic API, but Exynos drm have implement it, so >>>> there would need two different connector helper functions, that's why we >>>> leave the connector register in helper driver. >>>> >>>> Signed-off-by: Yakir Yang >>>> --- >>> Marc reported that his Exynos5250 Snow Chromebook fails to boot with v4.7-rc. >>> >>> I've done a git bisect and tracked down to this commit. The problem is a NULL >>> pointer dereference to connector->dev in drm_mode_create(connector->dev) when >>> called from exynos_dp_get_modes(). The error log is at [1]. >>> >>> I'm trying to figure out the issue but wanted to mention in case you have any >>> hints about what could be the cause. AFAICT the problem is related to the fact >>> that drm_connector_init() is called in analogix_dp_bridge_attach() and the >>> connector passed as argument is the one in struct analogix_dp_device *dp, but >>> later exynos_dp_get_modes() calls drm_mode_create() passing the connector in >>> struct exynos_dp_device *dp, which has not been previously initialized. >> Agree, this should be the problem, exynos_dp->connector haven't been >> initialized, driver should make exynos_dp->dp to a connector point, and >> record the passing connector in exynos_dp_bridge_attach(), that should >> fix this problem. >> >> >> Thanks, >> - Yakir >> >> >> diff --git a/drivers/gpu/drm/exynos/exynos_dp.c >> b/drivers/gpu/drm/exynos/exynos_dp.c >> index 468498e..4c1fb3f 100644 >> --- a/drivers/gpu/drm/exynos/exynos_dp.c >> +++ b/drivers/gpu/drm/exynos/exynos_dp.c >> @@ -34,7 +34,7 @@ >> >> struct exynos_dp_device { >> struct drm_encoder encoder; >> - struct drm_connector connector; >> + struct drm_connector *connector; >> struct drm_bridge *ptn_bridge; >> struct drm_device *drm_dev; >> struct device *dev; >> @@ -70,7 +70,7 @@ static int exynos_dp_poweroff(struct >> analogix_dp_plat_data *plat_data) >> static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data) >> { >> struct exynos_dp_device *dp = to_dp(plat_data); >> - struct drm_connector *connector = &dp->connector; >> + struct drm_connector *connector = dp->connector; >> struct drm_display_mode *mode; >> int num_modes = 0; >> >> @@ -103,6 +103,7 @@ static int exynos_dp_bridge_attach(struct >> analogix_dp_plat_data *plat_data, >> int ret; >> >> drm_connector_register(connector); >> + dp->connector = connector; >> >> /* Pre-empt DP connector creation if there's a bridge */ >> if (dp->ptn_bridge) { >> > I've just tested this change, and in combination with Javier's DT patch, > my Snow is back to its useful state (I'm writing this email from that > very Chromebook). > > Once you make this a proper patch, please add my: > > Tested-by: Marc Zyngier I guess Javier should be the best one to create this patch, if he have no time, i would do it for him. thanks for your report ;) - Yakir > to it. > > Thanks a lot to you and Javier for tracking this down! > > M. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yakir Yang Subject: Re: [PATCH v14.1 01/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory Date: Wed, 8 Jun 2016 18:53:11 +0800 Message-ID: <5757F917.2030506@rock-chips.com> References: <1455534485-1154-1-git-send-email-ykk@rock-chips.com> <1455534576-1486-1-git-send-email-ykk@rock-chips.com> <1811552.qvsCm7GUs1@diego> <417ed48e-74e1-f747-34b9-0d1031a3d862@osg.samsung.com> <575774C0.4000900@rock-chips.com> <20160608084419.602f02d2@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20160608084419.602f02d2@arm.com> Sender: linux-samsung-soc-owner@vger.kernel.org To: Marc Zyngier Cc: Javier Martinez Canillas , =?UTF-8?Q?Heiko_St=c3=bcbner?= , Inki Dae , Andrzej Hajda , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Jingoo Han , Thierry Reding , Krzysztof Kozlowski , Rob Herring , Mark Yao , Russell King , djkurtz@chromium.org, Sean Paul , Kukjin Kim , Kumar Gala , emil.l.velikov@gmail.com, Ian Campbell , Gustavo Padovan , Kishon Vijay Abraham I , Pawel Moll , ajaynumb@gmail.com, robherring2@g List-Id: devicetree@vger.kernel.org Marc, Javier On 06/08/2016 03:44 PM, Marc Zyngier wrote: > On Wed, 8 Jun 2016 09:28:32 +0800 > Yakir Yang wrote: > >> Hi Javier, >> >> On 06/08/2016 01:06 AM, Javier Martinez Canillas wrote: >>> Hello Yakir, >>> >>> On 03/17/2016 05:47 PM, Heiko St=FCbner wrote: >>>> Split the dp core driver from exynos directory to bridge directory= , >>>> and rename the core driver to analogix_dp_*, rename the platform >>>> code to exynos_dp. >>>> >>>> Beside the new analogix_dp driver would export six hooks. >>>> "analogix_dp_bind()" and "analogix_dp_unbind()" >>>> "analogix_dp_suspned()" and "analogix_dp_resume()" >>>> "analogix_dp_detect()" and "analogix_dp_get_modes()" >>>> >>>> The bind/unbind symbols is used for analogix platform driver to co= nnect >>>> with analogix_dp core driver. And the detect/get_modes is used for= analogix >>>> platform driver to init the connector. >>>> >>>> They reason why connector need register in helper driver is rockch= ip drm >>>> haven't implement the atomic API, but Exynos drm have implement it= , so >>>> there would need two different connector helper functions, that's = why we >>>> leave the connector register in helper driver. >>>> >>>> Signed-off-by: Yakir Yang >>>> --- >>> Marc reported that his Exynos5250 Snow Chromebook fails to boot wit= h v4.7-rc. >>> >>> I've done a git bisect and tracked down to this commit. The problem= is a NULL >>> pointer dereference to connector->dev in drm_mode_create(connector-= >dev) when >>> called from exynos_dp_get_modes(). The error log is at [1]. >>> >>> I'm trying to figure out the issue but wanted to mention in case yo= u have any >>> hints about what could be the cause. AFAICT the problem is related = to the fact >>> that drm_connector_init() is called in analogix_dp_bridge_attach() = and the >>> connector passed as argument is the one in struct analogix_dp_devic= e *dp, but >>> later exynos_dp_get_modes() calls drm_mode_create() passing the con= nector in >>> struct exynos_dp_device *dp, which has not been previously initiali= zed. >> Agree, this should be the problem, exynos_dp->connector haven't been >> initialized, driver should make exynos_dp->dp to a connector point, = and >> record the passing connector in exynos_dp_bridge_attach(), that shou= ld >> fix this problem. >> >> >> Thanks, >> - Yakir >> >> >> diff --git a/drivers/gpu/drm/exynos/exynos_dp.c >> b/drivers/gpu/drm/exynos/exynos_dp.c >> index 468498e..4c1fb3f 100644 >> --- a/drivers/gpu/drm/exynos/exynos_dp.c >> +++ b/drivers/gpu/drm/exynos/exynos_dp.c >> @@ -34,7 +34,7 @@ >> >> struct exynos_dp_device { >> struct drm_encoder encoder; >> - struct drm_connector connector; >> + struct drm_connector *connector; >> struct drm_bridge *ptn_bridge; >> struct drm_device *drm_dev; >> struct device *dev; >> @@ -70,7 +70,7 @@ static int exynos_dp_poweroff(struct >> analogix_dp_plat_data *plat_data) >> static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat= _data) >> { >> struct exynos_dp_device *dp =3D to_dp(plat_data); >> - struct drm_connector *connector =3D &dp->connector; >> + struct drm_connector *connector =3D dp->connector; >> struct drm_display_mode *mode; >> int num_modes =3D 0; >> >> @@ -103,6 +103,7 @@ static int exynos_dp_bridge_attach(struct >> analogix_dp_plat_data *plat_data, >> int ret; >> >> drm_connector_register(connector); >> + dp->connector =3D connector; >> >> /* Pre-empt DP connector creation if there's a bridge */ >> if (dp->ptn_bridge) { >> > I've just tested this change, and in combination with Javier's DT pat= ch, > my Snow is back to its useful state (I'm writing this email from that > very Chromebook). > > Once you make this a proper patch, please add my: > > Tested-by: Marc Zyngier I guess Javier should be the best one to create this patch, if he have=20 no time, i would do it for him. thanks for your report ;) - Yakir > to it. > > Thanks a lot to you and Javier for tracking this down! > > M. From mboxrd@z Thu Jan 1 00:00:00 1970 From: ykk@rock-chips.com (Yakir Yang) Date: Wed, 8 Jun 2016 18:53:11 +0800 Subject: [PATCH v14.1 01/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory In-Reply-To: <20160608084419.602f02d2@arm.com> References: <1455534485-1154-1-git-send-email-ykk@rock-chips.com> <1455534576-1486-1-git-send-email-ykk@rock-chips.com> <1811552.qvsCm7GUs1@diego> <417ed48e-74e1-f747-34b9-0d1031a3d862@osg.samsung.com> <575774C0.4000900@rock-chips.com> <20160608084419.602f02d2@arm.com> Message-ID: <5757F917.2030506@rock-chips.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Marc, Javier On 06/08/2016 03:44 PM, Marc Zyngier wrote: > On Wed, 8 Jun 2016 09:28:32 +0800 > Yakir Yang wrote: > >> Hi Javier, >> >> On 06/08/2016 01:06 AM, Javier Martinez Canillas wrote: >>> Hello Yakir, >>> >>> On 03/17/2016 05:47 PM, Heiko St?bner wrote: >>>> Split the dp core driver from exynos directory to bridge directory, >>>> and rename the core driver to analogix_dp_*, rename the platform >>>> code to exynos_dp. >>>> >>>> Beside the new analogix_dp driver would export six hooks. >>>> "analogix_dp_bind()" and "analogix_dp_unbind()" >>>> "analogix_dp_suspned()" and "analogix_dp_resume()" >>>> "analogix_dp_detect()" and "analogix_dp_get_modes()" >>>> >>>> The bind/unbind symbols is used for analogix platform driver to connect >>>> with analogix_dp core driver. And the detect/get_modes is used for analogix >>>> platform driver to init the connector. >>>> >>>> They reason why connector need register in helper driver is rockchip drm >>>> haven't implement the atomic API, but Exynos drm have implement it, so >>>> there would need two different connector helper functions, that's why we >>>> leave the connector register in helper driver. >>>> >>>> Signed-off-by: Yakir Yang >>>> --- >>> Marc reported that his Exynos5250 Snow Chromebook fails to boot with v4.7-rc. >>> >>> I've done a git bisect and tracked down to this commit. The problem is a NULL >>> pointer dereference to connector->dev in drm_mode_create(connector->dev) when >>> called from exynos_dp_get_modes(). The error log is at [1]. >>> >>> I'm trying to figure out the issue but wanted to mention in case you have any >>> hints about what could be the cause. AFAICT the problem is related to the fact >>> that drm_connector_init() is called in analogix_dp_bridge_attach() and the >>> connector passed as argument is the one in struct analogix_dp_device *dp, but >>> later exynos_dp_get_modes() calls drm_mode_create() passing the connector in >>> struct exynos_dp_device *dp, which has not been previously initialized. >> Agree, this should be the problem, exynos_dp->connector haven't been >> initialized, driver should make exynos_dp->dp to a connector point, and >> record the passing connector in exynos_dp_bridge_attach(), that should >> fix this problem. >> >> >> Thanks, >> - Yakir >> >> >> diff --git a/drivers/gpu/drm/exynos/exynos_dp.c >> b/drivers/gpu/drm/exynos/exynos_dp.c >> index 468498e..4c1fb3f 100644 >> --- a/drivers/gpu/drm/exynos/exynos_dp.c >> +++ b/drivers/gpu/drm/exynos/exynos_dp.c >> @@ -34,7 +34,7 @@ >> >> struct exynos_dp_device { >> struct drm_encoder encoder; >> - struct drm_connector connector; >> + struct drm_connector *connector; >> struct drm_bridge *ptn_bridge; >> struct drm_device *drm_dev; >> struct device *dev; >> @@ -70,7 +70,7 @@ static int exynos_dp_poweroff(struct >> analogix_dp_plat_data *plat_data) >> static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data) >> { >> struct exynos_dp_device *dp = to_dp(plat_data); >> - struct drm_connector *connector = &dp->connector; >> + struct drm_connector *connector = dp->connector; >> struct drm_display_mode *mode; >> int num_modes = 0; >> >> @@ -103,6 +103,7 @@ static int exynos_dp_bridge_attach(struct >> analogix_dp_plat_data *plat_data, >> int ret; >> >> drm_connector_register(connector); >> + dp->connector = connector; >> >> /* Pre-empt DP connector creation if there's a bridge */ >> if (dp->ptn_bridge) { >> > I've just tested this change, and in combination with Javier's DT patch, > my Snow is back to its useful state (I'm writing this email from that > very Chromebook). > > Once you make this a proper patch, please add my: > > Tested-by: Marc Zyngier I guess Javier should be the best one to create this patch, if he have no time, i would do it for him. thanks for your report ;) - Yakir > to it. > > Thanks a lot to you and Javier for tracking this down! > > M.