linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Revert panel fixes and original buggy patch
@ 2023-11-27 23:10 Linus Walleij
  2023-11-27 23:10 ` [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules" Linus Walleij
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Linus Walleij @ 2023-11-27 23:10 UTC (permalink / raw)
  To: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Linus Walleij

This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit 199cf07ebd2b
"drm/bridge: panel: Add a device link between drm device and panel device"
and then it reverts that patch as well.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Linus Walleij (3):
      Revert "driver core: Export device_is_dependent() to modules"
      Revert "drm/bridge: panel: Check device dependency before managing device link"
      Revert "drm/bridge: panel: Add a device link between drm device and panel device"

 drivers/base/core.c            |  1 -
 drivers/gpu/drm/bridge/panel.c | 26 --------------------------
 2 files changed, 27 deletions(-)
---
base-commit: 95ba893c9f4feb836ddce627efd0bb6af6667031
change-id: 20231127-revert-panel-fix-e4da3e11e7a4

Best regards,
-- 
Linus Walleij <linus.walleij@linaro.org>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules"
  2023-11-27 23:10 [PATCH 0/3] Revert panel fixes and original buggy patch Linus Walleij
@ 2023-11-27 23:10 ` Linus Walleij
  2023-11-28  8:24   ` Neil Armstrong
  2023-11-27 23:10 ` [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency before managing device link" Linus Walleij
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Linus Walleij @ 2023-11-27 23:10 UTC (permalink / raw)
  To: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Linus Walleij

This reverts commit 1d5e8f4bf06da86b71cc9169110d1a0e1e7af337.

Greg says: "why exactly is this needed?  Nothing outside of
the driver core should be needing this function, it shouldn't
be public at all (I missed that before.)

So please, revert it for now, let's figure out why DRM thinks
this is needed for it's devices, and yet no other bus/subsystem
does."

Link: https://lore.kernel.org/dri-devel/2023112739-willing-sighing-6bdd@gregkh/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/base/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index bfd2bf0364b7..67ba592afc77 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -328,7 +328,6 @@ int device_is_dependent(struct device *dev, void *target)
 	}
 	return ret;
 }
-EXPORT_SYMBOL_GPL(device_is_dependent);
 
 static void device_link_init_status(struct device_link *link,
 				    struct device *consumer,

-- 
2.41.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency before managing device link"
  2023-11-27 23:10 [PATCH 0/3] Revert panel fixes and original buggy patch Linus Walleij
  2023-11-27 23:10 ` [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules" Linus Walleij
@ 2023-11-27 23:10 ` Linus Walleij
  2023-11-28  8:24   ` Neil Armstrong
  2023-11-27 23:10 ` [PATCH 3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device" Linus Walleij
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Linus Walleij @ 2023-11-27 23:10 UTC (permalink / raw)
  To: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Linus Walleij

This reverts commit 39d5b6a64ace77d0c11c398d272218df5f939abb.

This patch was causing build errors by using an unexported
function from the device core, which Greg questions the
saneness in exporting.

Link: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpu/drm/bridge/panel.c | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
index 5e8980023407..e48823a4f1ed 100644
--- a/drivers/gpu/drm/bridge/panel.c
+++ b/drivers/gpu/drm/bridge/panel.c
@@ -23,7 +23,6 @@ struct panel_bridge {
 	struct drm_panel *panel;
 	struct device_link *link;
 	u32 connector_type;
-	bool is_independent;
 };
 
 static inline struct panel_bridge *
@@ -68,17 +67,12 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
 	struct drm_device *drm_dev = bridge->dev;
 	int ret;
 
-	panel_bridge->is_independent = !device_is_dependent(drm_dev->dev,
-							    panel->dev);
-
-	if (panel_bridge->is_independent) {
-		panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
-						     DL_FLAG_STATELESS);
-		if (!panel_bridge->link) {
-			DRM_ERROR("Failed to add device link between %s and %s\n",
-				  dev_name(drm_dev->dev), dev_name(panel->dev));
-			return -EINVAL;
-		}
+	panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
+					     DL_FLAG_STATELESS);
+	if (!panel_bridge->link) {
+		DRM_ERROR("Failed to add device link between %s and %s\n",
+			  dev_name(drm_dev->dev), dev_name(panel->dev));
+		return -EINVAL;
 	}
 
 	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
@@ -86,8 +80,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
 
 	if (!bridge->encoder) {
 		DRM_ERROR("Missing encoder\n");
-		if (panel_bridge->is_independent)
-			device_link_del(panel_bridge->link);
+		device_link_del(panel_bridge->link);
 		return -ENODEV;
 	}
 
@@ -99,8 +92,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
 				 panel_bridge->connector_type);
 	if (ret) {
 		DRM_ERROR("Failed to initialize connector\n");
-		if (panel_bridge->is_independent)
-			device_link_del(panel_bridge->link);
+		device_link_del(panel_bridge->link);
 		return ret;
 	}
 
@@ -123,8 +115,7 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
 	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
 	struct drm_connector *connector = &panel_bridge->connector;
 
-	if (panel_bridge->is_independent)
-		device_link_del(panel_bridge->link);
+	device_link_del(panel_bridge->link);
 
 	/*
 	 * Cleanup the connector if we know it was initialized.

-- 
2.41.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device"
  2023-11-27 23:10 [PATCH 0/3] Revert panel fixes and original buggy patch Linus Walleij
  2023-11-27 23:10 ` [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules" Linus Walleij
  2023-11-27 23:10 ` [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency before managing device link" Linus Walleij
@ 2023-11-27 23:10 ` Linus Walleij
  2023-11-28  8:24   ` Neil Armstrong
  2023-11-27 23:25 ` [PATCH 0/3] Revert panel fixes and original buggy patch Laurent Pinchart
  2023-11-28 10:12 ` (subset) " Neil Armstrong
  4 siblings, 1 reply; 18+ messages in thread
From: Linus Walleij @ 2023-11-27 23:10 UTC (permalink / raw)
  To: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Linus Walleij

This reverts commit 199cf07ebd2b0d41185ac79b895547d45610b681.

This patch creates bugs on devices where the DRM device is
the ancestor of the panel devices.

Attempts to fix this have failed because it leads to using
device core functionality which is questionable.

Reported-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpu/drm/bridge/panel.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
index e48823a4f1ed..7f41525f7a6e 100644
--- a/drivers/gpu/drm/bridge/panel.c
+++ b/drivers/gpu/drm/bridge/panel.c
@@ -4,8 +4,6 @@
  * Copyright (C) 2017 Broadcom
  */
 
-#include <linux/device.h>
-
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_bridge.h>
 #include <drm/drm_connector.h>
@@ -21,7 +19,6 @@ struct panel_bridge {
 	struct drm_bridge bridge;
 	struct drm_connector connector;
 	struct drm_panel *panel;
-	struct device_link *link;
 	u32 connector_type;
 };
 
@@ -63,24 +60,13 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
 {
 	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
 	struct drm_connector *connector = &panel_bridge->connector;
-	struct drm_panel *panel = panel_bridge->panel;
-	struct drm_device *drm_dev = bridge->dev;
 	int ret;
 
-	panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
-					     DL_FLAG_STATELESS);
-	if (!panel_bridge->link) {
-		DRM_ERROR("Failed to add device link between %s and %s\n",
-			  dev_name(drm_dev->dev), dev_name(panel->dev));
-		return -EINVAL;
-	}
-
 	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
 		return 0;
 
 	if (!bridge->encoder) {
 		DRM_ERROR("Missing encoder\n");
-		device_link_del(panel_bridge->link);
 		return -ENODEV;
 	}
 
@@ -92,7 +78,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
 				 panel_bridge->connector_type);
 	if (ret) {
 		DRM_ERROR("Failed to initialize connector\n");
-		device_link_del(panel_bridge->link);
 		return ret;
 	}
 
@@ -115,8 +100,6 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
 	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
 	struct drm_connector *connector = &panel_bridge->connector;
 
-	device_link_del(panel_bridge->link);
-
 	/*
 	 * Cleanup the connector if we know it was initialized.
 	 *

-- 
2.41.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-27 23:10 [PATCH 0/3] Revert panel fixes and original buggy patch Linus Walleij
                   ` (2 preceding siblings ...)
  2023-11-27 23:10 ` [PATCH 3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device" Linus Walleij
@ 2023-11-27 23:25 ` Laurent Pinchart
  2023-11-27 23:36   ` Linus Walleij
  2023-11-28 10:12 ` (subset) " Neil Armstrong
  4 siblings, 1 reply; 18+ messages in thread
From: Laurent Pinchart @ 2023-11-27 23:25 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, linux-kernel, dri-devel

Hi Linus,

On Tue, Nov 28, 2023 at 12:10:18AM +0100, Linus Walleij wrote:
> This series reverts the attempts to fix the bug that went
> into v6.7-rc1 in commit 199cf07ebd2b
> "drm/bridge: panel: Add a device link between drm device and panel device"
> and then it reverts that patch as well.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Linus Walleij (3):
>       Revert "driver core: Export device_is_dependent() to modules"
>       Revert "drm/bridge: panel: Check device dependency before managing device link"
>       Revert "drm/bridge: panel: Add a device link between drm device and panel device"

To preserve bisectability, you should revert in the opposite order.

> 
>  drivers/base/core.c            |  1 -
>  drivers/gpu/drm/bridge/panel.c | 26 --------------------------
>  2 files changed, 27 deletions(-)
> ---
> base-commit: 95ba893c9f4feb836ddce627efd0bb6af6667031
> change-id: 20231127-revert-panel-fix-e4da3e11e7a4

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-27 23:25 ` [PATCH 0/3] Revert panel fixes and original buggy patch Laurent Pinchart
@ 2023-11-27 23:36   ` Linus Walleij
  2023-11-27 23:52     ` Laurent Pinchart
  2023-11-28  8:30     ` Neil Armstrong
  0 siblings, 2 replies; 18+ messages in thread
From: Linus Walleij @ 2023-11-27 23:36 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, linux-kernel, dri-devel

On Tue, Nov 28, 2023 at 12:25 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Tue, Nov 28, 2023 at 12:10:18AM +0100, Linus Walleij wrote:
> > This series reverts the attempts to fix the bug that went
> > into v6.7-rc1 in commit 199cf07ebd2b
> > "drm/bridge: panel: Add a device link between drm device and panel device"
> > and then it reverts that patch as well.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > Linus Walleij (3):
> >       Revert "driver core: Export device_is_dependent() to modules"
> >       Revert "drm/bridge: panel: Check device dependency before managing device link"
> >       Revert "drm/bridge: panel: Add a device link between drm device and panel device"
>
> To preserve bisectability, you should revert in the opposite order.

You mean apply patch 2, then 1, then 3 so the kernel builds after each
revert?

Yeah that's a good idea, I don't know if I should apply these though, better
someone else do it since I screwed up too much.

Another option is to just squash the reverts into one, that bisects too :/

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-27 23:36   ` Linus Walleij
@ 2023-11-27 23:52     ` Laurent Pinchart
  2023-11-28  8:28       ` Greg Kroah-Hartman
  2023-11-28  8:30     ` Neil Armstrong
  1 sibling, 1 reply; 18+ messages in thread
From: Laurent Pinchart @ 2023-11-27 23:52 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, linux-kernel, dri-devel

On Tue, Nov 28, 2023 at 12:36:15AM +0100, Linus Walleij wrote:
> On Tue, Nov 28, 2023 at 12:25 AM Laurent Pinchart wrote:
> > On Tue, Nov 28, 2023 at 12:10:18AM +0100, Linus Walleij wrote:
> > > This series reverts the attempts to fix the bug that went
> > > into v6.7-rc1 in commit 199cf07ebd2b
> > > "drm/bridge: panel: Add a device link between drm device and panel device"
> > > and then it reverts that patch as well.
> > >
> > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > > ---
> > > Linus Walleij (3):
> > >       Revert "driver core: Export device_is_dependent() to modules"
> > >       Revert "drm/bridge: panel: Check device dependency before managing device link"
> > >       Revert "drm/bridge: panel: Add a device link between drm device and panel device"
> >
> > To preserve bisectability, you should revert in the opposite order.
> 
> You mean apply patch 2, then 1, then 3 so the kernel builds after each
> revert?
> 
> Yeah that's a good idea, I don't know if I should apply these though, better
> someone else do it since I screwed up too much.
> 
> Another option is to just squash the reverts into one, that bisects too :/

I thought the commits have been applied to drm-misc in a bisectable
order in the first place, but that doesn't seem to be the case :-(
Reverting "driver core: Export device_is_dependent() to modules" last
seems to be the best option in this case. I wouldn't squash them.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules"
  2023-11-27 23:10 ` [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules" Linus Walleij
@ 2023-11-28  8:24   ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2023-11-28  8:24 UTC (permalink / raw)
  To: Linus Walleij, Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki,
	Andrzej Hajda, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel

On 28/11/2023 00:10, Linus Walleij wrote:
> This reverts commit 1d5e8f4bf06da86b71cc9169110d1a0e1e7af337.
> 
> Greg says: "why exactly is this needed?  Nothing outside of
> the driver core should be needing this function, it shouldn't
> be public at all (I missed that before.)
> 
> So please, revert it for now, let's figure out why DRM thinks
> this is needed for it's devices, and yet no other bus/subsystem
> does."
> 
> Link: https://lore.kernel.org/dri-devel/2023112739-willing-sighing-6bdd@gregkh/
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>   drivers/base/core.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index bfd2bf0364b7..67ba592afc77 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -328,7 +328,6 @@ int device_is_dependent(struct device *dev, void *target)
>   	}
>   	return ret;
>   }
> -EXPORT_SYMBOL_GPL(device_is_dependent);
>   
>   static void device_link_init_status(struct device_link *link,
>   				    struct device *consumer,
> 

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency before managing device link"
  2023-11-27 23:10 ` [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency before managing device link" Linus Walleij
@ 2023-11-28  8:24   ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2023-11-28  8:24 UTC (permalink / raw)
  To: Linus Walleij, Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki,
	Andrzej Hajda, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel

On 28/11/2023 00:10, Linus Walleij wrote:
> This reverts commit 39d5b6a64ace77d0c11c398d272218df5f939abb.
> 
> This patch was causing build errors by using an unexported
> function from the device core, which Greg questions the
> saneness in exporting.
> 
> Link: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>   drivers/gpu/drm/bridge/panel.c | 27 +++++++++------------------
>   1 file changed, 9 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
> index 5e8980023407..e48823a4f1ed 100644
> --- a/drivers/gpu/drm/bridge/panel.c
> +++ b/drivers/gpu/drm/bridge/panel.c
> @@ -23,7 +23,6 @@ struct panel_bridge {
>   	struct drm_panel *panel;
>   	struct device_link *link;
>   	u32 connector_type;
> -	bool is_independent;
>   };
>   
>   static inline struct panel_bridge *
> @@ -68,17 +67,12 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
>   	struct drm_device *drm_dev = bridge->dev;
>   	int ret;
>   
> -	panel_bridge->is_independent = !device_is_dependent(drm_dev->dev,
> -							    panel->dev);
> -
> -	if (panel_bridge->is_independent) {
> -		panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
> -						     DL_FLAG_STATELESS);
> -		if (!panel_bridge->link) {
> -			DRM_ERROR("Failed to add device link between %s and %s\n",
> -				  dev_name(drm_dev->dev), dev_name(panel->dev));
> -			return -EINVAL;
> -		}
> +	panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
> +					     DL_FLAG_STATELESS);
> +	if (!panel_bridge->link) {
> +		DRM_ERROR("Failed to add device link between %s and %s\n",
> +			  dev_name(drm_dev->dev), dev_name(panel->dev));
> +		return -EINVAL;
>   	}
>   
>   	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> @@ -86,8 +80,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
>   
>   	if (!bridge->encoder) {
>   		DRM_ERROR("Missing encoder\n");
> -		if (panel_bridge->is_independent)
> -			device_link_del(panel_bridge->link);
> +		device_link_del(panel_bridge->link);
>   		return -ENODEV;
>   	}
>   
> @@ -99,8 +92,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
>   				 panel_bridge->connector_type);
>   	if (ret) {
>   		DRM_ERROR("Failed to initialize connector\n");
> -		if (panel_bridge->is_independent)
> -			device_link_del(panel_bridge->link);
> +		device_link_del(panel_bridge->link);
>   		return ret;
>   	}
>   
> @@ -123,8 +115,7 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
>   	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
>   	struct drm_connector *connector = &panel_bridge->connector;
>   
> -	if (panel_bridge->is_independent)
> -		device_link_del(panel_bridge->link);
> +	device_link_del(panel_bridge->link);
>   
>   	/*
>   	 * Cleanup the connector if we know it was initialized.
> 

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device"
  2023-11-27 23:10 ` [PATCH 3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device" Linus Walleij
@ 2023-11-28  8:24   ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2023-11-28  8:24 UTC (permalink / raw)
  To: Linus Walleij, Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki,
	Andrzej Hajda, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel

On 28/11/2023 00:10, Linus Walleij wrote:
> This reverts commit 199cf07ebd2b0d41185ac79b895547d45610b681.
> 
> This patch creates bugs on devices where the DRM device is
> the ancestor of the panel devices.
> 
> Attempts to fix this have failed because it leads to using
> device core functionality which is questionable.
> 
> Reported-by: Linus Walleij <linus.walleij@linaro.org>
> Link: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>   drivers/gpu/drm/bridge/panel.c | 17 -----------------
>   1 file changed, 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
> index e48823a4f1ed..7f41525f7a6e 100644
> --- a/drivers/gpu/drm/bridge/panel.c
> +++ b/drivers/gpu/drm/bridge/panel.c
> @@ -4,8 +4,6 @@
>    * Copyright (C) 2017 Broadcom
>    */
>   
> -#include <linux/device.h>
> -
>   #include <drm/drm_atomic_helper.h>
>   #include <drm/drm_bridge.h>
>   #include <drm/drm_connector.h>
> @@ -21,7 +19,6 @@ struct panel_bridge {
>   	struct drm_bridge bridge;
>   	struct drm_connector connector;
>   	struct drm_panel *panel;
> -	struct device_link *link;
>   	u32 connector_type;
>   };
>   
> @@ -63,24 +60,13 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
>   {
>   	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
>   	struct drm_connector *connector = &panel_bridge->connector;
> -	struct drm_panel *panel = panel_bridge->panel;
> -	struct drm_device *drm_dev = bridge->dev;
>   	int ret;
>   
> -	panel_bridge->link = device_link_add(drm_dev->dev, panel->dev,
> -					     DL_FLAG_STATELESS);
> -	if (!panel_bridge->link) {
> -		DRM_ERROR("Failed to add device link between %s and %s\n",
> -			  dev_name(drm_dev->dev), dev_name(panel->dev));
> -		return -EINVAL;
> -	}
> -
>   	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
>   		return 0;
>   
>   	if (!bridge->encoder) {
>   		DRM_ERROR("Missing encoder\n");
> -		device_link_del(panel_bridge->link);
>   		return -ENODEV;
>   	}
>   
> @@ -92,7 +78,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
>   				 panel_bridge->connector_type);
>   	if (ret) {
>   		DRM_ERROR("Failed to initialize connector\n");
> -		device_link_del(panel_bridge->link);
>   		return ret;
>   	}
>   
> @@ -115,8 +100,6 @@ static void panel_bridge_detach(struct drm_bridge *bridge)
>   	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
>   	struct drm_connector *connector = &panel_bridge->connector;
>   
> -	device_link_del(panel_bridge->link);
> -
>   	/*
>   	 * Cleanup the connector if we know it was initialized.
>   	 *
> 

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-27 23:52     ` Laurent Pinchart
@ 2023-11-28  8:28       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 18+ messages in thread
From: Greg Kroah-Hartman @ 2023-11-28  8:28 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Linus Walleij, Liu Ying, Rafael J. Wysocki, Andrzej Hajda,
	Neil Armstrong, Robert Foss, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, linux-kernel, dri-devel

On Tue, Nov 28, 2023 at 01:52:44AM +0200, Laurent Pinchart wrote:
> On Tue, Nov 28, 2023 at 12:36:15AM +0100, Linus Walleij wrote:
> > On Tue, Nov 28, 2023 at 12:25 AM Laurent Pinchart wrote:
> > > On Tue, Nov 28, 2023 at 12:10:18AM +0100, Linus Walleij wrote:
> > > > This series reverts the attempts to fix the bug that went
> > > > into v6.7-rc1 in commit 199cf07ebd2b
> > > > "drm/bridge: panel: Add a device link between drm device and panel device"
> > > > and then it reverts that patch as well.
> > > >
> > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > > > ---
> > > > Linus Walleij (3):
> > > >       Revert "driver core: Export device_is_dependent() to modules"
> > > >       Revert "drm/bridge: panel: Check device dependency before managing device link"
> > > >       Revert "drm/bridge: panel: Add a device link between drm device and panel device"
> > >
> > > To preserve bisectability, you should revert in the opposite order.
> > 
> > You mean apply patch 2, then 1, then 3 so the kernel builds after each
> > revert?
> > 
> > Yeah that's a good idea, I don't know if I should apply these though, better
> > someone else do it since I screwed up too much.
> > 
> > Another option is to just squash the reverts into one, that bisects too :/
> 
> I thought the commits have been applied to drm-misc in a bisectable
> order in the first place, but that doesn't seem to be the case :-(
> Reverting "driver core: Export device_is_dependent() to modules" last
> seems to be the best option in this case. I wouldn't squash them.

Agreed, don't squash, just revert in the opposite order they were
applied in originally, that way the tree can always build.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-27 23:36   ` Linus Walleij
  2023-11-27 23:52     ` Laurent Pinchart
@ 2023-11-28  8:30     ` Neil Armstrong
  2023-11-28  9:34       ` Linus Walleij
  1 sibling, 1 reply; 18+ messages in thread
From: Neil Armstrong @ 2023-11-28  8:30 UTC (permalink / raw)
  To: Linus Walleij, Laurent Pinchart
  Cc: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Robert Foss, Jonas Karlman, Jernej Skrabec, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
	linux-kernel, dri-devel

Hi Linus,

On 28/11/2023 00:36, Linus Walleij wrote:
> On Tue, Nov 28, 2023 at 12:25 AM Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
>> On Tue, Nov 28, 2023 at 12:10:18AM +0100, Linus Walleij wrote:
>>> This series reverts the attempts to fix the bug that went
>>> into v6.7-rc1 in commit 199cf07ebd2b
>>> "drm/bridge: panel: Add a device link between drm device and panel device"
>>> and then it reverts that patch as well.
>>>
>>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>>> ---
>>> Linus Walleij (3):
>>>        Revert "driver core: Export device_is_dependent() to modules"
>>>        Revert "drm/bridge: panel: Check device dependency before managing device link"
>>>        Revert "drm/bridge: panel: Add a device link between drm device and panel device"
>>
>> To preserve bisectability, you should revert in the opposite order.
> 
> You mean apply patch 2, then 1, then 3 so the kernel builds after each
> revert?
> 
> Yeah that's a good idea, I don't know if I should apply these though, better
> someone else do it since I screwed up too much.
> 
> Another option is to just squash the reverts into one, that bisects too :/

You can apply them now, or tell me if you want me to apply them.

Neil

> 
> Yours,
> Linus Walleij


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-28  8:30     ` Neil Armstrong
@ 2023-11-28  9:34       ` Linus Walleij
  2023-11-28 10:04         ` neil.armstrong
  0 siblings, 1 reply; 18+ messages in thread
From: Linus Walleij @ 2023-11-28  9:34 UTC (permalink / raw)
  To: neil.armstrong
  Cc: Laurent Pinchart, Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki,
	Andrzej Hajda, Robert Foss, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, linux-kernel, dri-devel

On Tue, Nov 28, 2023 at 9:30 AM Neil Armstrong
<neil.armstrong@linaro.org> wrote:

> You can apply them now, or tell me if you want me to apply them.

Please apply them Neil (to drm-misc-fixes) order 2, 1, 3 for bisectability.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-28  9:34       ` Linus Walleij
@ 2023-11-28 10:04         ` neil.armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: neil.armstrong @ 2023-11-28 10:04 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Laurent Pinchart, Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki,
	Andrzej Hajda, Robert Foss, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, linux-kernel, dri-devel

On 28/11/2023 10:34, Linus Walleij wrote:
> On Tue, Nov 28, 2023 at 9:30 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
> 
>> You can apply them now, or tell me if you want me to apply them.
> 
> Please apply them Neil (to drm-misc-fixes) order 2, 1, 3 for bisectability.

Sure, doing it right now.

Neil

> 
> Yours,
> Linus Walleij


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-27 23:10 [PATCH 0/3] Revert panel fixes and original buggy patch Linus Walleij
                   ` (3 preceding siblings ...)
  2023-11-27 23:25 ` [PATCH 0/3] Revert panel fixes and original buggy patch Laurent Pinchart
@ 2023-11-28 10:12 ` Neil Armstrong
  2023-11-28 10:13   ` Neil Armstrong
  4 siblings, 1 reply; 18+ messages in thread
From: Neil Armstrong @ 2023-11-28 10:12 UTC (permalink / raw)
  To: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, Linus Walleij
  Cc: linux-kernel, dri-devel

Hi,

On Tue, 28 Nov 2023 00:10:18 +0100, Linus Walleij wrote:
> This series reverts the attempts to fix the bug that went
> into v6.7-rc1 in commit 199cf07ebd2b
> "drm/bridge: panel: Add a device link between drm device and panel device"
> and then it reverts that patch as well.
> 
> 

Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes)

[3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device"
      https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9b6a59e5db87c2c6b3ca0391176ed4358623d5e4

-- 
Neil


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-28 10:12 ` (subset) " Neil Armstrong
@ 2023-11-28 10:13   ` Neil Armstrong
  2023-11-28 10:16     ` Linus Walleij
  0 siblings, 1 reply; 18+ messages in thread
From: Neil Armstrong @ 2023-11-28 10:13 UTC (permalink / raw)
  To: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, Linus Walleij
  Cc: linux-kernel, dri-devel

On 28/11/2023 11:12, Neil Armstrong wrote:
> Hi,
> 
> On Tue, 28 Nov 2023 00:10:18 +0100, Linus Walleij wrote:
>> This series reverts the attempts to fix the bug that went
>> into v6.7-rc1 in commit 199cf07ebd2b
>> "drm/bridge: panel: Add a device link between drm device and panel device"
>> and then it reverts that patch as well.
>>
>>
> 
> Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes)
> 
> [3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device"
>        https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9b6a59e5db87c2c6b3ca0391176ed4358623d5e4
> 

b4 got really confused that I picked the patches in the wrong order, but I applied
the 3 patched in the 2, 1, 3 order.

Neil

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-28 10:13   ` Neil Armstrong
@ 2023-11-28 10:16     ` Linus Walleij
  2023-11-28 12:27       ` Maxime Ripard
  0 siblings, 1 reply; 18+ messages in thread
From: Linus Walleij @ 2023-11-28 10:16 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki, Andrzej Hajda,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Daniel Vetter, linux-kernel, dri-devel

On Tue, Nov 28, 2023 at 11:13 AM Neil Armstrong
<neil.armstrong@linaro.org> wrote:
> On 28/11/2023 11:12, Neil Armstrong wrote:
> > Hi,
> >
> > On Tue, 28 Nov 2023 00:10:18 +0100, Linus Walleij wrote:
> >> This series reverts the attempts to fix the bug that went
> >> into v6.7-rc1 in commit 199cf07ebd2b
> >> "drm/bridge: panel: Add a device link between drm device and panel device"
> >> and then it reverts that patch as well.
> >>
> >>
> >
> > Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes)
> >
> > [3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device"
> >        https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9b6a59e5db87c2c6b3ca0391176ed4358623d5e4
> >
>
> b4 got really confused that I picked the patches in the wrong order, but I applied
> the 3 patched in the 2, 1, 3 order.

Special mistakes requires special fixes, sorry for the mess :(

Thanks a lot Neil!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
  2023-11-28 10:16     ` Linus Walleij
@ 2023-11-28 12:27       ` Maxime Ripard
  0 siblings, 0 replies; 18+ messages in thread
From: Maxime Ripard @ 2023-11-28 12:27 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Neil Armstrong, Liu Ying, Greg Kroah-Hartman, Rafael J. Wysocki,
	Andrzej Hajda, Robert Foss, Laurent Pinchart, Jonas Karlman,
	Jernej Skrabec, Maarten Lankhorst, Thomas Zimmermann,
	David Airlie, Daniel Vetter, linux-kernel, dri-devel

[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]

On Tue, Nov 28, 2023 at 11:16:23AM +0100, Linus Walleij wrote:
> On Tue, Nov 28, 2023 at 11:13 AM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
> > On 28/11/2023 11:12, Neil Armstrong wrote:
> > > Hi,
> > >
> > > On Tue, 28 Nov 2023 00:10:18 +0100, Linus Walleij wrote:
> > >> This series reverts the attempts to fix the bug that went
> > >> into v6.7-rc1 in commit 199cf07ebd2b
> > >> "drm/bridge: panel: Add a device link between drm device and panel device"
> > >> and then it reverts that patch as well.
> > >>
> > >>
> > >
> > > Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-fixes)
> > >
> > > [3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device"
> > >        https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9b6a59e5db87c2c6b3ca0391176ed4358623d5e4
> > >
> >
> > b4 got really confused that I picked the patches in the wrong order, but I applied
> > the 3 patched in the 2, 1, 3 order.
> 
> Special mistakes requires special fixes, sorry for the mess :(
>
> Thanks a lot Neil!

Thanks to both of you for the quick handling :)

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-11-28 12:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-27 23:10 [PATCH 0/3] Revert panel fixes and original buggy patch Linus Walleij
2023-11-27 23:10 ` [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules" Linus Walleij
2023-11-28  8:24   ` Neil Armstrong
2023-11-27 23:10 ` [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency before managing device link" Linus Walleij
2023-11-28  8:24   ` Neil Armstrong
2023-11-27 23:10 ` [PATCH 3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device" Linus Walleij
2023-11-28  8:24   ` Neil Armstrong
2023-11-27 23:25 ` [PATCH 0/3] Revert panel fixes and original buggy patch Laurent Pinchart
2023-11-27 23:36   ` Linus Walleij
2023-11-27 23:52     ` Laurent Pinchart
2023-11-28  8:28       ` Greg Kroah-Hartman
2023-11-28  8:30     ` Neil Armstrong
2023-11-28  9:34       ` Linus Walleij
2023-11-28 10:04         ` neil.armstrong
2023-11-28 10:12 ` (subset) " Neil Armstrong
2023-11-28 10:13   ` Neil Armstrong
2023-11-28 10:16     ` Linus Walleij
2023-11-28 12:27       ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).