Revert panel fixes and original buggy patch
Subsystems (4)
cover Revert panel fixes and original buggy patch
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.
---
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,
Signature · 1 line
Linus Walleij <[email protected]>
PATCH 1/3 Revert "driver core: Export device_is_dependent() to modules"
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."
--- drivers/base/core.c | 1 - 1 file changed, 1 deletion(-)
drivers/base/core.c +0 -1
@@ -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,
Signature · 1 line
2.41.0
Re: [PATCH 1/3] Revert "driver core: Export device_is_dependent() to modules"
Quoted 22 lines · 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."
Signed-off-by Linus Walleij <[email protected]>--- drivers/base/core.c | 1 - 1 file changed, 1 deletion(-)drivers/base/core.c +0
-0
drivers/base/core.c int device_is_dependent(struct device *dev, void *target) · line 333
Quoted 7 lines
drivers/base/core.c +0
-1@@ -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,
PATCH 2/3 Revert "drm/bridge: panel: Check device dependency before managing device link"
In reply to Linus WalleijThis 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.
--- drivers/gpu/drm/bridge/panel.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/bridge/panel.c +9 -18
@@ -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.
Signature · 1 line
2.41.0
Re: [PATCH 2/3] Revert "drm/bridge: panel: Check device dependency before managing device link"
Quoted 70 lines · 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/ open hereSigned-off-by Linus Walleij <[email protected]>--- drivers/gpu/drm/bridge/panel.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-)drivers/gpu/drm/bridge/panel.c +8
-16@@ -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; }
drivers/gpu/drm/bridge/panel.c static void panel_bridge_detach(struct drm_bridge *bridge) · line 121
Quoted 9 lines
drivers/gpu/drm/bridge/panel.c +1
-2@@ -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.
PATCH 3/3 Revert "drm/bridge: panel: Add a device link between drm device and panel device"
In reply to Linus WalleijThis 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.
--- drivers/gpu/drm/bridge/panel.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/gpu/drm/bridge/panel.c +0 -17
@@ -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. *
Signature · 1 line
2.41.0
Re: [PATCH 3/3] Revert "drm/bridge: panel: Add a device link between drm device and panel device"
Quoted 71 lines · 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 <[email protected]>Link https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/ open hereSigned-off-by Linus Walleij <[email protected]>--- drivers/gpu/drm/bridge/panel.c | 17 ----------------- 1 file changed, 17 deletions(-)drivers/gpu/drm/bridge/panel.c +0
-15@@ -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; }
drivers/gpu/drm/bridge/panel.c static void panel_bridge_detach(struct drm_bridge *bridge) · line 105
Quoted 8 lines
drivers/gpu/drm/bridge/panel.c +0
-2@@ -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. *
Laurent Pinchart
reviewerHi Linus,
Quoted 11 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"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 <[email protected]>---
Linus Walleij (3):
Revert "driver core: Exportdevice_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.
Quoted 7 lines
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
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 6 lines · Laurent Pinchart
Quoted 5 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"drm/bridge: panel: Add a device link between drm device and panel device" and then it reverts that patch as well.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Linus Walleij <[email protected]>---
Linus Walleij (3):
Revert "driver core: Exportdevice_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
Laurent Pinchart
reviewerQuoted 16 lines · Linus Walleij
Quoted 6 lines · Laurent Pinchart
Quoted 5 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"drm/bridge: panel: Add a device link between drm device and panel device" and then it reverts that patch as well.Quoted 8 lines
Quoted 6 lines
Signed-off-by Linus Walleij <[email protected]>---
Linus Walleij (3):
Revert "driver core: Exportdevice_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.
Quoted 7 lines
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.
Signature · 3 lines
Regards, Laurent Pinchart
Greg Kroah-Hartman
maintainerQuoted 23 lines · Laurent Pinchart
Quoted 22 lines · Linus Walleij
Quoted 6 lines · Laurent Pinchart
Quoted 5 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"drm/bridge: panel: Add a device link between drm device and panel device" and then it reverts that patch as well.Quoted 8 lines
Quoted 6 lines
Signed-off-by Linus Walleij <[email protected]>---
Linus Walleij (3):
Revert "driver core: Exportdevice_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.
Quoted 6 lines
Quoted 1 line
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
Neil Armstrong
maintainerHi Linus,
Quoted 17 lines · Linus Walleij
Quoted 6 lines · Laurent Pinchart
Quoted 5 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"drm/bridge: panel: Add a device link between drm device and panel device" and then it reverts that patch as well.Quoted 8 lines
Quoted 6 lines
Signed-off-by Linus Walleij <[email protected]>---
Linus Walleij (3):
Revert "driver core: Exportdevice_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.
Quoted 7 lines
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
Quoted 3 lines
Yours,
Linus Walleij
Quoted 1 line · Neil Armstrong
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
[email protected]
maintainerQuoted 6 lines · Linus Walleij
Quoted 1 line · Neil Armstrong
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
Quoted 3 lines
Yours,
Linus Walleij
Re: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
In reply to Linus WalleijHi,
Quoted 6 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"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
Signature · 1 line
Neil
Neil Armstrong
maintainerRe: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
Quoted 10 lines · Neil Armstrong
Hi,
Quoted 6 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"drm/bridge: panel: Add a device link between drm device and panel device" and then it reverts that patch as well.
Quoted 5 lines
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
Re: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
Quoted 11 lines · Neil Armstrong
Quoted 10 lines · Neil Armstrong
Hi,
Quoted 6 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"drm/bridge: panel: Add a device link between drm device and panel device" and then it reverts that patch as well.
Quoted 8 lines
Quoted 5 lines
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=9b6a59e5db87c2c6b3ca0391176ed4358623d5e4b4 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
Maxime Ripard
maintainerRe: (subset) [PATCH 0/3] Revert panel fixes and original buggy patch
Quoted 19 lines · Linus Walleij
Quoted 17 lines · Neil Armstrong
Quoted 15 lines · Neil Armstrong
Hi,
Quoted 6 lines · Linus Walleij
This series reverts the attempts to fix the bug that went
into v6.7-rc1 in commit199cf07ebd2b
"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
Quoted 6 lines
Quoted 2 lines
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