Re: [PATCH v5 04/10] drm/bridge: add documentation of refcounted bridges

2025-01-29 Thread Luca Ceresoli
On Wed, 29 Jan 2025 14:22:30 +0200 Dmitry Baryshkov wrote: > On Wed, Jan 29, 2025 at 12:51:53PM +0100, Luca Ceresoli wrote: > > Hi Maxime, > > > > On Tue, 28 Jan 2025 15:49:23 +0100 > > Maxime Ripard wrote: > > > > > Hi, > > > > >

Re: [PATCH v5 04/10] drm/bridge: add documentation of refcounted bridges

2025-01-29 Thread Luca Ceresoli
Hi Maxime, On Tue, 28 Jan 2025 15:49:23 +0100 Maxime Ripard wrote: > Hi, > > On Wed, Jan 22, 2025 at 05:12:30PM +0100, Luca Ceresoli wrote: > > On Wed, 8 Jan 2025 17:02:04 +0100 > > Maxime Ripard wrote: > > > > [...] > > > > > > > >

Re: [PATCH v5 08/10] drm/bridge: samsung-dsim: use supporting variable for out_bridge

2025-01-29 Thread Luca Ceresoli
const struct drm_bridge_funcs *funcs) { void *container; struct drm_bridge *bridge; int ret; if (!funcs) { dev_warn(dev, "Missing funcs pointer\n"); return ERR_PTR(-EINVAL); } container = kzalloc(size, GFP_KERNEL); // <== NOT allocating with devm if (!container) return ERR_PTR(-ENOMEM); bridge = container + offset; ret = __devm_drm_bridge_init(dev, bridge, offset, funcs); if (ret) return ERR_PTR(ret); DRM_DEBUG("bridge=%p, container=%p, funcs=%ps ALLOC\n", bridge, container, funcs); return container; } EXPORT_SYMBOL(__devm_drm_bridge_alloc); #define devm_drm_bridge_alloc(dev, type, member, funcs) \ ((type *)__devm_drm_bridge_alloc(dev, sizeof(type), \ offsetof(type, member), funcs)) Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v5 04/10] drm/bridge: add documentation of refcounted bridges

2025-01-22 Thread Luca Ceresoli
mplement in the various drivers as it needs to be added in one place per driver. Also adding drm_bridge_enter()/exit() can be trickier to get right for non-trivial functions. Do you see any drawback in using a notification mechanism instead of drm_bridge_enter()/exit() + unplugged flag? [0] ht

Re: [PATCH v5 08/10] drm/bridge: samsung-dsim: use supporting variable for out_bridge

2025-01-21 Thread Luca Ceresoli
y, free resources and deinint, kfree) should be done? (Side note: I've been pondering on why the .destroy hook works for connectors and would not for bridges. I think it's due to the global bridge_list, or because of the different lifetime management based on drmm for connectors, or both.) It may look as if my discussion is about bridges in general and not about the panel bridge. However before delving into how to dispose of a panel bridge we need to sort out how to dispose of a bridge in the first place. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

Re: [PATCH v5 08/10] drm/bridge: samsung-dsim: use supporting variable for out_bridge

2025-01-21 Thread Luca Ceresoli
for a bridge > > Please keep it for now. > > Some of the drivers think that it returns literally panel-or-bridge (but > not both). However if panel bridge is already created, it will return > both. So those drivers need to be updated. I really believe it never returns both. Th

Re: [PATCH v5 08/10] drm/bridge: samsung-dsim: use supporting variable for out_bridge

2025-01-16 Thread Luca Ceresoli
Hello Dmitry, Maxime, All, On Fri, 10 Jan 2025 11:58:19 +0100 Luca Ceresoli wrote: > Hi Dmitry, > > On Thu, 2 Jan 2025 13:01:49 +0100 > Luca Ceresoli wrote: > > > > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c > > > > b/drivers/gpu/

Re: [PATCH v5 08/10] drm/bridge: samsung-dsim: use supporting variable for out_bridge

2025-01-10 Thread Luca Ceresoli
Hi Dmitry, On Thu, 2 Jan 2025 13:01:49 +0100 Luca Ceresoli wrote: > > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c > > > b/drivers/gpu/drm/bridge/samsung-dsim.c > > > index > > > f8b4fb8357659018ec0db65374ee5d05330639ae..c4d1563fd32019efde

Re: [PATCH v5 04/10] drm/bridge: add documentation of refcounted bridges

2025-01-08 Thread Luca Ceresoli
t; > > > Hi, > > > > > > > > Most of these comments affect your earlier patches, but let's work on > > > > the API-level view. > > > > > > > > On Tue, Dec 31, 2024 at 11:39:58AM +0100, Luca Ceresoli wrote: > >

Re: [PATCH v5 04/10] drm/bridge: add documentation of refcounted bridges

2025-01-08 Thread Luca Ceresoli
gt; the API-level view. > > > > On Tue, Dec 31, 2024 at 11:39:58AM +0100, Luca Ceresoli wrote: > > > + * When using refcounted mode, the driver should allocate ``struct > > > + * my_bridge`` using regular allocation (as opposed to ``devm_`` or > > > + * `

Re: [PATCH v5 03/10] drm/bridge: add support for refcounted DRM bridges

2025-01-02 Thread Luca Ceresoli
Hello Jani, thanks for your review. On Tue, 31 Dec 2024 13:11:31 +0200 Jani Nikula wrote: > On Tue, 31 Dec 2024, Luca Ceresoli wrote: > > DRM bridges are currently considered as a fixed element of a DRM card, and > > thus their lifetime is assumed to extend for as long as the

Re: [PATCH v5 04/10] drm/bridge: add documentation of refcounted bridges

2025-01-02 Thread Luca Ceresoli
Hello Randy, On Tue, 31 Dec 2024 09:54:41 -0800 Randy Dunlap wrote: > Hi-- > > On 12/31/24 2:39 AM, Luca Ceresoli wrote: > > Document in detail the new refcounted bridges as well as the "legacy" way. > > > > Signed-off-by: Luca Ceresoli > > > &g

Re: [PATCH v5 08/10] drm/bridge: samsung-dsim: use supporting variable for out_bridge

2025-01-02 Thread Luca Ceresoli
Hi Dmitry, On Tue, 31 Dec 2024 16:57:38 +0200 Dmitry Baryshkov wrote: > On Tue, Dec 31, 2024 at 11:40:02AM +0100, Luca Ceresoli wrote: > > Instead of using dsi->out_bridge during the bridge search process, use a > > temporary variable and assign dsi->out_bridge only on succ

Re: [PATCH v5 10/10] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges

2025-01-02 Thread Luca Ceresoli
Hi Dmitry, On Tue, 31 Dec 2024 17:29:52 +0200 Dmitry Baryshkov wrote: > On Tue, Dec 31, 2024 at 11:40:04AM +0100, Luca Ceresoli wrote: > > This driver implements the point of a DRM pipeline where a connector allows > > removal of all the following bridges up to the panel. &

[PATCH v5 01/10] drm/bridge: allow bridges to be informed about added and removed bridges

2024-12-31 Thread Luca Ceresoli
In preparation for allowing bridges to be added to and removed from a DRM card without destroying the whole card, add a new DRM bridge function called on addition and removal of bridges. Signed-off-by: Luca Ceresoli --- Changed in v5: - fixed kerneldoc errors This patch was added in v4

[PATCH v5 08/10] drm/bridge: samsung-dsim: use supporting variable for out_bridge

2024-12-31 Thread Luca Ceresoli
idge on failure. This is not necessarily a problem but it is not clean. Signed-off-by: Luca Ceresoli --- This patch was added in v5. --- drivers/gpu/drm/bridge/samsung-dsim.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim

[PATCH v5 06/10] drm/bridge: ti-sn65dsi83: use dynamic lifetime management

2024-12-31 Thread Luca Ceresoli
With proper use of drm_bridge_get() and _put(), this allows the bridge to be removable without dangling pointers and use-after-free. Signed-off-by: Luca Ceresoli --- This patch was added in v5. --- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 13 +++-- 1 file changed, 11 insertions(+), 2

[PATCH v5 02/10] drm/encoder: add drm_encoder_cleanup_from()

2024-12-31 Thread Luca Ceresoli
Supporting hardware whose final part of the DRM pipeline can be physically removed requires the ability to detach all bridges from a given point to the end of the pipeline. Introduce a variant of drm_encoder_cleanup() for this. Signed-off-by: Luca Ceresoli --- Changes in v5: none Changes in

[PATCH v5 09/10] drm/bridge: samsung-dsim: refcount the out_bridge

2024-12-31 Thread Luca Ceresoli
Refcount the out_bridge to avoid a use-after-free in case it is hot-unplugged. Signed-off-by: Luca Ceresoli --- This patch was added in v5. --- drivers/gpu/drm/bridge/samsung-dsim.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung

[PATCH v5 10/10] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges

2024-12-31 Thread Luca Ceresoli
a new connector appears: # modetest -c | grep -i '^[a-z0-9]' Connectors: idencoder status namesize (mm) modes encoders 380 disconnectedDSI-1 0x0 0 37 39 0 connected LVDS-1 344x194 1 37 Co-

[PATCH v5 04/10] drm/bridge: add documentation of refcounted bridges

2024-12-31 Thread Luca Ceresoli
Document in detail the new refcounted bridges as well as the "legacy" way. Signed-off-by: Luca Ceresoli --- This patch was added in v5. --- Documentation/gpu/drm-kms-helpers.rst | 6 ++ drivers/gpu/drm/drm_bridge.c | 122 ++ 2 files ch

[PATCH v5 07/10] drm/bridge: panel: use dynamic lifetime management

2024-12-31 Thread Luca Ceresoli
Enable lifetime management of panel-bridge, so that other modules taking a pointer to a panel bridge can refcount it and avoid use-after-free in case the panel bridge is hot-unplugged. Signed-off-by: Luca Ceresoli --- This patch was added in v5. --- drivers/gpu/drm/bridge/panel.c | 20

[PATCH v5 05/10] drm/tests: bridge: add KUnit tests for DRM bridges (init and destroy)

2024-12-31 Thread Luca Ceresoli
Add two simple KUnit tests for the newly introduced drm_bridge_init() and the corresponding .destroy deallocation function. Signed-off-by: Luca Ceresoli --- This patch was added in v5. --- drivers/gpu/drm/tests/Makefile | 1 + drivers/gpu/drm/tests/drm_bridge_test.c | 128

[PATCH v5 00/10] Add support for hot-pluggable DRM bridges

2024-12-31 Thread Luca Ceresoli
in v2: - Added bindings and driver for ge,sunh-addon-connector - Removed bindings for the hotplug-video-connector, this is now represented in DT as part of the ge,sunh-addon-connector - Various monior improvements to the DRM hotplug-bridge driver - Link to v1: https://lore.kernel.org/r/20240326

[PATCH v5 03/10] drm/bridge: add support for refcounted DRM bridges

2024-12-31 Thread Luca Ceresoli
the funcs pointer which is needed to access funcs->destroy. Signed-off-by: Luca Ceresoli --- This patch was added in v5. --- drivers/gpu/drm/drm_bridge.c | 87 include/drm/drm_bridge.h | 102 +++ 2 files

Re: [PATCH RESEND v3 4/4] drm/connector: warn when cleaning up a refcounted connector

2024-12-30 Thread Luca Ceresoli
port _cleanup instead of a _put() in the error path, so let's remove this patch 3. let's keep the patch and ignore the warning: future patches adding _cleanup() in the error path could get a kernel test robot notice like this, so it would be good to use _put() in future drive

[PATCH RESEND] drm/bridge: ti-sn65dsi83: use dev_err_probe when failing to get panel bridge

2024-12-17 Thread Luca Ceresoli
When devm_drm_of_get_bridge() fails, the probe fails silently. Use dev_err_probe() instead to log an error or report the deferral reason, whichever is applicable. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH RESEND] drm/bridge: ti-sn65dsi83: use dev_err_probe when failing to get panel bridge

2024-12-17 Thread Luca Ceresoli
Hello, On Tue, 17 Dec 2024 17:02:51 +0100 Luca Ceresoli wrote: > When devm_drm_of_get_bridge() fails, the probe fails silently. Use > dev_err_probe() instead to log an error or report the deferral reason, > whichever is applicable. > > Signed-off-by: Luca Ceresoli This patch

[PATCH RESEND v3 4/4] drm/connector: warn when cleaning up a refcounted connector

2024-12-16 Thread Luca Ceresoli
ode. Serious trouble can happen if this happens, so warn about it. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_connector.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c in

[PATCH RESEND v3 2/4] drm/atomic-helper: improve CRTC enabled/connectors mismatch logging message

2024-12-16 Thread Luca Ceresoli
-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 43cdf39019a44537794cc5a519d139b0cb770

[PATCH RESEND v3 3/4] drm/mode_object: add drm_mode_object_read_refcount()

2024-12-16 Thread Luca Ceresoli
Add a wrapper to kref_read() just like the ones already in place for kref_get() and kref_put(). This will be used for sanity checks on object lifetime. Signed-off-by: Luca Ceresoli --- Changed in v3: * use conventions for 'Returns' doc syntax * ditch DRM_DEBUG() and as a conseque

[PATCH RESEND v3 1/4] drm/drm_mode_object: fix typo in kerneldoc

2024-12-16 Thread Luca Ceresoli
Remove unintended extra word. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- include/drm/drm_mode_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index

[PATCH RESEND v3 0/4] DRM: small improvements

2024-12-16 Thread Luca Ceresoli
This series brings small improvements to the DRM documentation, logging and a warning on an incorrect code path. Signed-off-by: Luca Ceresoli --- Changes in v3: - patch 3: various fixes suggested by Jani Nikula and kernel test robot - Updated reviewed-by tags - Link to v2: https

[PATCH v2 2/2] drm/panel: simple: Add Tianma TM070JDHG34-00 panel support

2024-12-16 Thread Luca Ceresoli
Add Tianma TM070JDHG34-00 7.0" 1280x800 LVDS RGB TFT LCD panel. Panel info and datasheet: https://fortec.us/products/tm070jdhg34-00/ Reviewed-by: Neil Armstrong Signed-off-by: Luca Ceresoli --- Changes in v2: none --- drivers/gpu/drm/panel/panel-simple.c

[PATCH v2 1/2] dt-bindings: display: simple: Add Tianma TM070JDHG34-00 panel

2024-12-16 Thread Luca Ceresoli
Add the Tianma Micro-electronics TM070JDHG34-00 7.0" LVDS LCD TFT panel. Signed-off-by: Luca Ceresoli --- Changes in v2: - fix inverted lines --- Documentation/devicetree/bindings/display/panel/panel-simple.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devic

[PATCH v2 0/2] drm/panel: simple: Add Tianma TM070JDHG34-00 DT bindings and driver support

2024-12-16 Thread Luca Ceresoli
This small series adds DT bindings and panel-simple implementation for the Tianma TM070JDHG34-00 7" panel. Due to how the datasheet computes the blanking time, a quirk is needed in the timing implementation. A comment documents that in patch 2. Signed-off-by: Luca Ceresoli --- Changes

Re: [PATCH 1/2] dt-bindings: display: simple: Add Tianma TM070JDHG34-00 panel

2024-12-16 Thread Luca Ceresoli
Hello Krzysztof, On Mon, 16 Dec 2024 11:09:37 +0100 Krzysztof Kozlowski wrote: > On Tue, Dec 10, 2024 at 06:28:03PM +0100, Luca Ceresoli wrote: > > Add the Tianma Micro-electronics TM070JDHG34-00 7.0" LVDS LCD TFT panel. > > > > Signed-off-by: Luca Ceresoli

Re: [PATCH v4 5/8] i2c: i2c-core-of: follow i2c-parent phandle to probe devices from added nodes

2024-12-13 Thread Luca Ceresoli
Hello Alexander, On Thu, 12 Dec 2024 19:12:02 + "Sverdlin, Alexander" wrote: > Hi Luca! > > On Tue, 2024-09-17 at 10:53 +0200, Luca Ceresoli wrote: > > When device tree nodes are added, the I2C core tries to probe client > > devices based on the class

[PATCH 1/2] dt-bindings: display: simple: Add Tianma TM070JDHG34-00 panel

2024-12-10 Thread Luca Ceresoli
Add the Tianma Micro-electronics TM070JDHG34-00 7.0" LVDS LCD TFT panel. Signed-off-by: Luca Ceresoli --- Documentation/devicetree/bindings/display/panel/panel-simple.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.ya

[PATCH 0/2] drm/panel: simple: Add Tianma TM070JDHG34-00 DT bindings and driver support

2024-12-10 Thread Luca Ceresoli
This small series adds DT bindings and panel-simple implementation for the Tianma TM070JDHG34-00 7" panel. Due to how the datasheet computes the blanking time, a quirk is needed in the timing implementation. A comment documents that in patch 2. Signed-off-by: Luca Ceresoli --- Luca Cereso

[PATCH 2/2] drm/panel: simple: Add Tianma TM070JDHG34-00 panel support

2024-12-10 Thread Luca Ceresoli
Add Tianma TM070JDHG34-00 7.0" 1280x800 LVDS RGB TFT LCD panel. Panel info and datasheet: https://fortec.us/products/tm070jdhg34-00/ Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/panel/panel-simple.c | 42 1 file changed, 42 insertions(+) diff --

Re: [PATCH] drm: bridge: fsl-ldb: fixup mode on freq mismatch

2024-11-26 Thread Luca Ceresoli
{ > @@ -280,6 +311,7 @@ fsl_ldb_mode_valid(struct drm_bridge *bridge, > > static const struct drm_bridge_funcs funcs = { > .attach = fsl_ldb_attach, > + .mode_fixup = fsl_ldb_mode_fixup, > .atomic_enable = fsl_ldb_atomic_enable, > .atomic_disable = fsl_ldb_atomic_disable, > .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

[PATCH v3 0/4] DRM: small improvements

2024-11-11 Thread Luca Ceresoli
This series brings small improvements to the DRM documentation, logging and a warning on an incorrect code path. Signed-off-by: Luca Ceresoli --- Changes in v3: - patch 3: various fixes suggested by Jani Nikula and kernel test robot - Updated reviewed-by tags - Link to v2: https

[PATCH v3 4/4] drm/connector: warn when cleaning up a refcounted connector

2024-11-11 Thread Luca Ceresoli
ode. Serious trouble can happen if this happens, so warn about it. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_connector.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c in

[PATCH v3 3/4] drm/mode_object: add drm_mode_object_read_refcount()

2024-11-11 Thread Luca Ceresoli
Add a wrapper to kref_read() just like the ones already in place for kref_get() and kref_put(). This will be used for sanity checks on object lifetime. Signed-off-by: Luca Ceresoli --- Changed in v3: * use conventions for 'Returns' doc syntax * ditch DRM_DEBUG() and as a conseque

[PATCH v3 1/4] drm/drm_mode_object: fix typo in kerneldoc

2024-11-11 Thread Luca Ceresoli
Remove unintended extra word. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- include/drm/drm_mode_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index

[PATCH v3 2/4] drm/atomic-helper: improve CRTC enabled/connectors mismatch logging message

2024-11-11 Thread Luca Ceresoli
-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 43cdf39019a44537794cc5a519d139b0cb770

Re: [PATCH v2 3/4] drm/mode_object: add drm_mode_object_read_refcount()

2024-11-07 Thread Luca Ceresoli
Hello Jani, On Wed, 06 Nov 2024 14:03:08 +0200 Jani Nikula wrote: > On Wed, 06 Nov 2024, Luca Ceresoli wrote: > > Add a wrapper to kref_read() just like the ones already in place for > > kref_get() and kref_put(). This will be used for sanity checks on object > > lifetim

[PATCH v2 2/4] drm/atomic-helper: improve CRTC enabled/connectors mismatch logging message

2024-11-06 Thread Luca Ceresoli
-by: Luca Ceresoli --- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 43cdf39019a44537794cc5a519d139b0cb77073c..3c3bdef9bcf3c4ffcd861744f6607f317ab0c

[PATCH v2 1/4] drm/drm_mode_object: fix typo in kerneldoc

2024-11-06 Thread Luca Ceresoli
Remove unintended extra word. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli --- include/drm/drm_mode_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index

[PATCH v2 4/4] drm/connector: warn when cleaning up a refcounted connector

2024-11-06 Thread Luca Ceresoli
ode. Serious trouble can happen if this happens, so warn about it. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_connector.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c in

[PATCH v2 0/4] DRM: small improvements

2024-11-06 Thread Luca Ceresoli
This series brings small improvements to the DRM documentation, logging and a warning on an incorrect code path. Signed-off-by: Luca Ceresoli --- Changes in v2: - Added patches 3 and 4 - Updated reviewed-by tags - Link to v1: https://lore.kernel.org/r/20241018-drm-small-improvements-v1-0

[PATCH v2 3/4] drm/mode_object: add drm_mode_object_read_refcount()

2024-11-06 Thread Luca Ceresoli
Add a wrapper to kref_read() just like the ones already in place for kref_get() and kref_put(). This will be used for sanity checks on object lifetime. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_mode_object.c | 20 include/drm/drm_mode_object.h | 1 + 2 files

[PATCH 2/2] drm/atomic-helper: improve CRTC enabled/connectors mismatch logging message

2024-10-18 Thread Luca Ceresoli
-by: Luca Ceresoli --- drivers/gpu/drm/drm_atomic_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 43cdf39019a4..3c3bdef9bcf3 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c ++

[PATCH 0/2] DRM: small improvements

2024-10-18 Thread Luca Ceresoli
This series brings two small improvements to the DRM documentation and logging. Signed-off-by: Luca Ceresoli --- Luca Ceresoli (2): drm/drm_mode_object: fix typo in kerneldoc drm/atomic-helper: improve CRTC enabled/connectors mismatch logging message drivers/gpu/drm

[PATCH 1/2] drm/drm_mode_object: fix typo in kerneldoc

2024-10-18 Thread Luca Ceresoli
Remove unintended extra word. Signed-off-by: Luca Ceresoli --- include/drm/drm_mode_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index 08d7a7f0188f..c68edbd126d0 100644 --- a/include/drm

Re: [PATCH v2 0/5] Add support for GE SUNH hot-pluggable connector (was: "drm: add support for hot-pluggable bridges")

2024-09-25 Thread Luca Ceresoli
Hello Simona, [+Cc: Dmitry Baryshkov who took part to the LPC discussion] On Tue, 24 Sep 2024 10:26:37 +0200 Simona Vetter wrote: > On Mon, Sep 09, 2024 at 03:26:04PM +0200, Luca Ceresoli wrote: ... > > There is a fundamental question where your position is not clear to me. > >

Re: [PATCH v4 4/8] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges

2024-09-24 Thread Luca Ceresoli
Hello Simona, Maxime, Dmitry, On Tue, 17 Sep 2024 10:53:08 +0200 Luca Ceresoli wrote: > This driver implements the point of a DRM pipeline where a connector allows > removal of all the following bridges up to the panel. This is a quick feedback of the discussions about hotpluggable DRM b

Re: [PATCH v4 6/8] backlight: led-backlight: add devlink to supplier LEDs

2024-09-20 Thread Luca Ceresoli
Hello Daniel, On Thu, 19 Sep 2024 14:43:23 +0200 Daniel Thompson wrote: > On Tue, Sep 17, 2024 at 10:53:10AM +0200, Luca Ceresoli wrote: > > led-backlight is a consumer of one or multiple LED class devices, but no > > devlink is created for such supplier-producer relationship.

Re: [PATCH v4 1/8] dt-bindings: connector: add GE SUNH hotplug addon connector

2024-09-17 Thread Luca Ceresoli
d ('powergood-gpios' > was unexpected) Ouch, a leftover from v3. Fixed queued for v5. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

[PATCH v4 8/8] misc: add ge-addon-connector driver

2024-09-17 Thread Luca Ceresoli
models can be connected, and each has an EEPROM with a model identifier at a fixed address. The add-on hardware is added and removed using device tree overlay loading and unloading. Co-developed-by: Herve Codina Signed-off-by: Herve Codina Signed-off-by: Luca Ceresoli --- Changed in v4

[PATCH RFC v4 7/8] driver core: devlink: do not unblock consumers without any drivers found

2024-09-17 Thread Luca Ceresoli
llow the same amount of devices to be probed using the same amount of optional suppliers, but leaving the inferred devlinks in place because they might be useful later on. And then of course there are the above solutions I failed to get working, which might be the right way but need some direc

[PATCH v4 6/8] backlight: led-backlight: add devlink to supplier LEDs

2024-09-17 Thread Luca Ceresoli
el NULL pointer dereference at virtual address 0010 ... Call trace: led_put+0xe0/0x140 devm_led_release+0x6c/0x98 Fix by adding a devlink between the consuming led-backlight device and the supplying LED device. Signed-off-by: Luca Ceresoli --- This patch first appeared in

[PATCH v4 5/8] i2c: i2c-core-of: follow i2c-parent phandle to probe devices from added nodes

2024-09-17 Thread Luca Ceresoli
r node. This tells those nodes are I2C clients of the adapter in that other node. Extend the i2c-core-of code to look for the adapter via the 'i2c-parent' phandle when the regular adapter lookup does not find one. This allows all clients to be probed: both those on the base board (

[PATCH v4 4/8] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges

2024-09-17 Thread Luca Ceresoli
a new connector appears: # modetest -c | grep -i '^[a-z0-9]' Connectors: idencoder status namesize (mm) modes encoders 380 disconnectedDSI-1 0x0 0 37 39 0 connected LVDS-1 344x194 1 37 Co-de

[PATCH v4 3/8] drm/encoder: add drm_encoder_cleanup_from()

2024-09-17 Thread Luca Ceresoli
Supporting hardware whose final part of the DRM pipeline can be physically removed requires the ability to detach all bridges from a given point to the end of the pipeline. Introduce a variant of drm_encoder_cleanup() for this. Signed-off-by: Luca Ceresoli --- Changes in v3: none Changed in

[PATCH v4 2/8] drm/bridge: allow bridges to be informed about added and removed bridges

2024-09-17 Thread Luca Ceresoli
In preparation for allowing bridges to be added to and removed from a DRM card without destroying the whole card, add a new DRM bridge function called on addition and removal of bridges. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/drm_bridge.c | 12 include/drm/drm_bridge.h

[PATCH v4 1/8] dt-bindings: connector: add GE SUNH hotplug addon connector

2024-09-17 Thread Luca Ceresoli
Add bindings for the GE SUNH add-on connector. This is a physical, hot-pluggable connector that allows to attach and detach at runtime an add-on adding peripherals on non-discoverable busses. Signed-off-by: Luca Ceresoli --- Changed in v4: - rename 'nobus-devices' to '

[PATCH v4 0/8] Add support for GE SUNH hot-pluggable connector

2024-09-17 Thread Luca Ceresoli
xception still to be solved) - Implemented device instantiation based on the new DT format: i2c in i2c-core-of.c nobus-devices in the connector driver - DRM: insert/remove an LVDS DRM connector on hot(un)plug events - Added patch for a devlink issue on overlay removal (mostly to start discussion)

Re: [PATCH v2 0/5] Add support for GE SUNH hot-pluggable connector (was: "drm: add support for hot-pluggable bridges")

2024-09-09 Thread Luca Ceresoli
18:37:12 +0200 Daniel Vetter wrote: > On Fri, Aug 23, 2024 at 12:39:03PM +0200, Luca Ceresoli wrote: > > Hello Sima, > > > > these days I started looking in more detail into some of the topics you > > had mentioned in your v2 review. I have questions about those I have &g

Re: [PATCH v2 0/5] Add support for GE SUNH hot-pluggable connector (was: "drm: add support for hot-pluggable bridges")

2024-08-23 Thread Luca Ceresoli
Hello Sima, these days I started looking in more detail into some of the topics you had mentioned in your v2 review. I have questions about those I have investigated, see below. On Tue, 21 May 2024 14:01:19 +0200 Daniel Vetter wrote: > On Mon, May 20, 2024 at 02:01:48PM +0200, Luca Ceres

Re: [PATCH] drm/bridge: ti-sn65dsi83: use dev_err_probe when failing to get panel bridge

2024-08-19 Thread Luca Ceresoli
Hello Andi, thanks for your additional comments. On Tue, 13 Aug 2024 16:32:50 +0200 Andi Shyti wrote: > Hi Luca, > > On Tue, Aug 13, 2024 at 10:16:43AM +0200, Luca Ceresoli wrote: > > On Thu, 8 Aug 2024 11:35:23 +0100 > > Andi Shyti wrote: > > > On Thu, Au

Re: [PATCH v3 0/7] Add support for GE SUNH hot-pluggable connector

2024-08-14 Thread Luca Ceresoli
Hello Rob, On Fri, 09 Aug 2024 17:34:48 +0200 Luca Ceresoli wrote: ... > However a few new rough edges emerged that are not yet solved in this > v3. Discussion would help in finding the right direction: > > * Describing the NVMEM cell addition still requires adding two properti

Re: [PATCH v3 1/7] dt-bindings: connector: add GE SUNH hotplug addon connector

2024-08-14 Thread Luca Ceresoli
Hello Rob, On Tue, 13 Aug 2024 09:19:01 -0600 Rob Herring wrote: > On Fri, Aug 09, 2024 at 05:34:49PM +0200, Luca Ceresoli wrote: > > Add bindings for the GE SUNH add-on connector. This is a physical, > > hot-pluggable connector that allows to attach and detach at runtime an &g

Re: [PATCH v3 1/7] dt-bindings: connector: add GE SUNH hotplug addon connector

2024-08-13 Thread Luca Ceresoli
Hello, On Fri, 09 Aug 2024 17:34:49 +0200 Luca Ceresoli wrote: > Add bindings for the GE SUNH add-on connector. This is a physical, > hot-pluggable connector that allows to attach and detach at runtime an > add-on adding peripherals on non-discoverable busses. > > Signed-off-by

Re: [PATCH] drm/bridge: ti-sn65dsi83: use dev_err_probe when failing to get panel bridge

2024-08-13 Thread Luca Ceresoli
Hello Andi, On Thu, 8 Aug 2024 11:35:23 +0100 Andi Shyti wrote: > Hi Luca, > > On Thu, Aug 08, 2024 at 12:26:14PM +0200, Luca Ceresoli wrote: > > When devm_drm_of_get_bridge() fails, the probe fails silently. Use > > dev_err_probe() instead to log an error or repor

[PATCH DO NOT APPLY v3 7/7] driver core: do not unblock consumers any drivers found

2024-08-09 Thread Luca Ceresoli
ame amount of devices to be probed using the same amount of optional suppliers, but leaving the inferred devlinks in place because they might be useful later on. And then of course there are the above solutions I failed to get working, which might be the right way but need some directions for me to

[PATCH v3 6/7] misc: add ge-addon-connector driver

2024-08-09 Thread Luca Ceresoli
models can be connected, and each has an EEPROM with a model identifier at a fixed address. The add-on hardware is added and removed using device tree overlay loading and unloading. Co-developed-by: Herve Codina Signed-off-by: Herve Codina Signed-off-by: Luca Ceresoli --- Changed in v3

[PATCH v3 5/7] i2c: i2c-core-of: follow i2c-parent phandle to probe devices from added nodes

2024-08-09 Thread Luca Ceresoli
r node. This tells those nodes are I2C clients of the adapter in that other node. Extend the i2c-core-of code to look for the adapter via the 'i2c-parent' phandle when the regular adapter lookup does not find one. This allows all clients to be probed: both those on the base board (

[PATCH v3 1/7] dt-bindings: connector: add GE SUNH hotplug addon connector

2024-08-09 Thread Luca Ceresoli
Add bindings for the GE SUNH add-on connector. This is a physical, hot-pluggable connector that allows to attach and detach at runtime an add-on adding peripherals on non-discoverable busses. Signed-off-by: Luca Ceresoli --- Changed in v3: - change the layout to only add subnodes, not

[PATCH v3 4/7] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges

2024-08-09 Thread Luca Ceresoli
nded * the automatic mechanism to call the appropriate .get_modes operation (typically provided by the panel bridge) cannot work as the panel can disappear and reappear as a different model, so an ad-hoc lookup is needed The code handling these and other tricky aspects is accurately doc

[PATCH v3 0/7] Add support for GE SUNH hot-pluggable connector

2024-08-09 Thread Luca Ceresoli
verlays and to avoid adding properties (with the NVMEM exception still to be solved) - Implemented device instantiation based on the new DT format: i2c in i2c-core-of.c nobus-devices in the connector driver - DRM: insert/remove an LVDS DRM connector on hot(un)plug events - Added patch for a devlink i

[PATCH v3 3/7] drm/encoder: add drm_encoder_cleanup_from()

2024-08-09 Thread Luca Ceresoli
Supporting hardware whose final part of the DRM pipeline can be physically removed requires the ability to detach all bridges from a given point to the end of the pipeline. Introduce a variant of drm_encoder_cleanup() for this. Signed-off-by: Luca Ceresoli --- Changes in v3: none Changed in

[PATCH v3 2/7] drm/bridge: add bridge notifier to be notified of bridge addition and removal

2024-08-09 Thread Luca Ceresoli
From: Paul Kocialkowski In preparation for allowing bridges to be added to and removed from a DRM card without destroying the whole card, add a DRM bridge notifier. Notified events are addition and removal to/from the global bridge list. Co-developed-by: Luca Ceresoli Signed-off-by: Luca

[PATCH] drm/bridge: ti-sn65dsi83: use dev_err_probe when failing to get panel bridge

2024-08-08 Thread Luca Ceresoli
When devm_drm_of_get_bridge() fails, the probe fails silently. Use dev_err_probe() instead to log an error or report the deferral reason, whichever is applicable. Signed-off-by: Luca Ceresoli --- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3] of: remove internal arguments from of_property_for_each_u32()

2024-07-24 Thread Luca Ceresoli
/soc/codecs/arizona.c Acked-by: Michael Ellerman # arch/powerpc/sysdev/xive/spapr.c Acked-by: Stephen Boyd # clk Signed-off-by: Luca Ceresoli --- [Note: to reduce the noise I have trimmed the get_maintainers list manually. Should you want to be removed, or someone else added, to future version

Re: [PATCH v2] of: remove internal arguments from of_property_for_each_u32()

2024-07-18 Thread Luca Ceresoli
operty is OK */ > > + if (sz < 0) > > + return dev_err_probe(&client->dev, sz, "invalid > > pll-source"); > > Needs a newline on the printk message. Ouch! Fix queued for v3. Thanks, Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com

[PATCH v2] of: remove internal arguments from of_property_for_each_u32()

2024-07-17 Thread Luca Ceresoli
ave been build tested. The few for which I have the hardware have been runtime-tested too. Signed-off-by: Luca Ceresoli Reviewed-by: Andre Przywara # drivers/clk/sunxi/clk-simple-gates.c, drivers/clk/sunxi/clk-sun8i-bus-gates.c Acked-by: Bartosz Golaszewski # drivers/gpio/gpio-brcmstb.c Acked

Re: [PATCH 20/20] of: deprecate and rename of_property_for_each_u32()

2024-07-04 Thread Luca Ceresoli
Hello Rob, On Wed, 3 Jul 2024 12:01:11 -0600 Rob Herring wrote: > On Wed, Jul 03, 2024 at 12:37:04PM +0200, Luca Ceresoli wrote: > > of_property_for_each_u32() is meant to disappear. All the call sites not > > using the 3rd and 4th arguments have already b

Re: [PATCH 00/20] Simplify of_property_for_each_u32()

2024-07-04 Thread Luca Ceresoli
Hello Rob, On Wed, 3 Jul 2024 12:07:42 -0600 Rob Herring wrote: > On Wed, Jul 03, 2024 at 12:36:44PM +0200, Luca Ceresoli wrote: > > [Note: to reduce the noise I have trimmed the get_maintainers list > > manually. Should you want to be removed, or someone else added, to futu

[PATCH 15/20] usb: usb251xb: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/usb/misc/usb251xb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/misc/usb251xb.c b

[PATCH 13/20] pwm: samsung: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/pwm/pwm-samsung.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-samsung.c b

[PATCH 14/20] tty: sysrq: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/tty/sysrq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/tty/sysrq.c b/drivers/tty

[PATCH 12/20] iio: adc: ti_am335x_adc: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/iio/adc/ti_am335x_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc

[PATCH 11/20] irqchip/atmel-aic: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/irqchip/irq-atmel-aic-common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/irqchip/irq

[PATCH 10/20] pinctrl: s32cc: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/pinctrl/nxp/pinctrl-s32cc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/nxp

[PATCH 09/20] gpio: brcmstb: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/gpio/gpio-brcmstb.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-brcmstb.c b

[PATCH 08/20] lk: clk-conf: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/clk/clk-conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/clk/clk-conf.c b/drivers

[PATCH 07/20] bus: ti-sysc: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/bus/ti-sysc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus

[PATCH 06/20] clocksource/drivers/samsung_pwm: convert to of_property_for_each_u32_new()

2024-07-03 Thread Luca Ceresoli
Simplify code using of_property_for_each_u32_new() as the two additional parameters in of_property_for_each_u32() are not used here. Signed-off-by: Luca Ceresoli --- drivers/clocksource/samsung_pwm_timer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers

  1   2   3   4   5   6   7   8   9   10   >