All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x
@ 2015-04-01  8:49 Jyri Sarha
  2015-04-01  8:49 ` [PATCH v4 1/7] drm/tilcdc: Fix module unloading Jyri Sarha
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, airlied-cv59FeDIM0c,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	bcousson-rdvid1DuHRBWk0Htik3J/w, tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: tomi.valkeinen-l0cyMroinI0, rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w, moinejf-GANU6spQydw,
	Jyri Sarha

Ok, let's do one more full review round. The mode filtering issue was
the main reason for this new patch series version. However, I found
couple other things to fix too after scrutinizing the patches once
more.

Changes since v3 version of the patch-set:
* drm/tilcdc: Add support for external tda998x encoder
 - Hijack external connectors helper functions
 - Remove select of nonexistent DRM_TILCDC_INIT in tilcdc Kconfig
 - Correct author mail address to tilcdc_exteral.h
* drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding
 - Add a header file for tilcdc_slave_compat.dtb symbol declarations

Changes since v2 version of the patch-set:
- use obj-y in Makefle for tilcdc subdir in:
  "drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT"
- move to last:
  "drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint"

Changes since first version of the patch-set:
- Rename DRM_TILCDC_INIT to DRM_TILCDC_SLAVE_COMPAT and make it visible
- Add separate: 
  drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint
- Reduce info-level spam
- Use component_master_add_with_match()
- Be more explicit about tda998x being the only supported external encoder

Remove tilcdc slave support and connect to tda998x trough its
component DRM API. For dtb backward compatibility the code creates at
boot time a DT overlay based on the earlier binding. The overlay
conforms to the new graph based binding.

The "drm/tilcdc: Decrement refcount of ep-node from
of_graph_get_next_endpoint" should probably not be merged. The "of:
Decrement refcount of previous endpoint in of_graph_get_next_endpoint"
is eventually going to be merged and before that leaking of two
of-node refcount increments each time the module is loaded is not that
serious. The of-nodes live forever anyway.

The merge of the dts patch can be delayed until the next merger
window, when the other patches are already in. The
DRM_TILCDC_SLAVE_COMPAT should keep the bbb HDMI operational until
then.

The first patch is just a bugfix and can be applied or dropped
independently.

Jyri Sarha (7):
  drm/tilcdc: Fix module unloading
  drm/tilcdc: Remove tilcdc slave support for tda998x driver
  drm/tilcdc: Add support for external tda998x encoder
  drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding
    support
  drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT
  ARM: dts: am335x-boneblack: Use new binding for HDMI
  drm/tilcdc: Decrement refcount of ep-node from
    of_graph_get_next_endpoint

 .../devicetree/bindings/drm/tilcdc/slave.txt       |  18 -
 .../devicetree/bindings/drm/tilcdc/tilcdc.txt      |  27 ++
 arch/arm/boot/dts/am335x-boneblack.dts             |  20 +-
 drivers/gpu/drm/Makefile                           |   2 +-
 drivers/gpu/drm/tilcdc/Kconfig                     |  12 +
 drivers/gpu/drm/tilcdc/Makefile                    |   5 +-
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c               |  36 +-
 drivers/gpu/drm/tilcdc/tilcdc_drv.c                |  94 +++--
 drivers/gpu/drm/tilcdc/tilcdc_drv.h                |   6 +-
 drivers/gpu/drm/tilcdc/tilcdc_external.c           | 159 ++++++++
 drivers/gpu/drm/tilcdc/tilcdc_external.h           |  25 ++
 drivers/gpu/drm/tilcdc/tilcdc_slave.c              | 411 ---------------------
 drivers/gpu/drm/tilcdc/tilcdc_slave.h              |  26 --
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c       | 270 ++++++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.dts     |  72 ++++
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.h       |  25 ++
 16 files changed, 718 insertions(+), 490 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/drm/tilcdc/slave.txt
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_external.c
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_external.h
 delete mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave.c
 delete mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave.h
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.dts
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.h

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v4 1/7] drm/tilcdc: Fix module unloading
  2015-04-01  8:49 [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Jyri Sarha
@ 2015-04-01  8:49 ` Jyri Sarha
  2015-04-01  8:49 ` [PATCH v4 3/7] drm/tilcdc: Add support for external tda998x encoder Jyri Sarha
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel, airlied, linux-omap, devicetree, bcousson, tony
  Cc: tomi.valkeinen, rmk+kernel, robdclark, moinejf, Jyri Sarha

Force crtc dpms off before destroying the crtc instead of just
checking the dpms state. This fixes warning message and frozen picture
after tilcdc module unloading.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index c735884..c2d5980 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -135,11 +135,12 @@ static void stop(struct drm_crtc *crtc)
 	tilcdc_clear(dev, LCDC_RASTER_CTRL_REG, LCDC_RASTER_ENABLE);
 }
 
+static void tilcdc_crtc_dpms(struct drm_crtc *crtc, int mode);
 static void tilcdc_crtc_destroy(struct drm_crtc *crtc)
 {
 	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
 
-	WARN_ON(tilcdc_crtc->dpms == DRM_MODE_DPMS_ON);
+	tilcdc_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
 
 	drm_crtc_cleanup(crtc);
 	drm_flip_work_cleanup(&tilcdc_crtc->unref_work);
-- 
1.9.1


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

* [PATCH v4 2/7] drm/tilcdc: Remove tilcdc slave support for tda998x driver
       [not found] ` <cover.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
@ 2015-04-01  8:49   ` Jyri Sarha
  2015-04-01  8:49   ` [PATCH v4 4/7] drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support Jyri Sarha
  2015-04-01  8:49   ` [PATCH v4 7/7] drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint Jyri Sarha
  2 siblings, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, airlied-cv59FeDIM0c,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	bcousson-rdvid1DuHRBWk0Htik3J/w, tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: tomi.valkeinen-l0cyMroinI0, rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w, moinejf-GANU6spQydw,
	Jyri Sarha

Remove tilcdc slave support for tda998x driver. The tilcdc slave
support would conflicts with componentized use of tda998x.

Signed-off-by: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
---
 .../devicetree/bindings/drm/tilcdc/slave.txt       |  18 -
 drivers/gpu/drm/tilcdc/Makefile                    |   1 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.c                |  13 -
 drivers/gpu/drm/tilcdc/tilcdc_drv.h                |   1 -
 drivers/gpu/drm/tilcdc/tilcdc_slave.c              | 411 ---------------------
 drivers/gpu/drm/tilcdc/tilcdc_slave.h              |  26 --
 6 files changed, 470 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/drm/tilcdc/slave.txt
 delete mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave.c
 delete mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave.h

diff --git a/Documentation/devicetree/bindings/drm/tilcdc/slave.txt b/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
deleted file mode 100644
index 3d2c524..0000000
--- a/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-Device-Tree bindings for tilcdc DRM encoder slave output driver
-
-Required properties:
- - compatible: value should be "ti,tilcdc,slave".
- - i2c: the phandle for the i2c device the encoder slave is connected to
-
-Recommended properties:
- - pinctrl-names, pinctrl-0: the pincontrol settings to configure
-   muxing properly for pins that connect to TFP410 device
-
-Example:
-
-	hdmi {
-		compatible = "ti,tilcdc,slave";
-		i2c = <&i2c0>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
-	};
diff --git a/drivers/gpu/drm/tilcdc/Makefile b/drivers/gpu/drm/tilcdc/Makefile
index 7d2eefe..44485f9 100644
--- a/drivers/gpu/drm/tilcdc/Makefile
+++ b/drivers/gpu/drm/tilcdc/Makefile
@@ -6,7 +6,6 @@ endif
 tilcdc-y := \
 	tilcdc_crtc.o \
 	tilcdc_tfp410.o \
-	tilcdc_slave.o \
 	tilcdc_panel.o \
 	tilcdc_drv.o
 
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 095fca9..0f1e099 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -20,13 +20,11 @@
 #include "tilcdc_drv.h"
 #include "tilcdc_regs.h"
 #include "tilcdc_tfp410.h"
-#include "tilcdc_slave.h"
 #include "tilcdc_panel.h"
 
 #include "drm_fb_helper.h"
 
 static LIST_HEAD(module_list);
-static bool slave_probing;
 
 void tilcdc_module_init(struct tilcdc_module *mod, const char *name,
 		const struct tilcdc_module_ops *funcs)
@@ -42,11 +40,6 @@ void tilcdc_module_cleanup(struct tilcdc_module *mod)
 	list_del(&mod->list);
 }
 
-void tilcdc_slave_probedefer(bool defered)
-{
-	slave_probing = defered;
-}
-
 static struct of_device_id tilcdc_of_match[];
 
 static struct drm_framebuffer *tilcdc_fb_create(struct drm_device *dev,
@@ -620,10 +613,6 @@ static int tilcdc_pdev_probe(struct platform_device *pdev)
 		return -ENXIO;
 	}
 
-	/* defer probing if slave is in deferred probing */
-	if (slave_probing == true)
-		return -EPROBE_DEFER;
-
 	return drm_platform_init(&tilcdc_driver, pdev);
 }
 
@@ -654,7 +643,6 @@ static int __init tilcdc_drm_init(void)
 {
 	DBG("init");
 	tilcdc_tfp410_init();
-	tilcdc_slave_init();
 	tilcdc_panel_init();
 	return platform_driver_register(&tilcdc_platform_driver);
 }
@@ -664,7 +652,6 @@ static void __exit tilcdc_drm_fini(void)
 	DBG("fini");
 	platform_driver_unregister(&tilcdc_platform_driver);
 	tilcdc_panel_fini();
-	tilcdc_slave_fini();
 	tilcdc_tfp410_fini();
 }
 
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index 7596c14..6336512 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -116,7 +116,6 @@ struct tilcdc_module {
 void tilcdc_module_init(struct tilcdc_module *mod, const char *name,
 		const struct tilcdc_module_ops *funcs);
 void tilcdc_module_cleanup(struct tilcdc_module *mod);
-void tilcdc_slave_probedefer(bool defered);
 
 /* Panel config that needs to be set in the crtc, but is not coming from
  * the mode timings.  The display module is expected to call
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave.c b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
deleted file mode 100644
index 3775fd4..0000000
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave.c
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments
- * Author: Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <linux/i2c.h>
-#include <linux/pinctrl/pinmux.h>
-#include <linux/pinctrl/consumer.h>
-#include <drm/drm_encoder_slave.h>
-
-#include "tilcdc_drv.h"
-
-struct slave_module {
-	struct tilcdc_module base;
-	struct i2c_adapter *i2c;
-};
-#define to_slave_module(x) container_of(x, struct slave_module, base)
-
-static const struct tilcdc_panel_info slave_info = {
-		.bpp                    = 16,
-		.ac_bias                = 255,
-		.ac_bias_intrpt         = 0,
-		.dma_burst_sz           = 16,
-		.fdd                    = 0x80,
-		.tft_alt_mode           = 0,
-		.sync_edge              = 0,
-		.sync_ctrl              = 1,
-		.raster_order           = 0,
-};
-
-
-/*
- * Encoder:
- */
-
-struct slave_encoder {
-	struct drm_encoder_slave base;
-	struct slave_module *mod;
-};
-#define to_slave_encoder(x) container_of(to_encoder_slave(x), struct slave_encoder, base)
-
-static inline struct drm_encoder_slave_funcs *
-get_slave_funcs(struct drm_encoder *enc)
-{
-	return to_encoder_slave(enc)->slave_funcs;
-}
-
-static void slave_encoder_destroy(struct drm_encoder *encoder)
-{
-	struct slave_encoder *slave_encoder = to_slave_encoder(encoder);
-	if (get_slave_funcs(encoder))
-		get_slave_funcs(encoder)->destroy(encoder);
-	drm_encoder_cleanup(encoder);
-	kfree(slave_encoder);
-}
-
-static void slave_encoder_prepare(struct drm_encoder *encoder)
-{
-	drm_i2c_encoder_prepare(encoder);
-	tilcdc_crtc_set_panel_info(encoder->crtc, &slave_info);
-}
-
-static bool slave_encoder_fixup(struct drm_encoder *encoder,
-		const struct drm_display_mode *mode,
-		struct drm_display_mode *adjusted_mode)
-{
-	/*
-	 * tilcdc does not generate VESA-complient sync but aligns
-	 * VS on the second edge of HS instead of first edge.
-	 * We use adjusted_mode, to fixup sync by aligning both rising
-	 * edges and add HSKEW offset to let the slave encoder fix it up.
-	 */
-	adjusted_mode->hskew = mode->hsync_end - mode->hsync_start;
-	adjusted_mode->flags |= DRM_MODE_FLAG_HSKEW;
-
-	if (mode->flags & DRM_MODE_FLAG_NHSYNC) {
-		adjusted_mode->flags |= DRM_MODE_FLAG_PHSYNC;
-		adjusted_mode->flags &= ~DRM_MODE_FLAG_NHSYNC;
-	} else {
-		adjusted_mode->flags |= DRM_MODE_FLAG_NHSYNC;
-		adjusted_mode->flags &= ~DRM_MODE_FLAG_PHSYNC;
-	}
-
-	return drm_i2c_encoder_mode_fixup(encoder, mode, adjusted_mode);
-}
-
-
-static const struct drm_encoder_funcs slave_encoder_funcs = {
-		.destroy        = slave_encoder_destroy,
-};
-
-static const struct drm_encoder_helper_funcs slave_encoder_helper_funcs = {
-		.dpms           = drm_i2c_encoder_dpms,
-		.mode_fixup     = slave_encoder_fixup,
-		.prepare        = slave_encoder_prepare,
-		.commit         = drm_i2c_encoder_commit,
-		.mode_set       = drm_i2c_encoder_mode_set,
-		.save           = drm_i2c_encoder_save,
-		.restore        = drm_i2c_encoder_restore,
-};
-
-static const struct i2c_board_info info = {
-		I2C_BOARD_INFO("tda998x", 0x70)
-};
-
-static struct drm_encoder *slave_encoder_create(struct drm_device *dev,
-		struct slave_module *mod)
-{
-	struct slave_encoder *slave_encoder;
-	struct drm_encoder *encoder;
-	int ret;
-
-	slave_encoder = kzalloc(sizeof(*slave_encoder), GFP_KERNEL);
-	if (!slave_encoder) {
-		dev_err(dev->dev, "allocation failed\n");
-		return NULL;
-	}
-
-	slave_encoder->mod = mod;
-
-	encoder = &slave_encoder->base.base;
-	encoder->possible_crtcs = 1;
-
-	ret = drm_encoder_init(dev, encoder, &slave_encoder_funcs,
-			DRM_MODE_ENCODER_TMDS);
-	if (ret)
-		goto fail;
-
-	drm_encoder_helper_add(encoder, &slave_encoder_helper_funcs);
-
-	ret = drm_i2c_encoder_init(dev, to_encoder_slave(encoder), mod->i2c, &info);
-	if (ret)
-		goto fail;
-
-	return encoder;
-
-fail:
-	slave_encoder_destroy(encoder);
-	return NULL;
-}
-
-/*
- * Connector:
- */
-
-struct slave_connector {
-	struct drm_connector base;
-
-	struct drm_encoder *encoder;  /* our connected encoder */
-	struct slave_module *mod;
-};
-#define to_slave_connector(x) container_of(x, struct slave_connector, base)
-
-static void slave_connector_destroy(struct drm_connector *connector)
-{
-	struct slave_connector *slave_connector = to_slave_connector(connector);
-	drm_connector_unregister(connector);
-	drm_connector_cleanup(connector);
-	kfree(slave_connector);
-}
-
-static enum drm_connector_status slave_connector_detect(
-		struct drm_connector *connector,
-		bool force)
-{
-	struct drm_encoder *encoder = to_slave_connector(connector)->encoder;
-	return get_slave_funcs(encoder)->detect(encoder, connector);
-}
-
-static int slave_connector_get_modes(struct drm_connector *connector)
-{
-	struct drm_encoder *encoder = to_slave_connector(connector)->encoder;
-	return get_slave_funcs(encoder)->get_modes(encoder, connector);
-}
-
-static int slave_connector_mode_valid(struct drm_connector *connector,
-		  struct drm_display_mode *mode)
-{
-	struct drm_encoder *encoder = to_slave_connector(connector)->encoder;
-	struct tilcdc_drm_private *priv = connector->dev->dev_private;
-	int ret;
-
-	ret = tilcdc_crtc_mode_valid(priv->crtc, mode);
-	if (ret != MODE_OK)
-		return ret;
-
-	return get_slave_funcs(encoder)->mode_valid(encoder, mode);
-}
-
-static struct drm_encoder *slave_connector_best_encoder(
-		struct drm_connector *connector)
-{
-	struct slave_connector *slave_connector = to_slave_connector(connector);
-	return slave_connector->encoder;
-}
-
-static int slave_connector_set_property(struct drm_connector *connector,
-		struct drm_property *property, uint64_t value)
-{
-	struct drm_encoder *encoder = to_slave_connector(connector)->encoder;
-	return get_slave_funcs(encoder)->set_property(encoder,
-			connector, property, value);
-}
-
-static const struct drm_connector_funcs slave_connector_funcs = {
-	.destroy            = slave_connector_destroy,
-	.dpms               = drm_helper_connector_dpms,
-	.detect             = slave_connector_detect,
-	.fill_modes         = drm_helper_probe_single_connector_modes,
-	.set_property       = slave_connector_set_property,
-};
-
-static const struct drm_connector_helper_funcs slave_connector_helper_funcs = {
-	.get_modes          = slave_connector_get_modes,
-	.mode_valid         = slave_connector_mode_valid,
-	.best_encoder       = slave_connector_best_encoder,
-};
-
-static struct drm_connector *slave_connector_create(struct drm_device *dev,
-		struct slave_module *mod, struct drm_encoder *encoder)
-{
-	struct slave_connector *slave_connector;
-	struct drm_connector *connector;
-	int ret;
-
-	slave_connector = kzalloc(sizeof(*slave_connector), GFP_KERNEL);
-	if (!slave_connector) {
-		dev_err(dev->dev, "allocation failed\n");
-		return NULL;
-	}
-
-	slave_connector->encoder = encoder;
-	slave_connector->mod = mod;
-
-	connector = &slave_connector->base;
-
-	drm_connector_init(dev, connector, &slave_connector_funcs,
-			DRM_MODE_CONNECTOR_HDMIA);
-	drm_connector_helper_add(connector, &slave_connector_helper_funcs);
-
-	connector->polled = DRM_CONNECTOR_POLL_CONNECT |
-			DRM_CONNECTOR_POLL_DISCONNECT;
-
-	connector->interlace_allowed = 0;
-	connector->doublescan_allowed = 0;
-
-	get_slave_funcs(encoder)->create_resources(encoder, connector);
-
-	ret = drm_mode_connector_attach_encoder(connector, encoder);
-	if (ret)
-		goto fail;
-
-	drm_connector_register(connector);
-
-	return connector;
-
-fail:
-	slave_connector_destroy(connector);
-	return NULL;
-}
-
-/*
- * Module:
- */
-
-static int slave_modeset_init(struct tilcdc_module *mod, struct drm_device *dev)
-{
-	struct slave_module *slave_mod = to_slave_module(mod);
-	struct tilcdc_drm_private *priv = dev->dev_private;
-	struct drm_encoder *encoder;
-	struct drm_connector *connector;
-
-	encoder = slave_encoder_create(dev, slave_mod);
-	if (!encoder)
-		return -ENOMEM;
-
-	connector = slave_connector_create(dev, slave_mod, encoder);
-	if (!connector)
-		return -ENOMEM;
-
-	priv->encoders[priv->num_encoders++] = encoder;
-	priv->connectors[priv->num_connectors++] = connector;
-
-	return 0;
-}
-
-static const struct tilcdc_module_ops slave_module_ops = {
-		.modeset_init = slave_modeset_init,
-};
-
-/*
- * Device:
- */
-
-static struct of_device_id slave_of_match[];
-
-static int slave_probe(struct platform_device *pdev)
-{
-	struct device_node *node = pdev->dev.of_node;
-	struct device_node *i2c_node;
-	struct slave_module *slave_mod;
-	struct tilcdc_module *mod;
-	struct pinctrl *pinctrl;
-	uint32_t i2c_phandle;
-	struct i2c_adapter *slavei2c;
-	int ret = -EINVAL;
-
-	/* bail out early if no DT data: */
-	if (!node) {
-		dev_err(&pdev->dev, "device-tree data is missing\n");
-		return -ENXIO;
-	}
-
-	/* Bail out early if i2c not specified */
-	if (of_property_read_u32(node, "i2c", &i2c_phandle)) {
-		dev_err(&pdev->dev, "could not get i2c bus phandle\n");
-		return ret;
-	}
-
-	i2c_node = of_find_node_by_phandle(i2c_phandle);
-	if (!i2c_node) {
-		dev_err(&pdev->dev, "could not get i2c bus node\n");
-		return ret;
-	}
-
-	/* but defer the probe if it can't be initialized it might come later */
-	slavei2c = of_find_i2c_adapter_by_node(i2c_node);
-	of_node_put(i2c_node);
-
-	if (!slavei2c) {
-		ret = -EPROBE_DEFER;
-		tilcdc_slave_probedefer(true);
-		dev_err(&pdev->dev, "could not get i2c\n");
-		return ret;
-	}
-
-	slave_mod = kzalloc(sizeof(*slave_mod), GFP_KERNEL);
-	if (!slave_mod) {
-		ret = -ENOMEM;
-		goto fail_adapter;
-	}
-
-	mod = &slave_mod->base;
-	pdev->dev.platform_data = mod;
-
-	mod->preferred_bpp = slave_info.bpp;
-
-	slave_mod->i2c = slavei2c;
-
-	tilcdc_module_init(mod, "slave", &slave_module_ops);
-
-	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
-	if (IS_ERR(pinctrl))
-		dev_warn(&pdev->dev, "pins are not configured\n");
-
-	tilcdc_slave_probedefer(false);
-
-	return 0;
-
-fail_adapter:
-	i2c_put_adapter(slavei2c);
-	return ret;
-}
-
-static int slave_remove(struct platform_device *pdev)
-{
-	struct tilcdc_module *mod = dev_get_platdata(&pdev->dev);
-	struct slave_module *slave_mod = to_slave_module(mod);
-
-	tilcdc_module_cleanup(mod);
-	kfree(slave_mod);
-
-	return 0;
-}
-
-static struct of_device_id slave_of_match[] = {
-		{ .compatible = "ti,tilcdc,slave", },
-		{ },
-};
-
-struct platform_driver slave_driver = {
-	.probe = slave_probe,
-	.remove = slave_remove,
-	.driver = {
-		.owner = THIS_MODULE,
-		.name = "slave",
-		.of_match_table = slave_of_match,
-	},
-};
-
-int __init tilcdc_slave_init(void)
-{
-	return platform_driver_register(&slave_driver);
-}
-
-void __exit tilcdc_slave_fini(void)
-{
-	platform_driver_unregister(&slave_driver);
-}
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave.h b/drivers/gpu/drm/tilcdc/tilcdc_slave.h
deleted file mode 100644
index 2f85048..0000000
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments
- * Author: Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __TILCDC_SLAVE_H__
-#define __TILCDC_SLAVE_H__
-
-/* sub-module for i2c slave encoder output */
-
-int tilcdc_slave_init(void);
-void tilcdc_slave_fini(void);
-
-#endif /* __TILCDC_SLAVE_H__ */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v4 3/7] drm/tilcdc: Add support for external tda998x encoder
  2015-04-01  8:49 [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Jyri Sarha
  2015-04-01  8:49 ` [PATCH v4 1/7] drm/tilcdc: Fix module unloading Jyri Sarha
@ 2015-04-01  8:49 ` Jyri Sarha
       [not found]   ` <e22d703d6ee5fe02e8c34b78a63f98a4b2ea1f22.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
  2015-04-01  8:49 ` [PATCH v4 5/7] drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT Jyri Sarha
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel, airlied, linux-omap, devicetree, bcousson, tony
  Cc: tomi.valkeinen, rmk+kernel, robdclark, moinejf, Jyri Sarha

Add support for an external compontised DRM encoder. The external
encoder can be connected to tilcdc trough device tree graph binding.
The binding document for tilcdc has been updated. The current
implementation supports only tda998x encoder.

To be able to filter out the unsupported video modes the tilcdc driver
needs to hijack the external connectors helper functions. The tilcdc
installes new helper functions that are otherwise identical to
orignals, but the mode_valid() call-back check the mode first localy,
before calling the original call-back. The tilcdc dirver restores the
original helper functions before it is unbound from the external
device.

I got the idea and some lines of code from Jean-Francois Moine's
"drm/tilcdc: Change the interface with the tda998x driver"-patch.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 .../devicetree/bindings/drm/tilcdc/tilcdc.txt      |  27 ++++
 drivers/gpu/drm/tilcdc/Makefile                    |   1 +
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c               |  33 +++++
 drivers/gpu/drm/tilcdc/tilcdc_drv.c                |  81 +++++++++--
 drivers/gpu/drm/tilcdc/tilcdc_drv.h                |   5 +
 drivers/gpu/drm/tilcdc/tilcdc_external.c           | 158 +++++++++++++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_external.h           |  25 ++++
 7 files changed, 317 insertions(+), 13 deletions(-)
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_external.c
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_external.h

diff --git a/Documentation/devicetree/bindings/drm/tilcdc/tilcdc.txt b/Documentation/devicetree/bindings/drm/tilcdc/tilcdc.txt
index fff10da..2136ee8 100644
--- a/Documentation/devicetree/bindings/drm/tilcdc/tilcdc.txt
+++ b/Documentation/devicetree/bindings/drm/tilcdc/tilcdc.txt
@@ -18,6 +18,12 @@ Optional properties:
  - max-pixelclock: The maximum pixel clock that can be supported
    by the lcd controller in KHz.
 
+Optional nodes:
+
+ - port/ports: to describe a connection to an external encoder. The
+   binding follows Documentation/devicetree/bindings/graph.txt and
+   suppors a single port with a single endpoint.
+
 Example:
 
 	fb: fb@4830e000 {
@@ -26,4 +32,25 @@ Example:
 		interrupt-parent = <&intc>;
 		interrupts = <36>;
 		ti,hwmods = "lcdc";
+
+		port {
+			lcdc_0: endpoint@0 {
+				remote-endpoint = <&hdmi_0>;
+			};
+		};
+	};
+
+	tda19988: tda19988 {
+		compatible = "nxp,tda998x";
+		reg = <0x70>;
+
+		pinctrl-names = "default", "off";
+		pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
+		pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
+
+		port {
+			hdmi_0: endpoint@0 {
+				remote-endpoint = <&lcdc_0>;
+			};
+		};
 	};
diff --git a/drivers/gpu/drm/tilcdc/Makefile b/drivers/gpu/drm/tilcdc/Makefile
index 44485f9..e1f738b 100644
--- a/drivers/gpu/drm/tilcdc/Makefile
+++ b/drivers/gpu/drm/tilcdc/Makefile
@@ -7,6 +7,7 @@ tilcdc-y := \
 	tilcdc_crtc.o \
 	tilcdc_tfp410.o \
 	tilcdc_panel.o \
+	tilcdc_external.o \
 	tilcdc_drv.o
 
 obj-$(CONFIG_DRM_TILCDC)	+= tilcdc.o
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index c2d5980..7d07733 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -37,6 +37,9 @@ struct tilcdc_crtc {
 
 	/* for deferred fb unref's: */
 	struct drm_flip_work unref_work;
+
+	/* Only set if an external encoder is connected */
+	bool simulate_vesa_sync;
 };
 #define to_tilcdc_crtc(x) container_of(x, struct tilcdc_crtc, base)
 
@@ -214,6 +217,28 @@ static bool tilcdc_crtc_mode_fixup(struct drm_crtc *crtc,
 		const struct drm_display_mode *mode,
 		struct drm_display_mode *adjusted_mode)
 {
+	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
+
+	if (!tilcdc_crtc->simulate_vesa_sync)
+		return true;
+
+	/*
+	 * tilcdc does not generate VESA-compliant sync but aligns
+	 * VS on the second edge of HS instead of first edge.
+	 * We use adjusted_mode, to fixup sync by aligning both rising
+	 * edges and add HSKEW offset to fix the sync.
+	 */
+	adjusted_mode->hskew = mode->hsync_end - mode->hsync_start;
+	adjusted_mode->flags |= DRM_MODE_FLAG_HSKEW;
+
+	if (mode->flags & DRM_MODE_FLAG_NHSYNC) {
+		adjusted_mode->flags |= DRM_MODE_FLAG_PHSYNC;
+		adjusted_mode->flags &= ~DRM_MODE_FLAG_NHSYNC;
+	} else {
+		adjusted_mode->flags |= DRM_MODE_FLAG_NHSYNC;
+		adjusted_mode->flags &= ~DRM_MODE_FLAG_PHSYNC;
+	}
+
 	return true;
 }
 
@@ -534,6 +559,14 @@ void tilcdc_crtc_set_panel_info(struct drm_crtc *crtc,
 	tilcdc_crtc->info = info;
 }
 
+void tilcdc_crtc_set_simulate_vesa_sync(struct drm_crtc *crtc,
+					bool simulate_vesa_sync)
+{
+	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
+
+	tilcdc_crtc->simulate_vesa_sync = simulate_vesa_sync;
+}
+
 void tilcdc_crtc_update_clk(struct drm_crtc *crtc)
 {
 	struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 0f1e099..1876945 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -17,10 +17,13 @@
 
 /* LCDC DRM driver, based on da8xx-fb */
 
+#include <linux/component.h>
+
 #include "tilcdc_drv.h"
 #include "tilcdc_regs.h"
 #include "tilcdc_tfp410.h"
 #include "tilcdc_panel.h"
+#include "tilcdc_external.h"
 
 #include "drm_fb_helper.h"
 
@@ -73,13 +76,6 @@ static int modeset_init(struct drm_device *dev)
 		mod->funcs->modeset_init(mod, dev);
 	}
 
-	if ((priv->num_encoders == 0) || (priv->num_connectors == 0)) {
-		/* oh nos! */
-		dev_err(dev->dev, "no encoders/connectors found\n");
-		drm_mode_config_cleanup(dev);
-		return -ENXIO;
-	}
-
 	dev->mode_config.min_width = 0;
 	dev->mode_config.min_height = 0;
 	dev->mode_config.max_width = tilcdc_crtc_max_width(priv->crtc);
@@ -114,6 +110,8 @@ static int tilcdc_unload(struct drm_device *dev)
 {
 	struct tilcdc_drm_private *priv = dev->dev_private;
 
+	tilcdc_remove_external_encoders(dev);
+
 	drm_fbdev_cma_fini(priv->fbdev);
 	drm_kms_helper_poll_fini(dev);
 	drm_mode_config_cleanup(dev);
@@ -164,6 +162,9 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
 
 	dev->dev_private = priv;
 
+	priv->is_componentized =
+		tilcdc_get_external_components(dev->dev, NULL) > 0;
+
 	priv->wq = alloc_ordered_workqueue("tilcdc", 0);
 	if (!priv->wq) {
 		ret = -ENOMEM;
@@ -253,10 +254,28 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
 		goto fail_cpufreq_unregister;
 	}
 
+	platform_set_drvdata(pdev, dev);
+
+	if (priv->is_componentized) {
+		ret = component_bind_all(dev->dev, dev);
+		if (ret < 0)
+			goto fail_mode_config_cleanup;
+
+		ret = tilcdc_add_external_encoders(dev, &bpp);
+		if (ret < 0)
+			goto fail_component_cleanup;
+	}
+
+	if ((priv->num_encoders == 0) || (priv->num_connectors == 0)) {
+		dev_err(dev->dev, "no encoders/connectors found\n");
+		ret = -ENXIO;
+		goto fail_external_cleanup;
+	}
+
 	ret = drm_vblank_init(dev, 1);
 	if (ret < 0) {
 		dev_err(dev->dev, "failed to initialize vblank\n");
-		goto fail_mode_config_cleanup;
+		goto fail_external_cleanup;
 	}
 
 	pm_runtime_get_sync(dev->dev);
@@ -267,9 +286,6 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags)
 		goto fail_vblank_cleanup;
 	}
 
-	platform_set_drvdata(pdev, dev);
-
-
 	list_for_each_entry(mod, &module_list, list) {
 		DBG("%s: preferred_bpp: %d", mod->name, mod->preferred_bpp);
 		bpp = mod->preferred_bpp;
@@ -300,6 +316,13 @@ fail_vblank_cleanup:
 fail_mode_config_cleanup:
 	drm_mode_config_cleanup(dev);
 
+fail_component_cleanup:
+	if (priv->is_componentized)
+		component_unbind_all(dev->dev, dev);
+
+fail_external_cleanup:
+	tilcdc_remove_external_encoders(dev);
+
 fail_cpufreq_unregister:
 	pm_runtime_disable(dev->dev);
 #ifdef CONFIG_CPU_FREQ
@@ -605,20 +628,52 @@ static const struct dev_pm_ops tilcdc_pm_ops = {
  * Platform driver:
  */
 
+static int tilcdc_bind(struct device *dev)
+{
+	return drm_platform_init(&tilcdc_driver, to_platform_device(dev));
+}
+
+static void tilcdc_unbind(struct device *dev)
+{
+	drm_put_dev(dev_get_drvdata(dev));
+}
+
+static const struct component_master_ops tilcdc_comp_ops = {
+	.bind = tilcdc_bind,
+	.unbind = tilcdc_unbind,
+};
+
 static int tilcdc_pdev_probe(struct platform_device *pdev)
 {
+	struct component_match *match = NULL;
+	int ret;
+
 	/* bail out early if no DT data: */
 	if (!pdev->dev.of_node) {
 		dev_err(&pdev->dev, "device-tree data is missing\n");
 		return -ENXIO;
 	}
 
-	return drm_platform_init(&tilcdc_driver, pdev);
+	ret = tilcdc_get_external_components(&pdev->dev, &match);
+	if (ret < 0)
+		return ret;
+	else if (ret == 0)
+		return drm_platform_init(&tilcdc_driver, pdev);
+	else
+		return component_master_add_with_match(&pdev->dev,
+						       &tilcdc_comp_ops,
+						       match);
 }
 
 static int tilcdc_pdev_remove(struct platform_device *pdev)
 {
-	drm_put_dev(platform_get_drvdata(pdev));
+	struct drm_device *ddev = dev_get_drvdata(&pdev->dev);
+	struct tilcdc_drm_private *priv = ddev->dev_private;
+
+	if (priv->is_componentized)
+		component_master_del(&pdev->dev, &tilcdc_comp_ops);
+	else
+		drm_put_dev(platform_get_drvdata(pdev));
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index 6336512..ff1c3dd 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -85,6 +85,9 @@ struct tilcdc_drm_private {
 
 	unsigned int num_connectors;
 	struct drm_connector *connectors[8];
+	struct drm_connector_helper_funcs *connector_funcs[8];
+
+	bool is_componentized;
 };
 
 /* Sub-module for display.  Since we don't know at compile time what panels
@@ -165,6 +168,8 @@ irqreturn_t tilcdc_crtc_irq(struct drm_crtc *crtc);
 void tilcdc_crtc_update_clk(struct drm_crtc *crtc);
 void tilcdc_crtc_set_panel_info(struct drm_crtc *crtc,
 		const struct tilcdc_panel_info *info);
+void tilcdc_crtc_set_simulate_vesa_sync(struct drm_crtc *crtc,
+					bool simulate_vesa_sync);
 int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode);
 int tilcdc_crtc_max_width(struct drm_crtc *crtc);
 
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c
new file mode 100644
index 0000000..f932f52
--- /dev/null
+++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2015 Texas Instruments
+ * Author: Jyri Sarha <jsarha@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ */
+
+#include <linux/component.h>
+#include <linux/of_graph.h>
+
+#include "tilcdc_drv.h"
+#include "tilcdc_external.h"
+
+static const struct tilcdc_panel_info panel_info_tda998x = {
+		.ac_bias                = 255,
+		.ac_bias_intrpt         = 0,
+		.dma_burst_sz           = 16,
+		.bpp                    = 16,
+		.fdd                    = 0x80,
+		.tft_alt_mode           = 0,
+		.invert_pxl_clk		= 1,
+		.sync_edge              = 1,
+		.sync_ctrl              = 1,
+		.raster_order           = 0,
+};
+
+static int tilcdc_external_mode_valid(struct drm_connector *connector,
+				      struct drm_display_mode *mode)
+{
+	struct tilcdc_drm_private *priv = connector->dev->dev_private;
+	int ret, i;
+
+	ret = tilcdc_crtc_mode_valid(priv->crtc, mode);
+	if (ret != MODE_OK)
+		return ret;
+
+	for (i = 0; i < priv->num_connectors &&
+		     priv->connectors[i] != connector; i++)
+		;
+
+	BUG_ON(priv->connectors[i] != connector);
+	BUG_ON(!priv->connector_funcs[i]);
+
+	if (!IS_ERR(priv->connector_funcs[i]) &&
+	    priv->connector_funcs[i]->mode_valid)
+		return priv->connector_funcs[i]->mode_valid(connector, mode);
+
+	return MODE_OK;
+}
+
+static int tilcdc_add_external_encoder(struct drm_device *dev, int *bpp,
+				       struct drm_connector *connector)
+{
+	struct tilcdc_drm_private *priv = dev->dev_private;
+	struct drm_connector_helper_funcs *connector_funcs;
+
+	priv->connectors[priv->num_connectors] = connector;
+	priv->encoders[priv->num_encoders++] = connector->encoder;
+
+	/* Only tda998x is supported at the moment. */
+	tilcdc_crtc_set_simulate_vesa_sync(priv->crtc, true);
+	tilcdc_crtc_set_panel_info(priv->crtc, &panel_info_tda998x);
+	*bpp = panel_info_tda998x.bpp;
+
+	connector_funcs = devm_kzalloc(dev->dev, sizeof(*connector_funcs),
+				       GFP_KERNEL);
+	if (!connector_funcs)
+		return -ENOMEM;
+
+	if (connector->helper_private) {
+		priv->connector_funcs[priv->num_connectors] =
+			connector->helper_private;
+		*connector_funcs = *priv->connector_funcs[priv->num_connectors];
+	} else {
+		priv->connector_funcs[priv->num_connectors] = ERR_PTR(-ENOENT);
+	}
+	connector_funcs->mode_valid = tilcdc_external_mode_valid;
+	drm_connector_helper_add(connector, connector_funcs);
+	priv->num_connectors++;
+
+	dev_dbg(dev->dev, "External encoder '%s' connected\n",
+		connector->encoder->name);
+
+	return 0;
+}
+
+int tilcdc_add_external_encoders(struct drm_device *dev, int *bpp)
+{
+	struct tilcdc_drm_private *priv = dev->dev_private;
+	struct drm_connector *connector;
+	int num_internal_connectors = priv->num_connectors;
+
+	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+		bool found = false;
+		int i, ret;
+
+		for (i = 0; i < num_internal_connectors; i++)
+			if (connector == priv->connectors[i])
+				found = true;
+		if (!found) {
+			ret = tilcdc_add_external_encoder(dev, bpp, connector);
+			if (ret)
+				return ret;
+		}
+	}
+	return 0;
+}
+
+void tilcdc_remove_external_encoders(struct drm_device *dev)
+{
+	struct tilcdc_drm_private *priv = dev->dev_private;
+	int i;
+
+	for (i = 0; i < priv->num_connectors; i++)
+		if (IS_ERR(priv->connector_funcs[i]))
+			drm_connector_helper_add(priv->connectors[i], NULL);
+		else if (priv->connector_funcs[i])
+			drm_connector_helper_add(priv->connectors[i],
+						 priv->connector_funcs[i]);
+}
+
+static int dev_match_of(struct device *dev, void *data)
+{
+	return dev->of_node == data;
+}
+
+int tilcdc_get_external_components(struct device *dev,
+				   struct component_match **match)
+{
+	struct device_node *ep = NULL;
+	int count = 0;
+
+	while ((ep = of_graph_get_next_endpoint(dev->of_node, ep))) {
+		struct device_node *node;
+
+		node = of_graph_get_remote_port_parent(ep);
+		if (!node && !of_device_is_available(node)) {
+			of_node_put(node);
+			continue;
+		}
+
+		dev_dbg(dev, "Subdevice node '%s' found\n", node->name);
+		if (match)
+			component_match_add(dev, match, dev_match_of, node);
+		of_node_put(node);
+		count++;
+	}
+
+	if (count > 1) {
+		dev_err(dev, "Only one external encoder is supported\n");
+		return -EINVAL;
+	}
+
+	return count;
+}
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.h b/drivers/gpu/drm/tilcdc/tilcdc_external.h
new file mode 100644
index 0000000..6aabe27
--- /dev/null
+++ b/drivers/gpu/drm/tilcdc/tilcdc_external.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2015 Texas Instruments
+ * Author: Jyri Sarha <jsarha@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __TILCDC_EXTERNAL_H__
+#define __TILCDC_EXTERNAL_H__
+
+int tilcdc_add_external_encoders(struct drm_device *dev, int *bpp);
+void tilcdc_remove_external_encoders(struct drm_device *dev);
+int tilcdc_get_external_components(struct device *dev,
+				   struct component_match **match);
+#endif /* __TILCDC_SLAVE_H__ */
-- 
1.9.1


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

* [PATCH v4 4/7] drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support
       [not found] ` <cover.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
  2015-04-01  8:49   ` [PATCH v4 2/7] drm/tilcdc: Remove tilcdc slave support for tda998x driver Jyri Sarha
@ 2015-04-01  8:49   ` Jyri Sarha
  2015-04-01  8:49   ` [PATCH v4 7/7] drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint Jyri Sarha
  2 siblings, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, airlied-cv59FeDIM0c,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	bcousson-rdvid1DuHRBWk0Htik3J/w, tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: tomi.valkeinen-l0cyMroinI0, rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w, moinejf-GANU6spQydw,
	Jyri Sarha

Adds a CONFIG_DRM_TILCDC_SLAVE_COMPAT module for "ti,tilcdc,slave"
node conversion. The implementation is in tilcdc_slave_compat.c and it
uses tilcdc_slave_compat.dts as a basis for creating a DTS
overlay. The DTS overlay adds an external tda998x encoder to tilcdc
that corresponds to the old tda998x based slave encoder.

Signed-off-by: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
---
 drivers/gpu/drm/tilcdc/Kconfig                 |  12 ++
 drivers/gpu/drm/tilcdc/Makefile                |   3 +
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c   | 270 +++++++++++++++++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.dts |  72 +++++++
 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.h   |  25 +++
 5 files changed, 382 insertions(+)
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.dts
 create mode 100644 drivers/gpu/drm/tilcdc/tilcdc_slave_compat.h

diff --git a/drivers/gpu/drm/tilcdc/Kconfig b/drivers/gpu/drm/tilcdc/Kconfig
index 8394a0b..bfbef69 100644
--- a/drivers/gpu/drm/tilcdc/Kconfig
+++ b/drivers/gpu/drm/tilcdc/Kconfig
@@ -1,3 +1,15 @@
+config DRM_TILCDC_SLAVE_COMPAT
+	bool "Support device tree blobs using TI LCDC Slave binding"
+	depends on DRM_TILCDC
+	default y
+	select OF_RESOLVE
+	select OF_OVERLAY
+	help
+	  Choose this option if you need a kernel that is compatible
+	  with device tree blobs using the obsolete "ti,tilcdc,slave"
+	  binding. If you find "ti,tilcdc,slave"-string from your DTB,
+	  you probably need this. Otherwise you do not.
+
 config DRM_TILCDC
 	tristate "DRM Support for TI LCDC Display Controller"
 	depends on DRM && OF && ARM && HAVE_DMA_ATTRS
diff --git a/drivers/gpu/drm/tilcdc/Makefile b/drivers/gpu/drm/tilcdc/Makefile
index e1f738b..deeca48 100644
--- a/drivers/gpu/drm/tilcdc/Makefile
+++ b/drivers/gpu/drm/tilcdc/Makefile
@@ -3,6 +3,9 @@ ifeq (, $(findstring -W,$(EXTRA_CFLAGS)))
 	ccflags-y += -Werror
 endif
 
+obj-$(CONFIG_DRM_TILCDC_SLAVE_COMPAT) += tilcdc_slave_compat.o \
+					 tilcdc_slave_compat.dtb.o
+
 tilcdc-y := \
 	tilcdc_crtc.o \
 	tilcdc_tfp410.o \
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
new file mode 100644
index 0000000..106679b
--- /dev/null
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2015 Texas Instruments
+ * Author: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ */
+
+/*
+ * To support the old "ti,tilcdc,slave" binding the binding has to be
+ * transformed to the new external encoder binding.
+ */
+
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/of_graph.h>
+#include <linux/of_fdt.h>
+#include <linux/slab.h>
+#include <linux/list.h>
+
+#include "tilcdc_slave_compat.h"
+
+struct kfree_table {
+	int total;
+	int num;
+	void **table;
+};
+
+static int __init kfree_table_init(struct kfree_table *kft)
+{
+	kft->total = 32;
+	kft->num = 0;
+	kft->table = kmalloc(kft->total * sizeof(*kft->table),
+			     GFP_KERNEL);
+	if (!kft->table)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static int __init kfree_table_add(struct kfree_table *kft, void *p)
+{
+	if (kft->num == kft->total) {
+		void **old = kft->table;
+
+		kft->total *= 2;
+		kft->table = krealloc(old, kft->total * sizeof(*kft->table),
+				      GFP_KERNEL);
+		if (!kft->table) {
+			kft->table = old;
+			kfree(p);
+			return -ENOMEM;
+		}
+	}
+	kft->table[kft->num++] = p;
+	return 0;
+}
+
+static void __init kfree_table_free(struct kfree_table *kft)
+{
+	int i;
+
+	for (i = 0; i < kft->num; i++)
+		kfree(kft->table[i]);
+
+	kfree(kft->table);
+}
+
+static
+struct property * __init tilcdc_prop_dup(const struct property *prop,
+					 struct kfree_table *kft)
+{
+	struct property *nprop;
+
+	nprop = kzalloc(sizeof(*nprop), GFP_KERNEL);
+	if (!nprop || kfree_table_add(kft, nprop))
+		return NULL;
+
+	nprop->name = kstrdup(prop->name, GFP_KERNEL);
+	if (!nprop->name || kfree_table_add(kft, nprop->name))
+		return NULL;
+
+	nprop->value = kmemdup(prop->value, prop->length, GFP_KERNEL);
+	if (!nprop->value || kfree_table_add(kft, nprop->value))
+		return NULL;
+
+	nprop->length = prop->length;
+
+	return nprop;
+}
+
+static void __init tilcdc_copy_props(struct device_node *from,
+				     struct device_node *to,
+				     const char * const props[],
+				     struct kfree_table *kft)
+{
+	struct property *prop;
+	int i;
+
+	for (i = 0; props[i]; i++) {
+		prop = of_find_property(from, props[i], NULL);
+		if (!prop)
+			continue;
+
+		prop = tilcdc_prop_dup(prop, kft);
+		if (!prop)
+			continue;
+
+		prop->next = to->properties;
+		to->properties = prop;
+	}
+}
+
+static int __init tilcdc_prop_str_update(struct property *prop,
+					  const char *str,
+					  struct kfree_table *kft)
+{
+	prop->value = kstrdup(str, GFP_KERNEL);
+	if (kfree_table_add(kft, prop->value) || !prop->value)
+		return -ENOMEM;
+	prop->length = strlen(str)+1;
+	return 0;
+}
+
+static void __init tilcdc_node_disable(struct device_node *node)
+{
+	struct property *prop;
+
+	prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+	if (!prop)
+		return;
+
+	prop->name = "status";
+	prop->value = "disabled";
+	prop->length = strlen((char *)prop->value)+1;
+
+	of_update_property(node, prop);
+}
+
+struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
+{
+	const int size = __dtb_tilcdc_slave_compat_end -
+		__dtb_tilcdc_slave_compat_begin;
+	static void *overlay_data;
+	struct device_node *overlay;
+	int ret;
+
+	if (!size) {
+		pr_warn("%s: No overlay data\n", __func__);
+		return NULL;
+	}
+
+	overlay_data = kmemdup(__dtb_tilcdc_slave_compat_begin,
+			       size, GFP_KERNEL);
+	if (!overlay_data || kfree_table_add(kft, overlay_data))
+		return NULL;
+
+	of_fdt_unflatten_tree(overlay_data, &overlay);
+	if (!overlay) {
+		pr_warn("%s: Unfattening overlay tree failed\n", __func__);
+		return NULL;
+	}
+
+	of_node_set_flag(overlay, OF_DETACHED);
+	ret = of_resolve_phandles(overlay);
+	if (ret) {
+		pr_err("%s: Failed to resolve phandles: %d\n", __func__, ret);
+		return NULL;
+	}
+
+	return overlay;
+}
+
+static const struct of_device_id tilcdc_slave_of_match[] __initconst = {
+	{ .compatible = "ti,tilcdc,slave", },
+	{},
+};
+
+static const struct of_device_id tilcdc_of_match[] __initconst = {
+	{ .compatible = "ti,am33xx-tilcdc", },
+	{},
+};
+
+static const struct of_device_id tilcdc_tda998x_of_match[] __initconst = {
+	{ .compatible = "nxp,tda998x", },
+	{},
+};
+
+static const char * const tilcdc_slave_props[] __initconst = {
+	"pinctrl-names",
+	"pinctrl-0",
+	"pinctrl-1",
+	NULL
+};
+
+void __init tilcdc_convert_slave_node(void)
+{
+	struct device_node *slave = NULL, *lcdc = NULL;
+	struct device_node *i2c = NULL, *fragment = NULL;
+	struct device_node *overlay, *encoder;
+	struct property *prop;
+	/* For all memory needed for the overlay tree. This memory can
+	   be freed after the overlay has been applied. */
+	struct kfree_table kft;
+	int ret;
+
+	if (kfree_table_init(&kft))
+		goto out;
+
+	lcdc = of_find_matching_node(NULL, tilcdc_of_match);
+	slave = of_find_matching_node(NULL, tilcdc_slave_of_match);
+
+	if (!slave || !of_device_is_available(lcdc))
+		goto out;
+
+	i2c = of_parse_phandle(slave, "i2c", 0);
+	if (!i2c) {
+		pr_err("%s: Can't find i2c node trough phandle\n", __func__);
+		goto out;
+	}
+
+	overlay = tilcdc_get_overlay(&kft);
+	if (!overlay)
+		goto out;
+
+	encoder = of_find_matching_node(overlay, tilcdc_tda998x_of_match);
+	if (!encoder) {
+		pr_err("%s: Failed to find tda998x node\n", __func__);
+		goto out;
+	}
+
+	tilcdc_copy_props(slave, encoder, tilcdc_slave_props, &kft);
+
+	for_each_child_of_node(overlay, fragment) {
+		prop = of_find_property(fragment, "target-path", NULL);
+		if (!prop)
+			continue;
+		if (!strncmp("i2c", (char *)prop->value, prop->length))
+			if (tilcdc_prop_str_update(prop, i2c->full_name, &kft))
+				goto out;
+		if (!strncmp("lcdc", (char *)prop->value, prop->length))
+			if (tilcdc_prop_str_update(prop, lcdc->full_name, &kft))
+				goto out;
+	}
+
+	tilcdc_node_disable(slave);
+
+	ret = of_overlay_create(overlay);
+	if (ret)
+		pr_err("%s: Creating overlay failed: %d\n", __func__, ret);
+	else
+		pr_info("%s: ti,tilcdc,slave node successfully converted\n",
+			__func__);
+out:
+	kfree_table_free(&kft);
+	of_node_put(i2c);
+	of_node_put(slave);
+	of_node_put(lcdc);
+	of_node_put(fragment);
+}
+
+int __init tilcdc_slave_compat_init(void)
+{
+	tilcdc_convert_slave_node();
+	return 0;
+}
+
+subsys_initcall(tilcdc_slave_compat_init);
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.dts b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.dts
new file mode 100644
index 0000000..693f8b0
--- /dev/null
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.dts
@@ -0,0 +1,72 @@
+/*
+ * DTS overlay for converting ti,tilcdc,slave binding to new binding.
+ *
+ * Copyright (C) 2015 Texas Instruments Inc.
+ * Author: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ */
+
+/*
+ * target-path property values are simple tags that are replaced with
+ * correct values in tildcdc_slave_compat.c. Some properties are also
+ * copied over from the ti,tilcdc,slave node.
+ */
+
+/dts-v1/;
+/ {
+	fragment@0 {
+		target-path = "i2c";
+		__overlay__ {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			tda19988 {
+				compatible = "nxp,tda998x";
+				reg = <0x70>;
+				status = "okay";
+
+				port {
+					hdmi_0: endpoint@0 {
+						remote-endpoint = <&lcd_0>;
+					};
+				};
+			};
+		};
+	};
+
+	fragment@1 {
+		target-path = "lcdc";
+		__overlay__ {
+			port {
+				lcd_0: endpoint@0 {
+					remote-endpoint = <&hdmi_0>;
+				};
+			};
+		};
+	};
+
+	__local_fixups__ {
+		fragment@0 {
+			__overlay__ {
+				tda19988 {
+					port {
+						endpoint@0 {
+							remote-endpoint	= <0>;
+						};
+					};
+				};
+			};
+		};
+		fragment@1 {
+			__overlay__ {
+				port {
+					endpoint@0 {
+						remote-endpoint	= <0>;
+					};
+				};
+			};
+		};
+	};
+};
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.h b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.h
new file mode 100644
index 0000000..403d35d
--- /dev/null
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2015 Texas Instruments
+ * Author: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/* This header declares the symbols defined in tilcdc_slave_compat.dts */
+
+#ifndef __TILCDC_SLAVE_COMPAT_H__
+#define __TILCDC_SLAVE_COMPAT_H__
+
+extern uint8_t __dtb_tilcdc_slave_compat_begin[];
+extern uint8_t __dtb_tilcdc_slave_compat_end[];
+
+#endif /* __TILCDC_SLAVE_COMPAT_H__ */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v4 5/7] drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT
  2015-04-01  8:49 [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Jyri Sarha
  2015-04-01  8:49 ` [PATCH v4 1/7] drm/tilcdc: Fix module unloading Jyri Sarha
  2015-04-01  8:49 ` [PATCH v4 3/7] drm/tilcdc: Add support for external tda998x encoder Jyri Sarha
@ 2015-04-01  8:49 ` Jyri Sarha
  2015-04-01  8:49 ` [PATCH v4 6/7] ARM: dts: am335x-boneblack: Use new binding for HDMI Jyri Sarha
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel, airlied, linux-omap, devicetree, bcousson, tony
  Cc: tomi.valkeinen, rmk+kernel, robdclark, moinejf, Jyri Sarha

If I read Documentation/kbuild/makefiles.txt section 3.6 right, this
patch should not be needed. However, without this patch the objects
needed for DRM_TILCDC_SLAVE_COMPAT are not linked, if DRM_TILCDC is
built as module.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 2c239b9..c93ca0e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -59,7 +59,7 @@ obj-$(CONFIG_DRM_ATMEL_HLCDC)	+= atmel-hlcdc/
 obj-$(CONFIG_DRM_RCAR_DU) += rcar-du/
 obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
 obj-$(CONFIG_DRM_OMAP)	+= omapdrm/
-obj-$(CONFIG_DRM_TILCDC)	+= tilcdc/
+obj-y			+= tilcdc/
 obj-$(CONFIG_DRM_QXL) += qxl/
 obj-$(CONFIG_DRM_BOCHS) += bochs/
 obj-$(CONFIG_DRM_MSM) += msm/
-- 
1.9.1


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

* [PATCH v4 6/7] ARM: dts: am335x-boneblack: Use new binding for HDMI
  2015-04-01  8:49 [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Jyri Sarha
                   ` (2 preceding siblings ...)
  2015-04-01  8:49 ` [PATCH v4 5/7] drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT Jyri Sarha
@ 2015-04-01  8:49 ` Jyri Sarha
       [not found] ` <cover.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
  2015-05-07  9:44 ` [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Tomi Valkeinen
  5 siblings, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel, airlied, linux-omap, devicetree, bcousson, tony
  Cc: tomi.valkeinen, rmk+kernel, robdclark, moinejf, Jyri Sarha

Use new binding for the external tda19988 HDMI encoder.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 arch/arm/boot/dts/am335x-boneblack.dts | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts
index 5c42d25..eadbba3 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -68,16 +68,26 @@
 
 &lcdc {
 	status = "okay";
+	port {
+		lcdc_0: endpoint@0 {
+			remote-endpoint = <&hdmi_0>;
+		};
+	};
 };
 
-/ {
-	hdmi {
-		compatible = "ti,tilcdc,slave";
-		i2c = <&i2c0>;
+&i2c0 {
+	tda19988 {
+		compatible = "nxp,tda998x";
+		reg = <0x70>;
 		pinctrl-names = "default", "off";
 		pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
 		pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
-		status = "okay";
+
+		port {
+			hdmi_0: endpoint@0 {
+				remote-endpoint = <&lcdc_0>;
+			};
+		};
 	};
 };
 
-- 
1.9.1


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

* [PATCH v4 7/7] drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint
       [not found] ` <cover.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
  2015-04-01  8:49   ` [PATCH v4 2/7] drm/tilcdc: Remove tilcdc slave support for tda998x driver Jyri Sarha
  2015-04-01  8:49   ` [PATCH v4 4/7] drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support Jyri Sarha
@ 2015-04-01  8:49   ` Jyri Sarha
  2 siblings, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-01  8:49 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, airlied-cv59FeDIM0c,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	bcousson-rdvid1DuHRBWk0Htik3J/w, tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: tomi.valkeinen-l0cyMroinI0, rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w, moinejf-GANU6spQydw,
	Jyri Sarha

This patch should be dropped/reverterd if/after "of: Decrement refcount
of previous endpoint in of_graph_get_next_endpoint" patch has been
merged.

Signed-off-by: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
---
 drivers/gpu/drm/tilcdc/tilcdc_external.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_external.c b/drivers/gpu/drm/tilcdc/tilcdc_external.c
index f932f52..7232647 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_external.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_external.c
@@ -137,6 +137,7 @@ int tilcdc_get_external_components(struct device *dev,
 		struct device_node *node;
 
 		node = of_graph_get_remote_port_parent(ep);
+		of_node_put(ep);
 		if (!node && !of_device_is_available(node)) {
 			of_node_put(node);
 			continue;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 3/7] drm/tilcdc: Add support for external tda998x encoder
       [not found]   ` <e22d703d6ee5fe02e8c34b78a63f98a4b2ea1f22.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
@ 2015-04-01 22:20     ` Russell King - ARM Linux
  2015-04-15 15:04       ` Jyri Sarha
  0 siblings, 1 reply; 13+ messages in thread
From: Russell King - ARM Linux @ 2015-04-01 22:20 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, airlied-cv59FeDIM0c,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	bcousson-rdvid1DuHRBWk0Htik3J/w, tony-4v6yS6AI5VpBDgjK7y7TUQ,
	tomi.valkeinen-l0cyMroinI0, robdclark-Re5JQEeQqe8AvxtiuMwx3w,
	moinejf-GANU6spQydw

On Wed, Apr 01, 2015 at 11:49:27AM +0300, Jyri Sarha wrote:
> Add support for an external compontised DRM encoder. The external
> encoder can be connected to tilcdc trough device tree graph binding.
> The binding document for tilcdc has been updated. The current
> implementation supports only tda998x encoder.
> 
> To be able to filter out the unsupported video modes the tilcdc driver
> needs to hijack the external connectors helper functions. The tilcdc
> installes new helper functions that are otherwise identical to
> orignals, but the mode_valid() call-back check the mode first localy,
> before calling the original call-back. The tilcdc dirver restores the
> original helper functions before it is unbound from the external
> device.

This is where the DRM model is weak - we don't really have a way to
say "this is the set of CRTCs which /can/ be associated with this
connector, can any of the CRTCs accept this mode?" and eliminate
modes which fail that check.

This problem seems to be one which recurrs, so I wonder if it's
something which ought to be solved properly.

It's made slightly more difficult because we don't really know which
connectors could be associated with which CRTCs - that information is
stored at the encoder level (with the encoders possible_crtcs), and
I'm not sure we have a way for generic DRM code to know which encoders
could be associated with which connectors.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 3/7] drm/tilcdc: Add support for external tda998x encoder
  2015-04-01 22:20     ` Russell King - ARM Linux
@ 2015-04-15 15:04       ` Jyri Sarha
  0 siblings, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-04-15 15:04 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: dri-devel, airlied, linux-omap, devicetree, bcousson, tony,
	tomi.valkeinen, robdclark, moinejf

On 04/02/15 01:20, Russell King - ARM Linux wrote:
> This is where the DRM model is weak - we don't really have a way to
> say "this is the set of CRTCs which/can/  be associated with this
> connector, can any of the CRTCs accept this mode?" and eliminate
> modes which fail that check.
>
> This problem seems to be one which recurrs, so I wonder if it's
> something which ought to be solved properly.
>
> It's made slightly more difficult because we don't really know which
> connectors could be associated with which CRTCs - that information is
> stored at the encoder level (with the encoders possible_crtcs), and
> I'm not sure we have a way for generic DRM code to know which encoders
> could be associated with which connectors.

I agree that this is not the most elegant solution to the problem, but 
it works with Beaglebone-Black - which is AFAIK the only piece of HW 
that uses tda998x with tilcdc.

I would like to get these patches merged and revisit the mode validation 
code once we have a better solution for it.

Best regards,
Jyri

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

* Re: [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x
  2015-04-01  8:49 [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Jyri Sarha
                   ` (4 preceding siblings ...)
       [not found] ` <cover.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
@ 2015-05-07  9:44 ` Tomi Valkeinen
  2015-05-07 13:38   ` Jyri Sarha
  2015-05-08 11:17   ` Jyri Sarha
  5 siblings, 2 replies; 13+ messages in thread
From: Tomi Valkeinen @ 2015-05-07  9:44 UTC (permalink / raw)
  To: Jyri Sarha
  Cc: dri-devel, airlied, linux-omap, devicetree, bcousson, tony,
	rmk+kernel, robdclark, moinejf

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


On 01/04/15 11:49, Jyri Sarha wrote:
> Ok, let's do one more full review round. The mode filtering issue was
> the main reason for this new patch series version. However, I found
> couple other things to fix too after scrutinizing the patches once
> more.
> 
> Changes since v3 version of the patch-set:
> * drm/tilcdc: Add support for external tda998x encoder
>  - Hijack external connectors helper functions
>  - Remove select of nonexistent DRM_TILCDC_INIT in tilcdc Kconfig
>  - Correct author mail address to tilcdc_exteral.h
> * drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding
>  - Add a header file for tilcdc_slave_compat.dtb symbol declarations
> 
> Changes since v2 version of the patch-set:
> - use obj-y in Makefle for tilcdc subdir in:
>   "drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT"
> - move to last:
>   "drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint"
> 
> Changes since first version of the patch-set:
> - Rename DRM_TILCDC_INIT to DRM_TILCDC_SLAVE_COMPAT and make it visible
> - Add separate: 
>   drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint
> - Reduce info-level spam
> - Use component_master_add_with_match()
> - Be more explicit about tda998x being the only supported external encoder
> 
> Remove tilcdc slave support and connect to tda998x trough its
> component DRM API. For dtb backward compatibility the code creates at
> boot time a DT overlay based on the earlier binding. The overlay
> conforms to the new graph based binding.
> 
> The "drm/tilcdc: Decrement refcount of ep-node from
> of_graph_get_next_endpoint" should probably not be merged. The "of:
> Decrement refcount of previous endpoint in of_graph_get_next_endpoint"
> is eventually going to be merged and before that leaking of two
> of-node refcount increments each time the module is loaded is not that
> serious. The of-nodes live forever anyway.
> 
> The merge of the dts patch can be delayed until the next merger
> window, when the other patches are already in. The
> DRM_TILCDC_SLAVE_COMPAT should keep the bbb HDMI operational until
> then.

I made a quick test on v4.1-rc2, and:

[   15.199584] [drm] Initialized drm 1.1.0 20060810
[   15.319496] BUG: sleeping function called from invalid context at
kernel/locking/mutex.c:616
[   15.328339] in_atomic(): 1, irqs_disabled(): 128, pid: 130, name: insmod
[   15.335336] 3 locks held by insmod/130:
[   15.339339]  #0:  (&dev->mutex){......}, at: [<c044d8d0>]
__driver_attach+0x50/0xa0
[   15.347389]  #1:  (&dev->mutex){......}, at: [<c044d8e0>]
__driver_attach+0x60/0xa0
[   15.355420]  #2:  (devtree_lock){......}, at: [<c05e2888>]
of_get_next_child+0x20/0x4c
[   15.363731] irq event stamp: 5750
[   15.367189] hardirqs last  enabled at (5749): [<c0719f14>]
_raw_spin_unlock_irqrestore+0x38/0x64
[   15.376377] hardirqs last disabled at (5750): [<c0719730>]
_raw_spin_lock_irqsave+0x24/0x6c
[   15.385104] softirqs last  enabled at (5200): [<c004b7c8>]
__do_softirq+0x318/0x710
[   15.393111] softirqs last disabled at (5147): [<c004bf1c>]
irq_exit+0xc4/0x138
[   15.400668] CPU: 0 PID: 130 Comm: insmod Not tainted
4.1.0-rc2-00007-g877542591d33-dirty #22
[   15.409477] Hardware name: Generic AM33XX (Flattened Device Tree)
[   15.415837] Backtrace:
[   15.418403] [<c00140a8>] (dump_backtrace) from [<c0014244>]
(show_stack+0x18/0x1c)
[   15.426306]  r6:c08d04b0 r5:dd652000 r4:00000000 r3:00000000
[   15.432257] [<c001422c>] (show_stack) from [<c0711b44>]
(dump_stack+0x94/0xc8)
[   15.439810] [<c0711ab0>] (dump_stack) from [<c0070768>]
(___might_sleep+0x18c/0x294)
[   15.447893]  r5:00000268 r4:00000000
[   15.451643] [<c00705dc>] (___might_sleep) from [<c00708d4>]
(__might_sleep+0x64/0xa4)
[   15.459816]  r7:dd119280 r6:00000000 r5:00000268 r4:c08d04b0
[   15.465759] [<c0070870>] (__might_sleep) from [<c0715934>]
(mutex_lock_nested+0x2c/0x430)
[   15.474295]  r7:dd119280 r6:c0ae7c40 r5:c0203d0c r4:00000000
[   15.480239] [<c0715908>] (mutex_lock_nested) from [<c0203d0c>]
(kernfs_remove+0x20/0x38)
[   15.488684]  r10:bf111da0 r9:bf111dd0 r8:dfa3a044 r7:dd119280
r6:c0ae7c40 r5:dd11a510
[   15.496897]  r4:c0a7a7e8
[   15.499552] [<c0203cec>] (kernfs_remove) from [<c0205ed0>]
(sysfs_remove_dir+0x4c/0x84)
[   15.507907]  r5:dfa3a044 r4:dd11a510
[   15.511658] [<c0205e84>] (sysfs_remove_dir) from [<c03b0514>]
(kobject_del+0x1c/0x4c)
[   15.519831]  r5:dd11a510 r4:dfa3a044
[   15.523580] [<c03b04f8>] (kobject_del) from [<c03b05b4>]
(kobject_release+0x70/0x1b8)
[   15.531753]  r5:c0ac320c r4:dfa3a060
[   15.535502] [<c03b0544>] (kobject_release) from [<c03b0754>]
(kobject_put+0x58/0x88)
[   15.543585]  r8:dd653cac r7:dfa3a018 r6:a00c0013 r5:dfa3a018 r4:dfa3a044
[   15.550627] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
(of_node_put+0x1c/0x20)
[   15.558347]  r4:00000000
[   15.561000] [<c05e5ce4>] (of_node_put) from [<c05e2850>]
(__of_get_next_child+0x50/0x68)
[   15.569451] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
(of_get_next_child+0x30/0x4c)
[   15.578440]  r5:dfa39f60 r4:c0ac31ec
[   15.582190] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
(of_graph_get_next_endpoint+0x54/0x138)
[   15.591905]  r7:dd158c10 r6:dfa39d2c r5:dfa3a018 r4:dfa39f60
[   15.597877] [<c05e2a68>] (of_graph_get_next_endpoint) from
[<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
[   15.609497]  r7:dd158c10 r6:00000001 r5:dfa3a018 r4:dfa3270c
[   15.615459] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
from [<bf11047c>] (tilcdc_pdev_probe+0x38/0x8c [tilcdc])
[   15.627078]  r10:0000000a r8:bf111bd0 r7:bf111bd0 r6:fffffdfb
r5:dd158c10 r4:dd158c00
[   15.635309] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
[<c044f6cc>] (platform_drv_probe+0x50/0xac)
[   15.645024]  r5:dd158c10 r4:ffffffed
[   15.648773] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
(driver_probe_device+0x1ac/0x3e8)
[   15.658035]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
[   15.663976] [<c044d498>] (driver_probe_device) from [<c044d91c>]
(__driver_attach+0x9c/0xa0)
[   15.672784]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
r5:bf111bd0 r4:dd158c10
[   15.681012] [<c044d880>] (__driver_attach) from [<c044b964>]
(bus_for_each_dev+0x5c/0x90)
[   15.689548]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
[   15.695493] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
(driver_attach+0x20/0x28)
[   15.703848]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
[   15.708695] [<c044cfa4>] (driver_attach) from [<c044cb98>]
(bus_add_driver+0xf0/0x210)
[   15.716965] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
(driver_register+0x80/0xfc)
[   15.725319]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
[   15.731261] [<c044e768>] (driver_register) from [<c044f554>]
(__platform_driver_register+0x50/0x64)
[   15.740703]  r5:c0a29bd8 r4:c0a29bd8
[   15.744462] [<c044f504>] (__platform_driver_register) from
[<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
[   15.754738] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
(do_one_initcall+0xb4/0x1f8)
[   15.764096] [<c0009774>] (do_one_initcall) from [<c070fad8>]
(do_init_module+0x64/0x1b4)
[   15.772542]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
r6:dd79d640 r5:c0ae03a8
[   15.780754]  r4:bf111dd0
[   15.783414] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
(load_module+0x19a8/0x22e8)
[   15.791768]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
[   15.796614] [<c00db614>] (load_module) from [<c00dda04>]
(SyS_init_module+0x108/0x18c)
[   15.804878]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
r6:00000000 r5:000af492
[   15.813091]  r4:0000c47a
[   15.815750] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
(ret_fast_syscall+0x0/0x4c)
[   15.824195]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
[   15.831943] ERROR: Bad of_node_put() on
/ocp/lcdc@4830e000/port/endpoint@0
[   15.839139] CPU: 0 PID: 130 Comm: insmod Not tainted
4.1.0-rc2-00007-g877542591d33-dirty #22
[   15.847948] Hardware name: Generic AM33XX (Flattened Device Tree)
[   15.854308] Backtrace:
[   15.856878] [<c00140a8>] (dump_backtrace) from [<c0014244>]
(show_stack+0x18/0x1c)
[   15.864780]  r6:dfa3a044 r5:dd652000 r4:00000000 r3:00000000
[   15.870726] [<c001422c>] (show_stack) from [<c0711b44>]
(dump_stack+0x94/0xc8)
[   15.878276] [<c0711ab0>] (dump_stack) from [<c05e647c>]
(of_node_release+0x94/0x9c)
[   15.886268]  r5:c0ac320c r4:dfa3a094
[   15.890019] [<c05e63e8>] (of_node_release) from [<c03b05dc>]
(kobject_release+0x98/0x1b8)
[   15.898554]  r6:c0ae7c40 r5:c0ac320c r4:dfa3a060 r3:c05e63e8
[   15.904496] [<c03b0544>] (kobject_release) from [<c03b0754>]
(kobject_put+0x58/0x88)
[   15.912578]  r8:dd653cac r7:dfa3a018 r6:a00c0013 r5:dfa3a018 r4:dfa3a044
[   15.919616] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
(of_node_put+0x1c/0x20)
[   15.927335]  r4:00000000
[   15.929990] [<c05e5ce4>] (of_node_put) from [<c05e2850>]
(__of_get_next_child+0x50/0x68)
[   15.938440] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
(of_get_next_child+0x30/0x4c)
[   15.947429]  r5:dfa39f60 r4:c0ac31ec
[   15.951179] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
(of_graph_get_next_endpoint+0x54/0x138)
[   15.960894]  r7:dd158c10 r6:dfa39d2c r5:dfa3a018 r4:dfa39f60
[   15.966859] [<c05e2a68>] (of_graph_get_next_endpoint) from
[<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
[   15.978479]  r7:dd158c10 r6:00000001 r5:dfa3a018 r4:dfa3270c
[   15.984439] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
from [<bf11047c>] (tilcdc_pdev_probe+0x38/0x8c [tilcdc])
[   15.996058]  r10:0000000a r8:bf111bd0 r7:bf111bd0 r6:fffffdfb
r5:dd158c10 r4:dd158c00
[   16.004290] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
[<c044f6cc>] (platform_drv_probe+0x50/0xac)
[   16.014005]  r5:dd158c10 r4:ffffffed
[   16.017755] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
(driver_probe_device+0x1ac/0x3e8)
[   16.027016]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
[   16.032957] [<c044d498>] (driver_probe_device) from [<c044d91c>]
(__driver_attach+0x9c/0xa0)
[   16.041764]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
r5:bf111bd0 r4:dd158c10
[   16.049987] [<c044d880>] (__driver_attach) from [<c044b964>]
(bus_for_each_dev+0x5c/0x90)
[   16.058524]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
[   16.064467] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
(driver_attach+0x20/0x28)
[   16.072822]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
[   16.077670] [<c044cfa4>] (driver_attach) from [<c044cb98>]
(bus_add_driver+0xf0/0x210)
[   16.085939] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
(driver_register+0x80/0xfc)
[   16.094294]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
[   16.100235] [<c044e768>] (driver_register) from [<c044f554>]
(__platform_driver_register+0x50/0x64)
[   16.109678]  r5:c0a29bd8 r4:c0a29bd8
[   16.113437] [<c044f504>] (__platform_driver_register) from
[<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
[   16.123710] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
(do_one_initcall+0xb4/0x1f8)
[   16.133068] [<c0009774>] (do_one_initcall) from [<c070fad8>]
(do_init_module+0x64/0x1b4)
[   16.141513]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
r6:dd79d640 r5:c0ae03a8
[   16.149726]  r4:bf111dd0
[   16.152382] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
(load_module+0x19a8/0x22e8)
[   16.160737]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
[   16.165582] [<c00db614>] (load_module) from [<c00dda04>]
(SyS_init_module+0x108/0x18c)
[   16.173846]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
r6:00000000 r5:000af492
[   16.182059]  r4:0000c47a
[   16.184715] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
(ret_fast_syscall+0x0/0x4c)
[   16.193161]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
[   16.239460] ------------[ cut here ]------------
[   16.244338] WARNING: CPU: 0 PID: 130 at include/linux/kref.h:47
kobject_get+0x98/0xb8()
[   16.252705] Modules linked in: tilcdc(+) tda998x drm_kms_helper drm
[   16.259309] CPU: 0 PID: 130 Comm: insmod Not tainted
4.1.0-rc2-00007-g877542591d33-dirty #22
[   16.268129] Hardware name: Generic AM33XX (Flattened Device Tree)
[   16.274498] Backtrace:
[   16.277070] [<c00140a8>] (dump_backtrace) from [<c0014244>]
(show_stack+0x18/0x1c)
[   16.284972]  r6:0000002f r5:dd652000 r4:00000000 r3:00000000
[   16.290926] [<c001422c>] (show_stack) from [<c0711b44>]
(dump_stack+0x94/0xc8)
[   16.298474] [<c0711ab0>] (dump_stack) from [<c0046a54>]
(warn_slowpath_common+0x84/0xc0)
[   16.306919]  r5:c03b0a34 r4:00000000
[   16.310668] [<c00469d0>] (warn_slowpath_common) from [<c0046ab4>]
(warn_slowpath_null+0x24/0x2c)
[   16.319839]  r8:00000000 r7:00000000 r6:a0010013 r5:c0adfa5d r4:dfa3a044
[   16.326876] [<c0046a90>] (warn_slowpath_null) from [<c03b0a34>]
(kobject_get+0x98/0xb8)
[   16.335245] [<c03b099c>] (kobject_get) from [<c05e5d20>]
(of_node_get+0x1c/0x24)
[   16.342964]  r5:00000000 r4:dfa3a018
[   16.346715] [<c05e5d04>] (of_node_get) from [<c05e2830>]
(__of_get_next_child+0x30/0x68)
[   16.355160]  r4:dfa3a018 r3:dd5b8640
[   16.358909] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
(of_get_next_child+0x30/0x4c)
[   16.367898]  r5:dfa39f60 r4:c0ac31ec
[   16.371648] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
(of_graph_get_next_endpoint+0x54/0x138)
[   16.381363]  r7:00000000 r6:dfa39d2c r5:00000000 r4:dfa39f60
[   16.387343] [<c05e2a68>] (of_graph_get_next_endpoint) from
[<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
[   16.398963]  r7:dd158c10 r6:00000000 r5:00000000 r4:dd507000
[   16.404925] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
from [<bf10fd84>] (tilcdc_load+0x50/0x648 [tilcdc])
[   16.416091]  r10:0000000a r8:dd158c00 r7:00000000 r6:dfa39d2c
r5:dd677f00 r4:dd507000
[   16.424542] [<bf10fd34>] (tilcdc_load [tilcdc]) from [<bf074060>]
(drm_dev_register+0xac/0x10c [drm])
[   16.434171]  r10:0000000a r9:bf111dd0 r8:00000000 r7:dd119290
r6:00000000 r5:00000000
[   16.442384]  r4:dd507000
[   16.445187] [<bf073fb4>] (drm_dev_register [drm]) from [<bf075b4c>]
(drm_platform_init+0x48/0xd8 [drm])
[   16.454993]  r6:bf111a8c r5:dd507000 r4:dd158c00 r3:00000000
[   16.461011] [<bf075b04>] (drm_platform_init [drm]) from [<bf10fa3c>]
(tilcdc_bind+0x18/0x20 [tilcdc])
[   16.470636]  r6:dd119240 r5:00000001 r4:dd119298
[   16.475499] [<bf10fa24>] (tilcdc_bind [tilcdc]) from [<c0448af4>]
(try_to_bring_up_master.part.1+0xd0/0x10c)
[   16.485766] [<c0448a24>] (try_to_bring_up_master.part.1) from
[<c0448bdc>] (component_master_add_with_match+0xac/0x110)
[   16.497022]  r8:dd158c10 r7:c0aa9040 r6:bf1109c0 r5:00000000
r4:dd119240 r3:c0aa9084
[   16.505160] [<c0448b30>] (component_master_add_with_match) from
[<bf110498>] (tilcdc_pdev_probe+0x54/0x8c [tilcdc])
[   16.516054]  r8:bf111bd0 r7:bf111bd0 r6:fffffdfb r5:dd158c10
r4:dd158c00 r3:dd652000
[   16.524195] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
[<c044f6cc>] (platform_drv_probe+0x50/0xac)
[   16.533910]  r5:dd158c10 r4:ffffffed
[   16.537659] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
(driver_probe_device+0x1ac/0x3e8)
[   16.546921]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
[   16.552862] [<c044d498>] (driver_probe_device) from [<c044d91c>]
(__driver_attach+0x9c/0xa0)
[   16.561670]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
r5:bf111bd0 r4:dd158c10
[   16.569893] [<c044d880>] (__driver_attach) from [<c044b964>]
(bus_for_each_dev+0x5c/0x90)
[   16.578428]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
[   16.584374] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
(driver_attach+0x20/0x28)
[   16.592728]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
[   16.597575] [<c044cfa4>] (driver_attach) from [<c044cb98>]
(bus_add_driver+0xf0/0x210)
[   16.605845] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
(driver_register+0x80/0xfc)
[   16.614199]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
[   16.620141] [<c044e768>] (driver_register) from [<c044f554>]
(__platform_driver_register+0x50/0x64)
[   16.629584]  r5:c0a29bd8 r4:c0a29bd8
[   16.633343] [<c044f504>] (__platform_driver_register) from
[<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
[   16.643618] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
(do_one_initcall+0xb4/0x1f8)
[   16.652978] [<c0009774>] (do_one_initcall) from [<c070fad8>]
(do_init_module+0x64/0x1b4)
[   16.661424]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
r6:dd79d640 r5:c0ae03a8
[   16.669636]  r4:bf111dd0
[   16.672295] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
(load_module+0x19a8/0x22e8)
[   16.680650]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
[   16.685496] [<c00db614>] (load_module) from [<c00dda04>]
(SyS_init_module+0x108/0x18c)
[   16.693760]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
r6:00000000 r5:000af492
[   16.701973]  r4:0000c47a
[   16.704631] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
(ret_fast_syscall+0x0/0x4c)
[   16.713077]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
[   16.720111] ---[ end trace 74558956458632df ]---
[   16.726493] ERROR: Bad of_node_put() on
/ocp/lcdc@4830e000/port/endpoint@0
[   16.733799] CPU: 0 PID: 130 Comm: insmod Tainted: G        W
4.1.0-rc2-00007-g877542591d33-dirty #22
[   16.743914] Hardware name: Generic AM33XX (Flattened Device Tree)
[   16.750305] Backtrace:
[   16.752884] [<c00140a8>] (dump_backtrace) from [<c0014244>]
(show_stack+0x18/0x1c)
[   16.760815]  r6:dfa3a044 r5:dd652000 r4:00000000 r3:00000000
[   16.766771] [<c001422c>] (show_stack) from [<c0711b44>]
(dump_stack+0x94/0xc8)
[   16.774354] [<c0711ab0>] (dump_stack) from [<c05e647c>]
(of_node_release+0x94/0x9c)
[   16.782376]  r5:c0ac320c r4:dfa3a094
[   16.786130] [<c05e63e8>] (of_node_release) from [<c03b05dc>]
(kobject_release+0x98/0x1b8)
[   16.794693]  r6:c0ae7c40 r5:c0ac320c r4:dfa3a060 r3:c05e63e8
[   16.800666] [<c03b0544>] (kobject_release) from [<c03b0754>]
(kobject_put+0x58/0x88)
[   16.808775]  r8:00000000 r7:dd158c10 r6:00000000 r5:dfa3a018 r4:dfa3a044
[   16.815818] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
(of_node_put+0x1c/0x20)
[   16.823564]  r4:dfa3270c
[   16.826251] [<c05e5ce4>] (of_node_put) from [<bf10f5f4>]
(tilcdc_get_external_components+0x34/0xe8 [tilcdc])
[   16.836568] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
from [<bf10fd84>] (tilcdc_load+0x50/0x648 [tilcdc])
[   16.847762]  r10:0000000a r8:dd158c00 r7:00000000 r6:dfa39d2c
r5:dd677f00 r4:dd507000
[   16.856196] [<bf10fd34>] (tilcdc_load [tilcdc]) from [<bf074060>]
(drm_dev_register+0xac/0x10c [drm])
[   16.865870]  r10:0000000a r9:bf111dd0 r8:00000000 r7:dd119290
r6:00000000 r5:00000000
[   16.874117]  r4:dd507000
[   16.876911] [<bf073fb4>] (drm_dev_register [drm]) from [<bf075b4c>]
(drm_platform_init+0x48/0xd8 [drm])
[   16.886757]  r6:bf111a8c r5:dd507000 r4:dd158c00 r3:00000000
[   16.892812] [<bf075b04>] (drm_platform_init [drm]) from [<bf10fa3c>]
(tilcdc_bind+0x18/0x20 [tilcdc])
[   16.902468]  r6:dd119240 r5:00000001 r4:dd119298
[   16.907338] [<bf10fa24>] (tilcdc_bind [tilcdc]) from [<c0448af4>]
(try_to_bring_up_master.part.1+0xd0/0x10c)
[   16.917636] [<c0448a24>] (try_to_bring_up_master.part.1) from
[<c0448bdc>] (component_master_add_with_match+0xac/0x110)
[   16.928922]  r8:dd158c10 r7:c0aa9040 r6:bf1109c0 r5:00000000
r4:dd119240 r3:c0aa9084
[   16.937067] [<c0448b30>] (component_master_add_with_match) from
[<bf110498>] (tilcdc_pdev_probe+0x54/0x8c [tilcdc])
[   16.947988]  r8:bf111bd0 r7:bf111bd0 r6:fffffdfb r5:dd158c10
r4:dd158c00 r3:dd652000
[   16.956161] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
[<c044f6cc>] (platform_drv_probe+0x50/0xac)
[   16.965902]  r5:dd158c10 r4:ffffffed
[   16.969680] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
(driver_probe_device+0x1ac/0x3e8)
[   16.978967]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
[   16.984913] [<c044d498>] (driver_probe_device) from [<c044d91c>]
(__driver_attach+0x9c/0xa0)
[   16.993746]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
r5:bf111bd0 r4:dd158c10
[   17.002001] [<c044d880>] (__driver_attach) from [<c044b964>]
(bus_for_each_dev+0x5c/0x90)
[   17.010575]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
[   17.016525] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
(driver_attach+0x20/0x28)
[   17.024908]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
[   17.029786] [<c044cfa4>] (driver_attach) from [<c044cb98>]
(bus_add_driver+0xf0/0x210)
[   17.038057] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
(driver_register+0x80/0xfc)
[   17.046437]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
[   17.052424] [<c044e768>] (driver_register) from [<c044f554>]
(__platform_driver_register+0x50/0x64)
[   17.061894]  r5:c0a29bd8 r4:c0a29bd8
[   17.065660] [<c044f504>] (__platform_driver_register) from
[<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
[   17.075964] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
(do_one_initcall+0xb4/0x1f8)
[   17.085355] [<c0009774>] (do_one_initcall) from [<c070fad8>]
(do_init_module+0x64/0x1b4)
[   17.093829]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
r6:dd79d640 r5:c0ae03a8
[   17.102074]  r4:bf111dd0
[   17.104733] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
(load_module+0x19a8/0x22e8)
[   17.113115]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
[   17.117965] [<c00db614>] (load_module) from [<c00dda04>]
(SyS_init_module+0x108/0x18c)
[   17.126256]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
r6:00000000 r5:000af492
[   17.134498]  r4:0000c47a
[   17.137158] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
(ret_fast_syscall+0x0/0x4c)
[   17.145629]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
[   17.155286] tda998x 0-0070: Falling back to first CRTC
[   17.323479] tda998x 0-0070: found TDA19988
[   17.331525] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops
[tda998x])
[   17.338858] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   17.345777] [drm] No driver support for vblank timestamp query.
[   17.443556] tilcdc 4830e000.lcdc: fb0:  frame buffer device
[   17.449541] tilcdc 4830e000.lcdc: registered panic notifier
[   17.455462] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
#


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x
  2015-05-07  9:44 ` [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Tomi Valkeinen
@ 2015-05-07 13:38   ` Jyri Sarha
  2015-05-08 11:17   ` Jyri Sarha
  1 sibling, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-05-07 13:38 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: dri-devel, airlied, linux-omap, devicetree, bcousson, tony,
	rmk+kernel, robdclark, moinejf

On 05/07/15 12:44, Tomi Valkeinen wrote:
>
> On 01/04/15 11:49, Jyri Sarha wrote:
>> Ok, let's do one more full review round. The mode filtering issue was
>> the main reason for this new patch series version. However, I found
>> couple other things to fix too after scrutinizing the patches once
>> more.
>>
>> Changes since v3 version of the patch-set:
>> * drm/tilcdc: Add support for external tda998x encoder
>>   - Hijack external connectors helper functions
>>   - Remove select of nonexistent DRM_TILCDC_INIT in tilcdc Kconfig
>>   - Correct author mail address to tilcdc_exteral.h
>> * drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding
>>   - Add a header file for tilcdc_slave_compat.dtb symbol declarations
>>
>> Changes since v2 version of the patch-set:
>> - use obj-y in Makefle for tilcdc subdir in:
>>    "drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT"
>> - move to last:
>>    "drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint"
>>
>> Changes since first version of the patch-set:
>> - Rename DRM_TILCDC_INIT to DRM_TILCDC_SLAVE_COMPAT and make it visible
>> - Add separate:
>>    drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint
>> - Reduce info-level spam
>> - Use component_master_add_with_match()
>> - Be more explicit about tda998x being the only supported external encoder
>>
>> Remove tilcdc slave support and connect to tda998x trough its
>> component DRM API. For dtb backward compatibility the code creates at
>> boot time a DT overlay based on the earlier binding. The overlay
>> conforms to the new graph based binding.
>>
>> The "drm/tilcdc: Decrement refcount of ep-node from
>> of_graph_get_next_endpoint" should probably not be merged. The "of:
>> Decrement refcount of previous endpoint in of_graph_get_next_endpoint"
>> is eventually going to be merged and before that leaking of two
>> of-node refcount increments each time the module is loaded is not that
>> serious. The of-nodes live forever anyway.
>>
>> The merge of the dts patch can be delayed until the next merger
>> window, when the other patches are already in. The
>> DRM_TILCDC_SLAVE_COMPAT should keep the bbb HDMI operational until
>> then.
>
> I made a quick test on v4.1-rc2, and:
>

What did you do to get this dump. The tilcdc driver has not done much at 
this point. There is basically noting before calling this function:

int tilcdc_get_external_components(struct device *dev,
				   struct component_match **match)
{
	struct device_node *ep = NULL;
	int count = 0;

	while ((ep = of_graph_get_next_endpoint(dev->of_node, ep))) {
		struct device_node *node;

		node = of_graph_get_remote_port_parent(ep);
		if (!node && !of_device_is_available(node)) {
			of_node_put(node);
			continue;
		}

		dev_dbg(dev, "Subdevice node '%s' found\n", node->name);
		if (match)
			component_match_add(dev, match, dev_match_of, node);
		of_node_put(node);
		count++;
	}

	if (count > 1) {
		dev_err(dev, "Only one external encoder is supported\n");
		return -EINVAL;
	}

	return count;
}

If there is something wrong with the function I would certainly like to 
know what. Or is the bug somewhere else?

Best regards,
Jyri

> [   15.199584] [drm] Initialized drm 1.1.0 20060810
> [   15.319496] BUG: sleeping function called from invalid context at
> kernel/locking/mutex.c:616
> [   15.328339] in_atomic(): 1, irqs_disabled(): 128, pid: 130, name: insmod
> [   15.335336] 3 locks held by insmod/130:
> [   15.339339]  #0:  (&dev->mutex){......}, at: [<c044d8d0>]
> __driver_attach+0x50/0xa0
> [   15.347389]  #1:  (&dev->mutex){......}, at: [<c044d8e0>]
> __driver_attach+0x60/0xa0
> [   15.355420]  #2:  (devtree_lock){......}, at: [<c05e2888>]
> of_get_next_child+0x20/0x4c
> [   15.363731] irq event stamp: 5750
> [   15.367189] hardirqs last  enabled at (5749): [<c0719f14>]
> _raw_spin_unlock_irqrestore+0x38/0x64
> [   15.376377] hardirqs last disabled at (5750): [<c0719730>]
> _raw_spin_lock_irqsave+0x24/0x6c
> [   15.385104] softirqs last  enabled at (5200): [<c004b7c8>]
> __do_softirq+0x318/0x710
> [   15.393111] softirqs last disabled at (5147): [<c004bf1c>]
> irq_exit+0xc4/0x138
> [   15.400668] CPU: 0 PID: 130 Comm: insmod Not tainted
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   15.409477] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   15.415837] Backtrace:
> [   15.418403] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   15.426306]  r6:c08d04b0 r5:dd652000 r4:00000000 r3:00000000
> [   15.432257] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   15.439810] [<c0711ab0>] (dump_stack) from [<c0070768>]
> (___might_sleep+0x18c/0x294)
> [   15.447893]  r5:00000268 r4:00000000
> [   15.451643] [<c00705dc>] (___might_sleep) from [<c00708d4>]
> (__might_sleep+0x64/0xa4)
> [   15.459816]  r7:dd119280 r6:00000000 r5:00000268 r4:c08d04b0
> [   15.465759] [<c0070870>] (__might_sleep) from [<c0715934>]
> (mutex_lock_nested+0x2c/0x430)
> [   15.474295]  r7:dd119280 r6:c0ae7c40 r5:c0203d0c r4:00000000
> [   15.480239] [<c0715908>] (mutex_lock_nested) from [<c0203d0c>]
> (kernfs_remove+0x20/0x38)
> [   15.488684]  r10:bf111da0 r9:bf111dd0 r8:dfa3a044 r7:dd119280
> r6:c0ae7c40 r5:dd11a510
> [   15.496897]  r4:c0a7a7e8
> [   15.499552] [<c0203cec>] (kernfs_remove) from [<c0205ed0>]
> (sysfs_remove_dir+0x4c/0x84)
> [   15.507907]  r5:dfa3a044 r4:dd11a510
> [   15.511658] [<c0205e84>] (sysfs_remove_dir) from [<c03b0514>]
> (kobject_del+0x1c/0x4c)
> [   15.519831]  r5:dd11a510 r4:dfa3a044
> [   15.523580] [<c03b04f8>] (kobject_del) from [<c03b05b4>]
> (kobject_release+0x70/0x1b8)
> [   15.531753]  r5:c0ac320c r4:dfa3a060
> [   15.535502] [<c03b0544>] (kobject_release) from [<c03b0754>]
> (kobject_put+0x58/0x88)
> [   15.543585]  r8:dd653cac r7:dfa3a018 r6:a00c0013 r5:dfa3a018 r4:dfa3a044
> [   15.550627] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
> (of_node_put+0x1c/0x20)
> [   15.558347]  r4:00000000
> [   15.561000] [<c05e5ce4>] (of_node_put) from [<c05e2850>]
> (__of_get_next_child+0x50/0x68)
> [   15.569451] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
> (of_get_next_child+0x30/0x4c)
> [   15.578440]  r5:dfa39f60 r4:c0ac31ec
> [   15.582190] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
> (of_graph_get_next_endpoint+0x54/0x138)
> [   15.591905]  r7:dd158c10 r6:dfa39d2c r5:dfa3a018 r4:dfa39f60
> [   15.597877] [<c05e2a68>] (of_graph_get_next_endpoint) from
> [<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
> [   15.609497]  r7:dd158c10 r6:00000001 r5:dfa3a018 r4:dfa3270c
> [   15.615459] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf11047c>] (tilcdc_pdev_probe+0x38/0x8c [tilcdc])
> [   15.627078]  r10:0000000a r8:bf111bd0 r7:bf111bd0 r6:fffffdfb
> r5:dd158c10 r4:dd158c00
> [   15.635309] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   15.645024]  r5:dd158c10 r4:ffffffed
> [   15.648773] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   15.658035]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   15.663976] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   15.672784]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   15.681012] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   15.689548]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   15.695493] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   15.703848]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   15.708695] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   15.716965] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   15.725319]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   15.731261] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   15.740703]  r5:c0a29bd8 r4:c0a29bd8
> [   15.744462] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   15.754738] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   15.764096] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   15.772542]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   15.780754]  r4:bf111dd0
> [   15.783414] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   15.791768]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   15.796614] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   15.804878]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   15.813091]  r4:0000c47a
> [   15.815750] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   15.824195]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   15.831943] ERROR: Bad of_node_put() on
> /ocp/lcdc@4830e000/port/endpoint@0
> [   15.839139] CPU: 0 PID: 130 Comm: insmod Not tainted
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   15.847948] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   15.854308] Backtrace:
> [   15.856878] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   15.864780]  r6:dfa3a044 r5:dd652000 r4:00000000 r3:00000000
> [   15.870726] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   15.878276] [<c0711ab0>] (dump_stack) from [<c05e647c>]
> (of_node_release+0x94/0x9c)
> [   15.886268]  r5:c0ac320c r4:dfa3a094
> [   15.890019] [<c05e63e8>] (of_node_release) from [<c03b05dc>]
> (kobject_release+0x98/0x1b8)
> [   15.898554]  r6:c0ae7c40 r5:c0ac320c r4:dfa3a060 r3:c05e63e8
> [   15.904496] [<c03b0544>] (kobject_release) from [<c03b0754>]
> (kobject_put+0x58/0x88)
> [   15.912578]  r8:dd653cac r7:dfa3a018 r6:a00c0013 r5:dfa3a018 r4:dfa3a044
> [   15.919616] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
> (of_node_put+0x1c/0x20)
> [   15.927335]  r4:00000000
> [   15.929990] [<c05e5ce4>] (of_node_put) from [<c05e2850>]
> (__of_get_next_child+0x50/0x68)
> [   15.938440] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
> (of_get_next_child+0x30/0x4c)
> [   15.947429]  r5:dfa39f60 r4:c0ac31ec
> [   15.951179] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
> (of_graph_get_next_endpoint+0x54/0x138)
> [   15.960894]  r7:dd158c10 r6:dfa39d2c r5:dfa3a018 r4:dfa39f60
> [   15.966859] [<c05e2a68>] (of_graph_get_next_endpoint) from
> [<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
> [   15.978479]  r7:dd158c10 r6:00000001 r5:dfa3a018 r4:dfa3270c
> [   15.984439] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf11047c>] (tilcdc_pdev_probe+0x38/0x8c [tilcdc])
> [   15.996058]  r10:0000000a r8:bf111bd0 r7:bf111bd0 r6:fffffdfb
> r5:dd158c10 r4:dd158c00
> [   16.004290] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   16.014005]  r5:dd158c10 r4:ffffffed
> [   16.017755] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   16.027016]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   16.032957] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   16.041764]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   16.049987] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   16.058524]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   16.064467] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   16.072822]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   16.077670] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   16.085939] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   16.094294]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   16.100235] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   16.109678]  r5:c0a29bd8 r4:c0a29bd8
> [   16.113437] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   16.123710] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   16.133068] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   16.141513]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   16.149726]  r4:bf111dd0
> [   16.152382] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   16.160737]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   16.165582] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   16.173846]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   16.182059]  r4:0000c47a
> [   16.184715] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   16.193161]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   16.239460] ------------[ cut here ]------------
> [   16.244338] WARNING: CPU: 0 PID: 130 at include/linux/kref.h:47
> kobject_get+0x98/0xb8()
> [   16.252705] Modules linked in: tilcdc(+) tda998x drm_kms_helper drm
> [   16.259309] CPU: 0 PID: 130 Comm: insmod Not tainted
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   16.268129] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   16.274498] Backtrace:
> [   16.277070] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   16.284972]  r6:0000002f r5:dd652000 r4:00000000 r3:00000000
> [   16.290926] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   16.298474] [<c0711ab0>] (dump_stack) from [<c0046a54>]
> (warn_slowpath_common+0x84/0xc0)
> [   16.306919]  r5:c03b0a34 r4:00000000
> [   16.310668] [<c00469d0>] (warn_slowpath_common) from [<c0046ab4>]
> (warn_slowpath_null+0x24/0x2c)
> [   16.319839]  r8:00000000 r7:00000000 r6:a0010013 r5:c0adfa5d r4:dfa3a044
> [   16.326876] [<c0046a90>] (warn_slowpath_null) from [<c03b0a34>]
> (kobject_get+0x98/0xb8)
> [   16.335245] [<c03b099c>] (kobject_get) from [<c05e5d20>]
> (of_node_get+0x1c/0x24)
> [   16.342964]  r5:00000000 r4:dfa3a018
> [   16.346715] [<c05e5d04>] (of_node_get) from [<c05e2830>]
> (__of_get_next_child+0x30/0x68)
> [   16.355160]  r4:dfa3a018 r3:dd5b8640
> [   16.358909] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
> (of_get_next_child+0x30/0x4c)
> [   16.367898]  r5:dfa39f60 r4:c0ac31ec
> [   16.371648] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
> (of_graph_get_next_endpoint+0x54/0x138)
> [   16.381363]  r7:00000000 r6:dfa39d2c r5:00000000 r4:dfa39f60
> [   16.387343] [<c05e2a68>] (of_graph_get_next_endpoint) from
> [<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
> [   16.398963]  r7:dd158c10 r6:00000000 r5:00000000 r4:dd507000
> [   16.404925] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf10fd84>] (tilcdc_load+0x50/0x648 [tilcdc])
> [   16.416091]  r10:0000000a r8:dd158c00 r7:00000000 r6:dfa39d2c
> r5:dd677f00 r4:dd507000
> [   16.424542] [<bf10fd34>] (tilcdc_load [tilcdc]) from [<bf074060>]
> (drm_dev_register+0xac/0x10c [drm])
> [   16.434171]  r10:0000000a r9:bf111dd0 r8:00000000 r7:dd119290
> r6:00000000 r5:00000000
> [   16.442384]  r4:dd507000
> [   16.445187] [<bf073fb4>] (drm_dev_register [drm]) from [<bf075b4c>]
> (drm_platform_init+0x48/0xd8 [drm])
> [   16.454993]  r6:bf111a8c r5:dd507000 r4:dd158c00 r3:00000000
> [   16.461011] [<bf075b04>] (drm_platform_init [drm]) from [<bf10fa3c>]
> (tilcdc_bind+0x18/0x20 [tilcdc])
> [   16.470636]  r6:dd119240 r5:00000001 r4:dd119298
> [   16.475499] [<bf10fa24>] (tilcdc_bind [tilcdc]) from [<c0448af4>]
> (try_to_bring_up_master.part.1+0xd0/0x10c)
> [   16.485766] [<c0448a24>] (try_to_bring_up_master.part.1) from
> [<c0448bdc>] (component_master_add_with_match+0xac/0x110)
> [   16.497022]  r8:dd158c10 r7:c0aa9040 r6:bf1109c0 r5:00000000
> r4:dd119240 r3:c0aa9084
> [   16.505160] [<c0448b30>] (component_master_add_with_match) from
> [<bf110498>] (tilcdc_pdev_probe+0x54/0x8c [tilcdc])
> [   16.516054]  r8:bf111bd0 r7:bf111bd0 r6:fffffdfb r5:dd158c10
> r4:dd158c00 r3:dd652000
> [   16.524195] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   16.533910]  r5:dd158c10 r4:ffffffed
> [   16.537659] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   16.546921]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   16.552862] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   16.561670]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   16.569893] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   16.578428]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   16.584374] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   16.592728]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   16.597575] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   16.605845] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   16.614199]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   16.620141] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   16.629584]  r5:c0a29bd8 r4:c0a29bd8
> [   16.633343] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   16.643618] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   16.652978] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   16.661424]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   16.669636]  r4:bf111dd0
> [   16.672295] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   16.680650]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   16.685496] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   16.693760]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   16.701973]  r4:0000c47a
> [   16.704631] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   16.713077]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   16.720111] ---[ end trace 74558956458632df ]---
> [   16.726493] ERROR: Bad of_node_put() on
> /ocp/lcdc@4830e000/port/endpoint@0
> [   16.733799] CPU: 0 PID: 130 Comm: insmod Tainted: G        W
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   16.743914] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   16.750305] Backtrace:
> [   16.752884] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   16.760815]  r6:dfa3a044 r5:dd652000 r4:00000000 r3:00000000
> [   16.766771] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   16.774354] [<c0711ab0>] (dump_stack) from [<c05e647c>]
> (of_node_release+0x94/0x9c)
> [   16.782376]  r5:c0ac320c r4:dfa3a094
> [   16.786130] [<c05e63e8>] (of_node_release) from [<c03b05dc>]
> (kobject_release+0x98/0x1b8)
> [   16.794693]  r6:c0ae7c40 r5:c0ac320c r4:dfa3a060 r3:c05e63e8
> [   16.800666] [<c03b0544>] (kobject_release) from [<c03b0754>]
> (kobject_put+0x58/0x88)
> [   16.808775]  r8:00000000 r7:dd158c10 r6:00000000 r5:dfa3a018 r4:dfa3a044
> [   16.815818] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
> (of_node_put+0x1c/0x20)
> [   16.823564]  r4:dfa3270c
> [   16.826251] [<c05e5ce4>] (of_node_put) from [<bf10f5f4>]
> (tilcdc_get_external_components+0x34/0xe8 [tilcdc])
> [   16.836568] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf10fd84>] (tilcdc_load+0x50/0x648 [tilcdc])
> [   16.847762]  r10:0000000a r8:dd158c00 r7:00000000 r6:dfa39d2c
> r5:dd677f00 r4:dd507000
> [   16.856196] [<bf10fd34>] (tilcdc_load [tilcdc]) from [<bf074060>]
> (drm_dev_register+0xac/0x10c [drm])
> [   16.865870]  r10:0000000a r9:bf111dd0 r8:00000000 r7:dd119290
> r6:00000000 r5:00000000
> [   16.874117]  r4:dd507000
> [   16.876911] [<bf073fb4>] (drm_dev_register [drm]) from [<bf075b4c>]
> (drm_platform_init+0x48/0xd8 [drm])
> [   16.886757]  r6:bf111a8c r5:dd507000 r4:dd158c00 r3:00000000
> [   16.892812] [<bf075b04>] (drm_platform_init [drm]) from [<bf10fa3c>]
> (tilcdc_bind+0x18/0x20 [tilcdc])
> [   16.902468]  r6:dd119240 r5:00000001 r4:dd119298
> [   16.907338] [<bf10fa24>] (tilcdc_bind [tilcdc]) from [<c0448af4>]
> (try_to_bring_up_master.part.1+0xd0/0x10c)
> [   16.917636] [<c0448a24>] (try_to_bring_up_master.part.1) from
> [<c0448bdc>] (component_master_add_with_match+0xac/0x110)
> [   16.928922]  r8:dd158c10 r7:c0aa9040 r6:bf1109c0 r5:00000000
> r4:dd119240 r3:c0aa9084
> [   16.937067] [<c0448b30>] (component_master_add_with_match) from
> [<bf110498>] (tilcdc_pdev_probe+0x54/0x8c [tilcdc])
> [   16.947988]  r8:bf111bd0 r7:bf111bd0 r6:fffffdfb r5:dd158c10
> r4:dd158c00 r3:dd652000
> [   16.956161] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   16.965902]  r5:dd158c10 r4:ffffffed
> [   16.969680] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   16.978967]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   16.984913] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   16.993746]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   17.002001] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   17.010575]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   17.016525] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   17.024908]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   17.029786] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   17.038057] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   17.046437]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   17.052424] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   17.061894]  r5:c0a29bd8 r4:c0a29bd8
> [   17.065660] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   17.075964] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   17.085355] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   17.093829]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   17.102074]  r4:bf111dd0
> [   17.104733] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   17.113115]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   17.117965] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   17.126256]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   17.134498]  r4:0000c47a
> [   17.137158] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   17.145629]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   17.155286] tda998x 0-0070: Falling back to first CRTC
> [   17.323479] tda998x 0-0070: found TDA19988
> [   17.331525] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops
> [tda998x])
> [   17.338858] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> [   17.345777] [drm] No driver support for vblank timestamp query.
> [   17.443556] tilcdc 4830e000.lcdc: fb0:  frame buffer device
> [   17.449541] tilcdc 4830e000.lcdc: registered panic notifier
> [   17.455462] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
> #
>


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

* Re: [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x
  2015-05-07  9:44 ` [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Tomi Valkeinen
  2015-05-07 13:38   ` Jyri Sarha
@ 2015-05-08 11:17   ` Jyri Sarha
  1 sibling, 0 replies; 13+ messages in thread
From: Jyri Sarha @ 2015-05-08 11:17 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: dri-devel, airlied, linux-omap, devicetree, bcousson, tony,
	rmk+kernel, robdclark, moinejf

On 05/07/15 12:44, Tomi Valkeinen wrote:
>
> On 01/04/15 11:49, Jyri Sarha wrote:
>> Ok, let's do one more full review round. The mode filtering issue was
>> the main reason for this new patch series version. However, I found
>> couple other things to fix too after scrutinizing the patches once
>> more.
>>
>> Changes since v3 version of the patch-set:
>> * drm/tilcdc: Add support for external tda998x encoder
>>   - Hijack external connectors helper functions
>>   - Remove select of nonexistent DRM_TILCDC_INIT in tilcdc Kconfig
>>   - Correct author mail address to tilcdc_exteral.h
>> * drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding
>>   - Add a header file for tilcdc_slave_compat.dtb symbol declarations
>>
>> Changes since v2 version of the patch-set:
>> - use obj-y in Makefle for tilcdc subdir in:
>>    "drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT"
>> - move to last:
>>    "drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint"
>>
>> Changes since first version of the patch-set:
>> - Rename DRM_TILCDC_INIT to DRM_TILCDC_SLAVE_COMPAT and make it visible
>> - Add separate:
>>    drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint
>> - Reduce info-level spam
>> - Use component_master_add_with_match()
>> - Be more explicit about tda998x being the only supported external encoder
>>
>> Remove tilcdc slave support and connect to tda998x trough its
>> component DRM API. For dtb backward compatibility the code creates at
>> boot time a DT overlay based on the earlier binding. The overlay
>> conforms to the new graph based binding.
>>
>> The "drm/tilcdc: Decrement refcount of ep-node from
>> of_graph_get_next_endpoint" should probably not be merged. The "of:
>> Decrement refcount of previous endpoint in of_graph_get_next_endpoint"
>> is eventually going to be merged and before that leaking of two
>> of-node refcount increments each time the module is loaded is not that
>> serious. The of-nodes live forever anyway.
>>
>> The merge of the dts patch can be delayed until the next merger
>> window, when the other patches are already in. The
>> DRM_TILCDC_SLAVE_COMPAT should keep the bbb HDMI operational until
>> then.
>
> I made a quick test on v4.1-rc2, and:
>

According to my tests the dump comes from having "drm/tilcdc: Decrement 
refcount of ep-node from of_graph_get_next_endpoint" still in the patch set.

That should not be there anymore. I'll mail a new patch set shortly with 
some additional fixes and comments.

Best regards,
Jyri

> [   15.199584] [drm] Initialized drm 1.1.0 20060810
> [   15.319496] BUG: sleeping function called from invalid context at
> kernel/locking/mutex.c:616
> [   15.328339] in_atomic(): 1, irqs_disabled(): 128, pid: 130, name: insmod
> [   15.335336] 3 locks held by insmod/130:
> [   15.339339]  #0:  (&dev->mutex){......}, at: [<c044d8d0>]
> __driver_attach+0x50/0xa0
> [   15.347389]  #1:  (&dev->mutex){......}, at: [<c044d8e0>]
> __driver_attach+0x60/0xa0
> [   15.355420]  #2:  (devtree_lock){......}, at: [<c05e2888>]
> of_get_next_child+0x20/0x4c
> [   15.363731] irq event stamp: 5750
> [   15.367189] hardirqs last  enabled at (5749): [<c0719f14>]
> _raw_spin_unlock_irqrestore+0x38/0x64
> [   15.376377] hardirqs last disabled at (5750): [<c0719730>]
> _raw_spin_lock_irqsave+0x24/0x6c
> [   15.385104] softirqs last  enabled at (5200): [<c004b7c8>]
> __do_softirq+0x318/0x710
> [   15.393111] softirqs last disabled at (5147): [<c004bf1c>]
> irq_exit+0xc4/0x138
> [   15.400668] CPU: 0 PID: 130 Comm: insmod Not tainted
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   15.409477] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   15.415837] Backtrace:
> [   15.418403] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   15.426306]  r6:c08d04b0 r5:dd652000 r4:00000000 r3:00000000
> [   15.432257] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   15.439810] [<c0711ab0>] (dump_stack) from [<c0070768>]
> (___might_sleep+0x18c/0x294)
> [   15.447893]  r5:00000268 r4:00000000
> [   15.451643] [<c00705dc>] (___might_sleep) from [<c00708d4>]
> (__might_sleep+0x64/0xa4)
> [   15.459816]  r7:dd119280 r6:00000000 r5:00000268 r4:c08d04b0
> [   15.465759] [<c0070870>] (__might_sleep) from [<c0715934>]
> (mutex_lock_nested+0x2c/0x430)
> [   15.474295]  r7:dd119280 r6:c0ae7c40 r5:c0203d0c r4:00000000
> [   15.480239] [<c0715908>] (mutex_lock_nested) from [<c0203d0c>]
> (kernfs_remove+0x20/0x38)
> [   15.488684]  r10:bf111da0 r9:bf111dd0 r8:dfa3a044 r7:dd119280
> r6:c0ae7c40 r5:dd11a510
> [   15.496897]  r4:c0a7a7e8
> [   15.499552] [<c0203cec>] (kernfs_remove) from [<c0205ed0>]
> (sysfs_remove_dir+0x4c/0x84)
> [   15.507907]  r5:dfa3a044 r4:dd11a510
> [   15.511658] [<c0205e84>] (sysfs_remove_dir) from [<c03b0514>]
> (kobject_del+0x1c/0x4c)
> [   15.519831]  r5:dd11a510 r4:dfa3a044
> [   15.523580] [<c03b04f8>] (kobject_del) from [<c03b05b4>]
> (kobject_release+0x70/0x1b8)
> [   15.531753]  r5:c0ac320c r4:dfa3a060
> [   15.535502] [<c03b0544>] (kobject_release) from [<c03b0754>]
> (kobject_put+0x58/0x88)
> [   15.543585]  r8:dd653cac r7:dfa3a018 r6:a00c0013 r5:dfa3a018 r4:dfa3a044
> [   15.550627] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
> (of_node_put+0x1c/0x20)
> [   15.558347]  r4:00000000
> [   15.561000] [<c05e5ce4>] (of_node_put) from [<c05e2850>]
> (__of_get_next_child+0x50/0x68)
> [   15.569451] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
> (of_get_next_child+0x30/0x4c)
> [   15.578440]  r5:dfa39f60 r4:c0ac31ec
> [   15.582190] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
> (of_graph_get_next_endpoint+0x54/0x138)
> [   15.591905]  r7:dd158c10 r6:dfa39d2c r5:dfa3a018 r4:dfa39f60
> [   15.597877] [<c05e2a68>] (of_graph_get_next_endpoint) from
> [<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
> [   15.609497]  r7:dd158c10 r6:00000001 r5:dfa3a018 r4:dfa3270c
> [   15.615459] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf11047c>] (tilcdc_pdev_probe+0x38/0x8c [tilcdc])
> [   15.627078]  r10:0000000a r8:bf111bd0 r7:bf111bd0 r6:fffffdfb
> r5:dd158c10 r4:dd158c00
> [   15.635309] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   15.645024]  r5:dd158c10 r4:ffffffed
> [   15.648773] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   15.658035]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   15.663976] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   15.672784]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   15.681012] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   15.689548]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   15.695493] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   15.703848]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   15.708695] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   15.716965] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   15.725319]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   15.731261] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   15.740703]  r5:c0a29bd8 r4:c0a29bd8
> [   15.744462] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   15.754738] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   15.764096] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   15.772542]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   15.780754]  r4:bf111dd0
> [   15.783414] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   15.791768]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   15.796614] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   15.804878]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   15.813091]  r4:0000c47a
> [   15.815750] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   15.824195]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   15.831943] ERROR: Bad of_node_put() on
> /ocp/lcdc@4830e000/port/endpoint@0
> [   15.839139] CPU: 0 PID: 130 Comm: insmod Not tainted
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   15.847948] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   15.854308] Backtrace:
> [   15.856878] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   15.864780]  r6:dfa3a044 r5:dd652000 r4:00000000 r3:00000000
> [   15.870726] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   15.878276] [<c0711ab0>] (dump_stack) from [<c05e647c>]
> (of_node_release+0x94/0x9c)
> [   15.886268]  r5:c0ac320c r4:dfa3a094
> [   15.890019] [<c05e63e8>] (of_node_release) from [<c03b05dc>]
> (kobject_release+0x98/0x1b8)
> [   15.898554]  r6:c0ae7c40 r5:c0ac320c r4:dfa3a060 r3:c05e63e8
> [   15.904496] [<c03b0544>] (kobject_release) from [<c03b0754>]
> (kobject_put+0x58/0x88)
> [   15.912578]  r8:dd653cac r7:dfa3a018 r6:a00c0013 r5:dfa3a018 r4:dfa3a044
> [   15.919616] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
> (of_node_put+0x1c/0x20)
> [   15.927335]  r4:00000000
> [   15.929990] [<c05e5ce4>] (of_node_put) from [<c05e2850>]
> (__of_get_next_child+0x50/0x68)
> [   15.938440] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
> (of_get_next_child+0x30/0x4c)
> [   15.947429]  r5:dfa39f60 r4:c0ac31ec
> [   15.951179] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
> (of_graph_get_next_endpoint+0x54/0x138)
> [   15.960894]  r7:dd158c10 r6:dfa39d2c r5:dfa3a018 r4:dfa39f60
> [   15.966859] [<c05e2a68>] (of_graph_get_next_endpoint) from
> [<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
> [   15.978479]  r7:dd158c10 r6:00000001 r5:dfa3a018 r4:dfa3270c
> [   15.984439] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf11047c>] (tilcdc_pdev_probe+0x38/0x8c [tilcdc])
> [   15.996058]  r10:0000000a r8:bf111bd0 r7:bf111bd0 r6:fffffdfb
> r5:dd158c10 r4:dd158c00
> [   16.004290] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   16.014005]  r5:dd158c10 r4:ffffffed
> [   16.017755] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   16.027016]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   16.032957] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   16.041764]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   16.049987] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   16.058524]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   16.064467] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   16.072822]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   16.077670] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   16.085939] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   16.094294]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   16.100235] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   16.109678]  r5:c0a29bd8 r4:c0a29bd8
> [   16.113437] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   16.123710] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   16.133068] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   16.141513]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   16.149726]  r4:bf111dd0
> [   16.152382] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   16.160737]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   16.165582] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   16.173846]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   16.182059]  r4:0000c47a
> [   16.184715] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   16.193161]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   16.239460] ------------[ cut here ]------------
> [   16.244338] WARNING: CPU: 0 PID: 130 at include/linux/kref.h:47
> kobject_get+0x98/0xb8()
> [   16.252705] Modules linked in: tilcdc(+) tda998x drm_kms_helper drm
> [   16.259309] CPU: 0 PID: 130 Comm: insmod Not tainted
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   16.268129] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   16.274498] Backtrace:
> [   16.277070] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   16.284972]  r6:0000002f r5:dd652000 r4:00000000 r3:00000000
> [   16.290926] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   16.298474] [<c0711ab0>] (dump_stack) from [<c0046a54>]
> (warn_slowpath_common+0x84/0xc0)
> [   16.306919]  r5:c03b0a34 r4:00000000
> [   16.310668] [<c00469d0>] (warn_slowpath_common) from [<c0046ab4>]
> (warn_slowpath_null+0x24/0x2c)
> [   16.319839]  r8:00000000 r7:00000000 r6:a0010013 r5:c0adfa5d r4:dfa3a044
> [   16.326876] [<c0046a90>] (warn_slowpath_null) from [<c03b0a34>]
> (kobject_get+0x98/0xb8)
> [   16.335245] [<c03b099c>] (kobject_get) from [<c05e5d20>]
> (of_node_get+0x1c/0x24)
> [   16.342964]  r5:00000000 r4:dfa3a018
> [   16.346715] [<c05e5d04>] (of_node_get) from [<c05e2830>]
> (__of_get_next_child+0x30/0x68)
> [   16.355160]  r4:dfa3a018 r3:dd5b8640
> [   16.358909] [<c05e2800>] (__of_get_next_child) from [<c05e2898>]
> (of_get_next_child+0x30/0x4c)
> [   16.367898]  r5:dfa39f60 r4:c0ac31ec
> [   16.371648] [<c05e2868>] (of_get_next_child) from [<c05e2abc>]
> (of_graph_get_next_endpoint+0x54/0x138)
> [   16.381363]  r7:00000000 r6:dfa39d2c r5:00000000 r4:dfa39f60
> [   16.387343] [<c05e2a68>] (of_graph_get_next_endpoint) from
> [<bf10f63c>] (tilcdc_get_external_components+0x7c/0xe8 [tilcdc])
> [   16.398963]  r7:dd158c10 r6:00000000 r5:00000000 r4:dd507000
> [   16.404925] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf10fd84>] (tilcdc_load+0x50/0x648 [tilcdc])
> [   16.416091]  r10:0000000a r8:dd158c00 r7:00000000 r6:dfa39d2c
> r5:dd677f00 r4:dd507000
> [   16.424542] [<bf10fd34>] (tilcdc_load [tilcdc]) from [<bf074060>]
> (drm_dev_register+0xac/0x10c [drm])
> [   16.434171]  r10:0000000a r9:bf111dd0 r8:00000000 r7:dd119290
> r6:00000000 r5:00000000
> [   16.442384]  r4:dd507000
> [   16.445187] [<bf073fb4>] (drm_dev_register [drm]) from [<bf075b4c>]
> (drm_platform_init+0x48/0xd8 [drm])
> [   16.454993]  r6:bf111a8c r5:dd507000 r4:dd158c00 r3:00000000
> [   16.461011] [<bf075b04>] (drm_platform_init [drm]) from [<bf10fa3c>]
> (tilcdc_bind+0x18/0x20 [tilcdc])
> [   16.470636]  r6:dd119240 r5:00000001 r4:dd119298
> [   16.475499] [<bf10fa24>] (tilcdc_bind [tilcdc]) from [<c0448af4>]
> (try_to_bring_up_master.part.1+0xd0/0x10c)
> [   16.485766] [<c0448a24>] (try_to_bring_up_master.part.1) from
> [<c0448bdc>] (component_master_add_with_match+0xac/0x110)
> [   16.497022]  r8:dd158c10 r7:c0aa9040 r6:bf1109c0 r5:00000000
> r4:dd119240 r3:c0aa9084
> [   16.505160] [<c0448b30>] (component_master_add_with_match) from
> [<bf110498>] (tilcdc_pdev_probe+0x54/0x8c [tilcdc])
> [   16.516054]  r8:bf111bd0 r7:bf111bd0 r6:fffffdfb r5:dd158c10
> r4:dd158c00 r3:dd652000
> [   16.524195] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   16.533910]  r5:dd158c10 r4:ffffffed
> [   16.537659] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   16.546921]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   16.552862] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   16.561670]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   16.569893] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   16.578428]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   16.584374] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   16.592728]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   16.597575] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   16.605845] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   16.614199]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   16.620141] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   16.629584]  r5:c0a29bd8 r4:c0a29bd8
> [   16.633343] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   16.643618] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   16.652978] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   16.661424]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   16.669636]  r4:bf111dd0
> [   16.672295] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   16.680650]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   16.685496] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   16.693760]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   16.701973]  r4:0000c47a
> [   16.704631] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   16.713077]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   16.720111] ---[ end trace 74558956458632df ]---
> [   16.726493] ERROR: Bad of_node_put() on
> /ocp/lcdc@4830e000/port/endpoint@0
> [   16.733799] CPU: 0 PID: 130 Comm: insmod Tainted: G        W
> 4.1.0-rc2-00007-g877542591d33-dirty #22
> [   16.743914] Hardware name: Generic AM33XX (Flattened Device Tree)
> [   16.750305] Backtrace:
> [   16.752884] [<c00140a8>] (dump_backtrace) from [<c0014244>]
> (show_stack+0x18/0x1c)
> [   16.760815]  r6:dfa3a044 r5:dd652000 r4:00000000 r3:00000000
> [   16.766771] [<c001422c>] (show_stack) from [<c0711b44>]
> (dump_stack+0x94/0xc8)
> [   16.774354] [<c0711ab0>] (dump_stack) from [<c05e647c>]
> (of_node_release+0x94/0x9c)
> [   16.782376]  r5:c0ac320c r4:dfa3a094
> [   16.786130] [<c05e63e8>] (of_node_release) from [<c03b05dc>]
> (kobject_release+0x98/0x1b8)
> [   16.794693]  r6:c0ae7c40 r5:c0ac320c r4:dfa3a060 r3:c05e63e8
> [   16.800666] [<c03b0544>] (kobject_release) from [<c03b0754>]
> (kobject_put+0x58/0x88)
> [   16.808775]  r8:00000000 r7:dd158c10 r6:00000000 r5:dfa3a018 r4:dfa3a044
> [   16.815818] [<c03b06fc>] (kobject_put) from [<c05e5d00>]
> (of_node_put+0x1c/0x20)
> [   16.823564]  r4:dfa3270c
> [   16.826251] [<c05e5ce4>] (of_node_put) from [<bf10f5f4>]
> (tilcdc_get_external_components+0x34/0xe8 [tilcdc])
> [   16.836568] [<bf10f5c0>] (tilcdc_get_external_components [tilcdc])
> from [<bf10fd84>] (tilcdc_load+0x50/0x648 [tilcdc])
> [   16.847762]  r10:0000000a r8:dd158c00 r7:00000000 r6:dfa39d2c
> r5:dd677f00 r4:dd507000
> [   16.856196] [<bf10fd34>] (tilcdc_load [tilcdc]) from [<bf074060>]
> (drm_dev_register+0xac/0x10c [drm])
> [   16.865870]  r10:0000000a r9:bf111dd0 r8:00000000 r7:dd119290
> r6:00000000 r5:00000000
> [   16.874117]  r4:dd507000
> [   16.876911] [<bf073fb4>] (drm_dev_register [drm]) from [<bf075b4c>]
> (drm_platform_init+0x48/0xd8 [drm])
> [   16.886757]  r6:bf111a8c r5:dd507000 r4:dd158c00 r3:00000000
> [   16.892812] [<bf075b04>] (drm_platform_init [drm]) from [<bf10fa3c>]
> (tilcdc_bind+0x18/0x20 [tilcdc])
> [   16.902468]  r6:dd119240 r5:00000001 r4:dd119298
> [   16.907338] [<bf10fa24>] (tilcdc_bind [tilcdc]) from [<c0448af4>]
> (try_to_bring_up_master.part.1+0xd0/0x10c)
> [   16.917636] [<c0448a24>] (try_to_bring_up_master.part.1) from
> [<c0448bdc>] (component_master_add_with_match+0xac/0x110)
> [   16.928922]  r8:dd158c10 r7:c0aa9040 r6:bf1109c0 r5:00000000
> r4:dd119240 r3:c0aa9084
> [   16.937067] [<c0448b30>] (component_master_add_with_match) from
> [<bf110498>] (tilcdc_pdev_probe+0x54/0x8c [tilcdc])
> [   16.947988]  r8:bf111bd0 r7:bf111bd0 r6:fffffdfb r5:dd158c10
> r4:dd158c00 r3:dd652000
> [   16.956161] [<bf110444>] (tilcdc_pdev_probe [tilcdc]) from
> [<c044f6cc>] (platform_drv_probe+0x50/0xac)
> [   16.965902]  r5:dd158c10 r4:ffffffed
> [   16.969680] [<c044f67c>] (platform_drv_probe) from [<c044d644>]
> (driver_probe_device+0x1ac/0x3e8)
> [   16.978967]  r7:00000000 r6:c0ae8dc8 r5:dd158c10 r4:c12e735c
> [   16.984913] [<c044d498>] (driver_probe_device) from [<c044d91c>]
> (__driver_attach+0x9c/0xa0)
> [   16.993746]  r10:00000000 r8:bf115048 r7:00000000 r6:dd158c44
> r5:bf111bd0 r4:dd158c10
> [   17.002001] [<c044d880>] (__driver_attach) from [<c044b964>]
> (bus_for_each_dev+0x5c/0x90)
> [   17.010575]  r6:c044d880 r5:bf111bd0 r4:00000000 r3:dd13909c
> [   17.016525] [<c044b908>] (bus_for_each_dev) from [<c044cfc4>]
> (driver_attach+0x20/0x28)
> [   17.024908]  r6:c0aa9368 r5:dd5bebc0 r4:bf111bd0
> [   17.029786] [<c044cfa4>] (driver_attach) from [<c044cb98>]
> (bus_add_driver+0xf0/0x210)
> [   17.038057] [<c044caa8>] (bus_add_driver) from [<c044e7e8>]
> (driver_register+0x80/0xfc)
> [   17.046437]  r7:00000001 r6:dd79d6c0 r5:c0a29bd8 r4:bf111bd0
> [   17.052424] [<c044e768>] (driver_register) from [<c044f554>]
> (__platform_driver_register+0x50/0x64)
> [   17.061894]  r5:c0a29bd8 r4:c0a29bd8
> [   17.065660] [<c044f504>] (__platform_driver_register) from
> [<bf115084>] (tilcdc_drm_init+0x3c/0x54 [tilcdc])
> [   17.075964] [<bf115048>] (tilcdc_drm_init [tilcdc]) from [<c0009828>]
> (do_one_initcall+0xb4/0x1f8)
> [   17.085355] [<c0009774>] (do_one_initcall) from [<c070fad8>]
> (do_init_module+0x64/0x1b4)
> [   17.093829]  r10:bf111e18 r9:bf111dd0 r8:00000124 r7:00000001
> r6:dd79d640 r5:c0ae03a8
> [   17.102074]  r4:bf111dd0
> [   17.104733] [<c070fa74>] (do_init_module) from [<c00dcfbc>]
> (load_module+0x19a8/0x22e8)
> [   17.113115]  r6:dd5bfd40 r5:c0ae03a8 r4:c0adf52e
> [   17.117965] [<c00db614>] (load_module) from [<c00dda04>]
> (SyS_init_module+0x108/0x18c)
> [   17.126256]  r10:00000000 r9:dd652000 r8:000a3008 r7:e0b9547a
> r6:00000000 r5:000af492
> [   17.134498]  r4:0000c47a
> [   17.137158] [<c00dd8fc>] (SyS_init_module) from [<c0010580>]
> (ret_fast_syscall+0x0/0x4c)
> [   17.145629]  r8:c0010744 r7:00000080 r6:000001fa r5:bee24e8f r4:0000c47a
> [   17.155286] tda998x 0-0070: Falling back to first CRTC
> [   17.323479] tda998x 0-0070: found TDA19988
> [   17.331525] tilcdc 4830e000.lcdc: bound 0-0070 (ops tda998x_ops
> [tda998x])
> [   17.338858] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> [   17.345777] [drm] No driver support for vblank timestamp query.
> [   17.443556] tilcdc 4830e000.lcdc: fb0:  frame buffer device
> [   17.449541] tilcdc 4830e000.lcdc: registered panic notifier
> [   17.455462] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
> #
>


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

end of thread, other threads:[~2015-05-08 11:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01  8:49 [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Jyri Sarha
2015-04-01  8:49 ` [PATCH v4 1/7] drm/tilcdc: Fix module unloading Jyri Sarha
2015-04-01  8:49 ` [PATCH v4 3/7] drm/tilcdc: Add support for external tda998x encoder Jyri Sarha
     [not found]   ` <e22d703d6ee5fe02e8c34b78a63f98a4b2ea1f22.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-04-01 22:20     ` Russell King - ARM Linux
2015-04-15 15:04       ` Jyri Sarha
2015-04-01  8:49 ` [PATCH v4 5/7] drm/tilcdc: Force building of DRM_TILCDC_SLAVE_COMPAT Jyri Sarha
2015-04-01  8:49 ` [PATCH v4 6/7] ARM: dts: am335x-boneblack: Use new binding for HDMI Jyri Sarha
     [not found] ` <cover.1427877412.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-04-01  8:49   ` [PATCH v4 2/7] drm/tilcdc: Remove tilcdc slave support for tda998x driver Jyri Sarha
2015-04-01  8:49   ` [PATCH v4 4/7] drm/tilcdc: Add DRM_TILCDC_SLAVE_COMPAT for ti,tilcdc,slave binding support Jyri Sarha
2015-04-01  8:49   ` [PATCH v4 7/7] drm/tilcdc: Decrement refcount of ep-node from of_graph_get_next_endpoint Jyri Sarha
2015-05-07  9:44 ` [PATCH v4 0/7] Use DRM component API in tilcdc to connect to tda998x Tomi Valkeinen
2015-05-07 13:38   ` Jyri Sarha
2015-05-08 11:17   ` Jyri Sarha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.