[PATCH v2] ARM: OMAP2+: Make GPMC skip disabled devices

2014-07-02 Thread Guido Martínez
Currently, child nodes of the gpmc node are iterated and probed
regardless of their 'status' property. This means adding 'status =
"disabled";' has no effect.

This patch changes the iteration to only probe nodes marked as
available.

Signed-off-by: Guido Martínez 
---
v2: Make patch title consistent with previous gpmc patches

 arch/arm/mach-omap2/gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 2c0c281..8bc1338 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1615,7 +1615,7 @@ static int gpmc_probe_dt(struct platform_device *pdev)
return ret;
}
 
-   for_each_child_of_node(pdev->dev.of_node, child) {
+   for_each_available_child_of_node(pdev->dev.of_node, child) {
 
if (!child->name)
continue;
-- 
2.0.0

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


Re: [PATCH/RESEND 0/9] drm: tilcdc driver fixes

2014-07-01 Thread Guido Martínez
Hi Dave,

did you take a look at this patchset? I foolishly missed adding you on
the To: header, so apologies for that in advance.

Thanks,

On Tue, Jun 17, 2014 at 11:17:02AM -0300, Guido Martínez wrote:
> The tilcdc driver could be compiled as a module, but was severely broken
> and could not be used as such. This patchset attempts to fix the issues
> preventing a proper load/unload of the module.
> 
> Issues included dangling sysfs nodes, dangling devices, memory leaks and
> a double kfree.
> 
> It now seems to be working ok. We have tested this by loading and
> unloading the driver repeteadly, with both panel and slave connectors
> and found no flaws.
> 
> There is still one warning left on tilcdc_crtc_destroy, caused by
> destroying the connector while still in an ON status. We don't know why
> this happens or why it's an issue, so we did not fix it.
> 
> The first 7 patches are bug fixes which and should probably be applied
> in the stable trees. The last two are clean-ups.
> 
> 
> Resending this since I got no replies.
> 
> 
> Guido Martínez (9):
>   drm/i2c: tda998x: move drm_i2c_encoder_destroy call
>   drm/tilcdc: panel: fix dangling sysfs connector node
>   drm/tilcdc: slave: fix dangling sysfs connector node
>   drm/tilcdc: tfp410: fix dangling sysfs connector node
>   drm/tilcdc: panel: fix leak when unloading the module
>   drm/tilcdc: fix release order on exit
>   drm/tilcdc: fix double kfree
>   drm/tilcdc: remove submodule destroy calls
>   drm/tilcdc: replace late_initcall with module_init
> 
>  drivers/gpu/drm/i2c/tda998x_drv.c  |  2 +-
>  drivers/gpu/drm/tilcdc/Module.symvers  |  0
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c| 15 +
>  drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
>  drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 39 
> +-
>  drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 27 +--
>  drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 35 +++---
>  7 files changed, 59 insertions(+), 60 deletions(-)
>  create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers
> 
> -- 
> 2.0.0
> 

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 1/3] ARM: dts: am335x-bone: add support for beaglebone NAND cape

2014-07-01 Thread Guido Martínez
Hi Pekon,

On Tue, Jul 01, 2014 at 07:01:03AM +, Gupta, Pekon wrote:
> >http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/266966.html
> >
> I don't think we need above patch.
> Helper macro "for_each_available_child_of_node" internally takes care
> of skipping nodes with status="disabled".
> 
> $KERNEL/include/linux/of.h
> #define for_each_available_child_of_node(parent, child) \
>   for (child = of_get_next_available_child(parent, NULL); child != NULL; \
>child = of_get_next_available_child(parent, child))
> 
> $KERNEL/drivers/of/base.c @@ of_get_next_available_child(...) {
>   ...
>   if (!__of_device_is_available(next))
>   continue;
>   ...
Yes, that's why I suggest using that macro. It's not currently used
in gpmc.c and my patch changes the 'for_each_child_of_node' to a
'for_each_available_child_of_node'. Or am I missing something?

Regards,

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RESEND 0/9] drm: tilcdc driver fixes

2014-07-01 Thread Guido Martínez
On Fri, Jun 27, 2014 at 05:08:51PM -0500, Darren Etheridge wrote:
> [snip]
> 
> Otherwise I think this is a good and useful patch series.
It that a Tested-by tag? :)

Thanks!
Guido

> 
> Darren
> 
> >The first 7 patches are bug fixes which and should probably be applied
> >in the stable trees. The last two are clean-ups.
> >
> >
> >Resending this since I got no replies.
> >
> >
> >Guido Martínez (9):
> >   drm/i2c: tda998x: move drm_i2c_encoder_destroy call
> >   drm/tilcdc: panel: fix dangling sysfs connector node
> >   drm/tilcdc: slave: fix dangling sysfs connector node
> >   drm/tilcdc: tfp410: fix dangling sysfs connector node
> >   drm/tilcdc: panel: fix leak when unloading the module
> >   drm/tilcdc: fix release order on exit
> >   drm/tilcdc: fix double kfree
> >   drm/tilcdc: remove submodule destroy calls
> >   drm/tilcdc: replace late_initcall with module_init
> >
> >  drivers/gpu/drm/i2c/tda998x_drv.c  |  2 +-
> >  drivers/gpu/drm/tilcdc/Module.symvers  |  0
> >  drivers/gpu/drm/tilcdc/tilcdc_drv.c| 15 +
> >  drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
> >  drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 39 
> > +-
> >  drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 27 +--
> >  drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 35 +++---
> >  7 files changed, 59 insertions(+), 60 deletions(-)
> >  create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers
> >

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 1/3] ARM: dts: am335x-bone: add support for beaglebone NAND cape

2014-06-26 Thread Guido Martínez
 partition@9 {
> + label = "NAND.file-system";
> + reg = <0x00a0 0x1f60>;
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/am335x-bone.dts 
> b/arch/arm/boot/dts/am335x-bone.dts
> index 94ee427..f16bfcf 100644
> --- a/arch/arm/boot/dts/am335x-bone.dts
> +++ b/arch/arm/boot/dts/am335x-bone.dts
> @@ -9,6 +9,7 @@
>  
>  #include "am33xx.dtsi"
>  #include "am335x-bone-common.dtsi"
> +#include "am335x-bone-memory-cape.dts"
>  
>  &ldo3_reg {
>   regulator-min-microvolt = <180>;
> diff --git a/arch/arm/boot/dts/am335x-boneblack.dts 
> b/arch/arm/boot/dts/am335x-boneblack.dts
> index 305975d..e6d7e54 100644
> --- a/arch/arm/boot/dts/am335x-boneblack.dts
> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
> @@ -9,6 +9,7 @@
>  
>  #include "am33xx.dtsi"
>  #include "am335x-bone-common.dtsi"
> +#include "am335x-bone-memory-cape.dts"
>  
>  &ldo3_reg {
>   regulator-min-microvolt = <180>;
> -- 
> 1.8.5.1.163.gd7aced9
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 3/3] ARM: dts: am335x-bone: add support for beaglebone LCD4 cape

2014-06-26 Thread Guido Martínez
  0x184 (PIN_INPUT_PULLDOWN | MUX_MODE7)  /* 
> uart1_txd.gpio0[15] (enter) */
> + 0x40  (PIN_INPUT_PULLDOWN | MUX_MODE7)  /* 
> gpmc_a0.gpio1[16] (left) */
> + 0x44  (PIN_INPUT_PULLDOWN | MUX_MODE7)  /* 
> gpmc_a1.gpio1[17] (right) */
> + 0x4c  (PIN_INPUT_PULLDOWN | MUX_MODE7)  /* 
> gpmc_a3.gpio1[19] (up) */
> + 0x198 (PIN_INPUT_PULLDOWN | MUX_MODE7)  /* 
> mcasp0_axr0.gpio3[16] (down) */
> + >;
> + };
> +};
> +
> +
> +/ {
> + backlight {
> + status = "disabled";
> + compatible = "gpio-backlight";
> + pinctrl-names = "default";
> + pinctrl-0 = <&bbcape_backlight_pins>;
> + gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
> + default-on;
> + };
> +
> + panel {
> + status = "disabled";
> + compatible = "ti,tilcdc,panel";
> + pinctrl-names = "default";
> + pinctrl-0 = <&bbcape_lcd_pins>;
> + panel-info {
> + ac-bias   = <255>;
> + ac-bias-intrpt= <0>;
> + dma-burst-sz  = <16>;
> + bpp   = <16>;
> + fdd   = <0x80>;
> + sync-edge = <0>;
> + sync-ctrl = <0>;
I had to set this to <1>. Does that make sense? 

> + raster-order  = <0>;
> + fifo-th   = <0>;
> + };
> + display-timings {
> + native-mode = <&timing0>;
> + /* www.newhavendisplay.com/app_notes/OTA5180A.pdf */
> + timing0: 480x272 {
> + clock-frequency = <3000>;
> + hactive = <480>;
> + vactive = <272>;
> + hfront-porch = <8>;
> + hback-porch = <47>;
> + hsync-len = <41>;
> + vback-porch = <2>;
> + vfront-porch = <3>;
> + vsync-len = <10>;
> + hsync-active = <0>;
> + vsync-active = <0>;
> + de-active = <1>;
> + pixelclk-active = <0>;
Are you sure these timings are ok? When enabling the sync control I get
an usable display, but it looks a bit funny. For example an all black
display looks very clear and has a dotted pattern.

I tried to take a picture of it but it doesn't show.

Also I'm just guessing about the timings, maybe it's something else?

> + };
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/am335x-bone.dts 
> b/arch/arm/boot/dts/am335x-bone.dts
> index f16bfcf..41439dc 100644
> --- a/arch/arm/boot/dts/am335x-bone.dts
> +++ b/arch/arm/boot/dts/am335x-bone.dts
> @@ -10,6 +10,7 @@
>  #include "am33xx.dtsi"
>  #include "am335x-bone-common.dtsi"
>  #include "am335x-bone-memory-cape.dts"
> +#include "am335x-bone-display-cape.dts"
>  
>  &ldo3_reg {
>   regulator-min-microvolt = <180>;
> diff --git a/arch/arm/boot/dts/am335x-boneblack.dts 
> b/arch/arm/boot/dts/am335x-boneblack.dts
> index e6d7e54..03232c7 100644
> --- a/arch/arm/boot/dts/am335x-boneblack.dts
> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
> @@ -10,6 +10,7 @@
>  #include "am33xx.dtsi"
>  #include "am335x-bone-common.dtsi"
>  #include "am335x-bone-memory-cape.dts"
> +#include "am335x-bone-display-cape.dts"
>  
>  &ldo3_reg {
>   regulator-min-microvolt = <180>;
> -- 
> 1.8.5.1.163.gd7aced9
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 1/3] ARM: dts: am335x-bone: add support for beaglebone NAND cape

2014-06-26 Thread Guido Martínez
Hi Tony, Pekon

On Thu, Jun 26, 2014 at 03:40:44AM -0700, Tony Lindgren wrote:
> * Pekon Gupta  [140624 05:26]:
> > +
> > +&gpmc {
> > +   ranges = <0 0 0 0x0100>;/* address range = 16MB (minimum GPMC 
> > partition) */
> > +   nand@0,0 {
> > +   status = "disabled";
> > +   reg = <0 0 4>;  /* device IO registers */
> 
> Hmm so what about other capes potentially also using GPMC CS0?
> 
> Can you please do a check with two .dtsi files trying to use
> GPMC CS0 and see what the produced .dtb file looks like after
> decompiling it with dtc?
> 
> I'd assume the 16MB GPMC partition will be just fine for many
> devices and can be also be larger if NOR needs it so maybe it
> can be handled for almost all the cases.
> 
> The names for devices must be unique though to avoid them
> getting merged. And I don't know if gpmc.c skips disabled devices
> properly.
It doesn't. I've just sent a patch for it.

http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/266966.html

Regards,
Guido

> 
> Regards,
> 
> Tony
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] arm: mach-omap2: gpmc: ignore non-available nodes

2014-06-26 Thread Guido Martínez
Currently, child nodes of the gpmc node are iterated and probed
regardless of their 'status' property. This means adding 'status =
"disabled";' has no effect.

This patch changes the iteration to only probe nodes marked as
available.

Signed-off-by: Guido Martínez 
---
 arch/arm/mach-omap2/gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 2c0c281..8bc1338 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1615,7 +1615,7 @@ static int gpmc_probe_dt(struct platform_device *pdev)
return ret;
}
 
-   for_each_child_of_node(pdev->dev.of_node, child) {
+   for_each_available_child_of_node(pdev->dev.of_node, child) {
 
if (!child->name)
continue;
-- 
2.0.0

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


Re: [PATCH/RESEND 1/9] drm/i2c: tda998x: move drm_i2c_encoder_destroy call

2014-06-24 Thread Guido Martínez
Hi Russell,

On Tue, Jun 24, 2014 at 05:38:13PM +0100, Russell King - ARM Linux wrote:
> On Tue, Jun 17, 2014 at 11:17:03AM -0300, Guido Martínez wrote:
> > Currently tda998x_encoder_destroy() calls cec_write() and reg_clear(),
> > as part of the release procedure. Such calls need to access the I2C bus
> > and therefore, we need to call them before drm_i2c_encoder_destroy()
> > which unregisters the I2C device.
> > 
> > This commit moves the latter so it's done afterwards.
> > 
> > Signed-off-by: Guido Martínez 
> > Signed-off-by: Ezequiel García 
> > Cc:  #v3.9+
> 
> You really should have sent this with me in the To: header as I'm now the
> maintainer of this driver.  Yes, this is a valid fix, and I'll apply it
> shortly.  Thanks.
Sorry about that, I'm still kind of new to this whole deal. I'll keep it
mind for future patches.

Thanks,
Guido


> > ---
> >  drivers/gpu/drm/i2c/tda998x_drv.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
> > b/drivers/gpu/drm/i2c/tda998x_drv.c
> > index 240c331..db9515f 100644
> > --- a/drivers/gpu/drm/i2c/tda998x_drv.c
> > +++ b/drivers/gpu/drm/i2c/tda998x_drv.c
> > @@ -1183,7 +1183,6 @@ static void
> >  tda998x_encoder_destroy(struct drm_encoder *encoder)
> >  {
> > struct tda998x_priv *priv = to_tda998x_priv(encoder);
> > -   drm_i2c_encoder_destroy(encoder);
> >  
> > /* disable all IRQs and free the IRQ handler */
> > cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
> > @@ -1193,6 +1192,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder)
> >  
> > if (priv->cec)
> > i2c_unregister_device(priv->cec);
> > +   drm_i2c_encoder_destroy(encoder);
> > kfree(priv);
> >  }
> >  
> > -- 
> > 2.0.0
> > 
> 
> -- 
> FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
> improving, and getting towards what was expected from it.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RESEND 8/9] drm/tilcdc: remove submodule destroy calls

2014-06-24 Thread Guido Martínez
On Tue, Jun 24, 2014 at 05:06:24PM -0500, Darren Etheridge wrote:
> Guido,
> 
> On 06/17/2014 09:17 AM, Guido Martínez wrote:
> >The TI tilcdc driver is designed with a notion of submodules. Currently,
> >at unload time, these submodules are iterated and destroyed.
> >
> >Now that the tilcdc remove order is fixed, this can be handled perfectly
> 
> I am not sure I understand the first part of the above sentence - did
> something change with tilcdc ordering?  I think you a referring to previous
> patches in your series which really mean tilcdc can actually unload now.
Right, I guess I got a bit dizzy while writing that commit log :). If we
find the patch reasonable I'll send a better explanation.

> So really the method this patch uses could always have been used, it
> just wasn't for some reason?
Yes, I think so.

> I have tested all of the other patches in your series and all looks good on
> BeagleBone Black and AM335xEVM, I tested as both built-ins and modules and
> can load/unload on BeagleBone Black with HDMI enabled correctly.
Nice to hear that :)

> I want to play around a bit more with this particular patch, to try and
> understand how it differs from Rob's original intent with his module
> registration/deregistration scheme.  I prefer your method, but do we loose
> anything that Rob's originally had in mind?
Nothing really comes to mind, but I may be wrong on this...

Thanks a lot for your review!

> Darren
> 
> >by the kernel using the device infrastructure, since each submodule
> >is a kernel driver itself, and they are only destroy()'ed at unload
> >time. Therefore we move the destroy() functionality to each submodule's
> >remove().
> >
> >Also, remove some checks in the unloading process since the new code
> >guarantees the resources are allocated and need a release.
> >
> >Signed-off-by: Guido Martínez 
> >---
> >  drivers/gpu/drm/tilcdc/Module.symvers  |  0
> >  drivers/gpu/drm/tilcdc/tilcdc_drv.c|  6 --
> >  drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
> >  drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 36 
> > +-
> >  drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 26 +---
> >  drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 34 
> > 
> >  6 files changed, 50 insertions(+), 53 deletions(-)
> >  create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers
> >
> >diff --git a/drivers/gpu/drm/tilcdc/Module.symvers 
> >b/drivers/gpu/drm/tilcdc/Module.symvers
> >new file mode 100644
> >index 000..e69de29
> >diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
> >b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> >index 006a30e..2c860c4 100644
> >--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> >+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> >@@ -120,7 +120,6 @@ static int cpufreq_transition(struct notifier_block *nb,
> >  static int tilcdc_unload(struct drm_device *dev)
> >  {
> > struct tilcdc_drm_private *priv = dev->dev_private;
> >-struct tilcdc_module *mod, *cur;
> >
> > drm_fbdev_cma_fini(priv->fbdev);
> > drm_kms_helper_poll_fini(dev);
> >@@ -149,11 +148,6 @@ static int tilcdc_unload(struct drm_device *dev)
> >
> > pm_runtime_disable(dev->dev);
> >
> >-list_for_each_entry_safe(mod, cur, &module_list, list) {
> >-DBG("destroying module: %s", mod->name);
> >-mod->funcs->destroy(mod);
> >-}
> >-
> > kfree(priv);
> >
> > return 0;
> >diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h 
> >b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> >index 0938036..7596c14 100644
> >--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> >+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
> >@@ -98,7 +98,6 @@ struct tilcdc_module;
> >  struct tilcdc_module_ops {
> > /* create appropriate encoders/connectors: */
> > int (*modeset_init)(struct tilcdc_module *mod, struct drm_device *dev);
> >-void (*destroy)(struct tilcdc_module *mod);
> >  #ifdef CONFIG_DEBUG_FS
> > /* create debugfs nodes (can be NULL): */
> > int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor);
> >diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
> >b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
> >index b085dcc..2f6efae 100644
> >--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
> >+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
> >@@ -282,21 +282,8 @@ static int panel_modeset_init(struct tilcdc_module 
> >*mod, struct drm_device *dev)
> > return 0;
> >  }
> >
&g

Re: [PATCH/RESEND 0/9] drm: tilcdc driver fixes

2014-06-23 Thread Guido Martínez
Hi Rob,

On Tue, Jun 17, 2014 at 11:17:02AM -0300, Guido Martínez wrote:
> The tilcdc driver could be compiled as a module, but was severely broken
> and could not be used as such. This patchset attempts to fix the issues
> preventing a proper load/unload of the module.
> 
> Issues included dangling sysfs nodes, dangling devices, memory leaks and
> a double kfree.
> 
> It now seems to be working ok. We have tested this by loading and
> unloading the driver repeteadly, with both panel and slave connectors
> and found no flaws.
> 
> There is still one warning left on tilcdc_crtc_destroy, caused by
> destroying the connector while still in an ON status. We don't know why
> this happens or why it's an issue, so we did not fix it.
> 
> The first 7 patches are bug fixes which and should probably be applied
> in the stable trees. The last two are clean-ups.
>

Any comment on this patchset?

Thanks!

> 
> Resending this since I got no replies.
> 
> 
> Guido Martínez (9):
>   drm/i2c: tda998x: move drm_i2c_encoder_destroy call
>   drm/tilcdc: panel: fix dangling sysfs connector node
>   drm/tilcdc: slave: fix dangling sysfs connector node
>   drm/tilcdc: tfp410: fix dangling sysfs connector node
>   drm/tilcdc: panel: fix leak when unloading the module
>   drm/tilcdc: fix release order on exit
>   drm/tilcdc: fix double kfree
>   drm/tilcdc: remove submodule destroy calls
>   drm/tilcdc: replace late_initcall with module_init
> 
>  drivers/gpu/drm/i2c/tda998x_drv.c  |  2 +-
>  drivers/gpu/drm/tilcdc/Module.symvers  |  0
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c| 15 +
>  drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
>  drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 39 
> +-
>  drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 27 +--
>  drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 35 +++---
>  7 files changed, 59 insertions(+), 60 deletions(-)
>  create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers
> 
> -- 
> 2.0.0
> 

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RESEND 0/9] drm: tilcdc driver fixes

2014-06-19 Thread Guido Martínez
Hi Darren,

On Thu, Jun 19, 2014 at 08:41:43AM -0500, Darren Etheridge wrote:
> Guido,
> 
> Thanks and sorry I missed this the first time around.  I'll give it a try on
> a few of my AM335x based boards when I have access to them again on Monday.
Thanks! And no worries :)

> 
> Darren
> 
-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH/RESEND 6/9] drm/tilcdc: fix release order on exit

2014-06-17 Thread Guido Martínez
Unregister resources in the correct order on tilcdc_drm_fini, which is
the reverse order they were registered during tilcdc_drm_init.

This also means unregistering the driver before releasing its resources.

Signed-off-by: Guido Martínez 
Cc:  #v3.9+
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 490aee7..006a30e 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -629,10 +629,10 @@ static int __init tilcdc_drm_init(void)
 static void __exit tilcdc_drm_fini(void)
 {
DBG("fini");
-   tilcdc_tfp410_fini();
-   tilcdc_slave_fini();
-   tilcdc_panel_fini();
platform_driver_unregister(&tilcdc_platform_driver);
+   tilcdc_panel_fini();
+   tilcdc_slave_fini();
+   tilcdc_tfp410_fini();
 }
 
 late_initcall(tilcdc_drm_init);
-- 
2.0.0

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


[PATCH/RESEND 8/9] drm/tilcdc: remove submodule destroy calls

2014-06-17 Thread Guido Martínez
The TI tilcdc driver is designed with a notion of submodules. Currently,
at unload time, these submodules are iterated and destroyed.

Now that the tilcdc remove order is fixed, this can be handled perfectly
by the kernel using the device infrastructure, since each submodule
is a kernel driver itself, and they are only destroy()'ed at unload
time. Therefore we move the destroy() functionality to each submodule's
remove().

Also, remove some checks in the unloading process since the new code
guarantees the resources are allocated and need a release.

Signed-off-by: Guido Martínez 
---
 drivers/gpu/drm/tilcdc/Module.symvers  |  0
 drivers/gpu/drm/tilcdc/tilcdc_drv.c|  6 --
 drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 36 +-
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 26 +---
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 34 
 6 files changed, 50 insertions(+), 53 deletions(-)
 create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers

diff --git a/drivers/gpu/drm/tilcdc/Module.symvers 
b/drivers/gpu/drm/tilcdc/Module.symvers
new file mode 100644
index 000..e69de29
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 006a30e..2c860c4 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -120,7 +120,6 @@ static int cpufreq_transition(struct notifier_block *nb,
 static int tilcdc_unload(struct drm_device *dev)
 {
struct tilcdc_drm_private *priv = dev->dev_private;
-   struct tilcdc_module *mod, *cur;
 
drm_fbdev_cma_fini(priv->fbdev);
drm_kms_helper_poll_fini(dev);
@@ -149,11 +148,6 @@ static int tilcdc_unload(struct drm_device *dev)
 
pm_runtime_disable(dev->dev);
 
-   list_for_each_entry_safe(mod, cur, &module_list, list) {
-   DBG("destroying module: %s", mod->name);
-   mod->funcs->destroy(mod);
-   }
-
kfree(priv);
 
return 0;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index 0938036..7596c14 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -98,7 +98,6 @@ struct tilcdc_module;
 struct tilcdc_module_ops {
/* create appropriate encoders/connectors: */
int (*modeset_init)(struct tilcdc_module *mod, struct drm_device *dev);
-   void (*destroy)(struct tilcdc_module *mod);
 #ifdef CONFIG_DEBUG_FS
/* create debugfs nodes (can be NULL): */
int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor);
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index b085dcc..2f6efae 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -282,21 +282,8 @@ static int panel_modeset_init(struct tilcdc_module *mod, 
struct drm_device *dev)
return 0;
 }
 
-static void panel_destroy(struct tilcdc_module *mod)
-{
-   struct panel_module *panel_mod = to_panel_module(mod);
-
-   if (panel_mod->timings)
-   display_timings_release(panel_mod->timings);
-
-   tilcdc_module_cleanup(mod);
-   kfree(panel_mod->info);
-   kfree(panel_mod);
-}
-
 static const struct tilcdc_module_ops panel_module_ops = {
.modeset_init = panel_modeset_init,
-   .destroy = panel_destroy,
 };
 
 /*
@@ -372,6 +359,7 @@ static int panel_probe(struct platform_device *pdev)
return -ENOMEM;
 
mod = &panel_mod->base;
+   pdev->dev.platform_data = mod;
 
tilcdc_module_init(mod, "panel", &panel_module_ops);
 
@@ -379,17 +367,16 @@ static int panel_probe(struct platform_device *pdev)
if (IS_ERR(pinctrl))
dev_warn(&pdev->dev, "pins are not configured\n");
 
-
panel_mod->timings = of_get_display_timings(node);
if (!panel_mod->timings) {
dev_err(&pdev->dev, "could not get panel timings\n");
-   goto fail;
+   goto fail_free;
}
 
panel_mod->info = of_get_panel_info(node);
if (!panel_mod->info) {
dev_err(&pdev->dev, "could not get panel info\n");
-   goto fail;
+   goto fail_timings;
}
 
mod->preferred_bpp = panel_mod->info->bpp;
@@ -400,13 +387,26 @@ static int panel_probe(struct platform_device *pdev)
 
return 0;
 
-fail:
-   panel_destroy(mod);
+fail_timings:
+   display_timings_release(panel_mod->timings);
+
+fail_free:
+   kfree(panel_mod);
+   tilcdc_module_cleanup(mod);
return ret;
 }
 
 static int panel_remove(struct platform_device *pdev)
 {
+   struct tilcdc_module *mod = dev_get_platdata(&pdev->de

[PATCH/RESEND 7/9] drm/tilcdc: fix double kfree

2014-06-17 Thread Guido Martínez
display_timings_release calls kfree on the display_timings object passed
to it. Calling kfree after it is wrong. SLUB debug showed the following
warning:


=
BUG kmalloc-64 (Tainted: GW): Object already free

-

Disabling lock debugging due to kernel taint
INFO: Allocated in of_get_display_timings+0x2c/0x214 age=601 cpu=0
pid=884
 __slab_alloc.constprop.79+0x2e0/0x33c
 kmem_cache_alloc+0xac/0xdc
 of_get_display_timings+0x2c/0x214
 panel_probe+0x7c/0x314 [tilcdc]
 platform_drv_probe+0x18/0x48
 [..snip..]
INFO: Freed in panel_destroy+0x18/0x3c [tilcdc] age=0 cpu=0 pid=907
 __slab_free+0x34/0x330
 panel_destroy+0x18/0x3c [tilcdc]
 tilcdc_unload+0xd0/0x118 [tilcdc]
 drm_dev_unregister+0x24/0x98
 [..snip..]

Signed-off-by: Guido Martínez 
Cc:  #v3.9+
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 1943b2f..b085dcc 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -286,10 +286,8 @@ static void panel_destroy(struct tilcdc_module *mod)
 {
struct panel_module *panel_mod = to_panel_module(mod);
 
-   if (panel_mod->timings) {
+   if (panel_mod->timings)
display_timings_release(panel_mod->timings);
-   kfree(panel_mod->timings);
-   }
 
tilcdc_module_cleanup(mod);
kfree(panel_mod->info);
-- 
2.0.0

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


[PATCH/RESEND 9/9] drm/tilcdc: replace late_initcall with module_init

2014-06-17 Thread Guido Martínez
Use module_init instead of late_initcall, as is the norm for modular
drivers.

module_init was used until 6e8de0bd6a51fdeebd5d975c4fcc426f730b339b
("drm/tilcdc: add encoder slave (v2)") changed it to a late_initcall,
but it does not explain why. Tests show it's working properly with
module_init.

Signed-off-by: Guido Martínez 
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 2c860c4..6be623b 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -629,7 +629,7 @@ static void __exit tilcdc_drm_fini(void)
tilcdc_tfp410_fini();
 }
 
-late_initcall(tilcdc_drm_init);
+module_init(tilcdc_drm_init);
 module_exit(tilcdc_drm_fini);
 
 MODULE_AUTHOR("Rob Clark http://vger.kernel.org/majordomo-info.html


[PATCH/RESEND 4/9] drm/tilcdc: tfp410: fix dangling sysfs connector node

2014-06-17 Thread Guido Martínez
Add a drm_sysfs_connector_remove call when we destroy the panel to make
sure the connector node in sysfs gets deleted.

This is required for proper unload and re-load of this driver, otherwise
we will get a warning about a duplicate filename in sysfs.

Signed-off-by: Guido Martínez 
Cc:  #v3.9+
---
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c 
b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
index c38b56b..ce75ac8 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
@@ -167,6 +167,7 @@ struct tfp410_connector {
 static void tfp410_connector_destroy(struct drm_connector *connector)
 {
struct tfp410_connector *tfp410_connector = 
to_tfp410_connector(connector);
+   drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector);
kfree(tfp410_connector);
 }
-- 
2.0.0

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


[PATCH/RESEND 3/9] drm/tilcdc: slave: fix dangling sysfs connector node

2014-06-17 Thread Guido Martínez
Add a drm_sysfs_connector_remove call when we destroy the panel to make
sure the connector node in sysfs gets deleted.

This is required for proper unload and re-load of this driver as a
module. Without this, we would get a warning at re-load time like so:

   tda998x 0-0070: found TDA19988
   [ cut here ]
   WARNING: CPU: 0 PID: 825 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x54/0x74()
   sysfs: cannot create duplicate filename '/class/drm/card0-HDMI-A-1'
   Modules linked in: [..]
   CPU: 0 PID: 825 Comm: modprobe Not tainted 3.15.0-rc4-00027-g9dcdef4 #82
   [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
   [] (show_stack) from [] (warn_slowpath_common+0x68/0x88)
   [] (warn_slowpath_common) from [] 
(warn_slowpath_fmt+0x30/0x40)
   [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x54/0x74)
   [] (sysfs_warn_dup) from [] 
(sysfs_do_create_link_sd.isra.2+0xb0/0xb8)
   [] (sysfs_do_create_link_sd.isra.2) from [] 
(device_add+0x338/0x520)
   [] (device_add) from [] 
(device_create_groups_vargs+0xa0/0xc4)
   [] (device_create_groups_vargs) from [] 
(device_create+0x24/0x2c)
   [] (device_create) from [] 
(drm_sysfs_connector_add+0x64/0x204)
   [] (drm_sysfs_connector_add) from [] 
(slave_modeset_init+0x120/0x1bc [tilcdc])
   [] (slave_modeset_init [tilcdc]) from [] 
(tilcdc_load+0x214/0x4c0 [tilcdc])
   [] (tilcdc_load [tilcdc]) from [] 
(drm_dev_register+0xa4/0x104)
  [..snip..]
   ---[ end trace 4df8d614936ebdee ]---
   [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: 
-17

Signed-off-by: Guido Martínez 
Cc:  #v3.9+
---
 drivers/gpu/drm/tilcdc/tilcdc_slave.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave.c 
b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
index 595068b..2f83ffb 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
@@ -166,6 +166,7 @@ struct slave_connector {
 static void slave_connector_destroy(struct drm_connector *connector)
 {
struct slave_connector *slave_connector = to_slave_connector(connector);
+   drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector);
kfree(slave_connector);
 }
-- 
2.0.0

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


[PATCH/RESEND 5/9] drm/tilcdc: panel: fix leak when unloading the module

2014-06-17 Thread Guido Martínez
The driver did not unregister the allocated framebuffer, which caused
memory leaks (and memory manager WARNs) when unloading. Also, the
framebuffer device under /dev still existed after unloading.

Add a call to drm_fbdev_cma_fini when unloading the module to prevent
both issues.

Signed-off-by: Guido Martínez 
Cc:  #v3.9+
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index b20b694..490aee7 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -122,6 +122,7 @@ static int tilcdc_unload(struct drm_device *dev)
struct tilcdc_drm_private *priv = dev->dev_private;
struct tilcdc_module *mod, *cur;
 
+   drm_fbdev_cma_fini(priv->fbdev);
drm_kms_helper_poll_fini(dev);
drm_mode_config_cleanup(dev);
drm_vblank_cleanup(dev);
-- 
2.0.0

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


[PATCH/RESEND 2/9] drm/tilcdc: panel: fix dangling sysfs connector node

2014-06-17 Thread Guido Martínez
Add a drm_sysfs_connector_remove call when we destroy the panel to make
sure the connector node in sysfs gets deleted.

This is required for proper unload and re-load of this driver as a
module. Without this, we would get a warning at re-load time like so:

   [ cut here ]
   WARNING: CPU: 0 PID: 824 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x54/0x74()
   sysfs: cannot create duplicate filename '/class/drm/card0-LVDS-1'
   Modules linked in: [...]
   CPU: 0 PID: 824 Comm: modprobe Not tainted 3.15.0-rc4-00027-g6484f96-dirty 
#81
   [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
   [] (show_stack) from [] (warn_slowpath_common+0x68/0x88)
   [] (warn_slowpath_common) from [] 
(warn_slowpath_fmt+0x30/0x40)
   [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x54/0x74)
   [] (sysfs_warn_dup) from [] 
(sysfs_do_create_link_sd.isra.2+0xb0/0xb8)
   [] (sysfs_do_create_link_sd.isra.2) from [] 
(device_add+0x338/0x520)
   [] (device_add) from [] 
(device_create_groups_vargs+0xa0/0xc4)
   [] (device_create_groups_vargs) from [] 
(device_create+0x24/0x2c)
   [] (device_create) from [] 
(drm_sysfs_connector_add+0x64/0x204)
   [] (drm_sysfs_connector_add) from [] 
(panel_modeset_init+0xb8/0x134 [tilcdc])
   [] (panel_modeset_init [tilcdc]) from [] 
(tilcdc_load+0x214/0x4c0 [tilcdc])
   [] (tilcdc_load [tilcdc]) from [] 
(drm_dev_register+0xa4/0x104)
  [ .. snip .. ]
   ---[ end trace b2d09cd9578b0497 ]---
   [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: 
-17

Signed-off-by: Guido Martínez 
Cc:  #v3.9+
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 86c6732..1943b2f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -151,6 +151,7 @@ struct panel_connector {
 static void panel_connector_destroy(struct drm_connector *connector)
 {
struct panel_connector *panel_connector = to_panel_connector(connector);
+   drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector);
kfree(panel_connector);
 }
-- 
2.0.0

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


[PATCH/RESEND 1/9] drm/i2c: tda998x: move drm_i2c_encoder_destroy call

2014-06-17 Thread Guido Martínez
Currently tda998x_encoder_destroy() calls cec_write() and reg_clear(),
as part of the release procedure. Such calls need to access the I2C bus
and therefore, we need to call them before drm_i2c_encoder_destroy()
which unregisters the I2C device.

This commit moves the latter so it's done afterwards.

Signed-off-by: Guido Martínez 
Signed-off-by: Ezequiel García 
Cc:  #v3.9+
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 240c331..db9515f 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1183,7 +1183,6 @@ static void
 tda998x_encoder_destroy(struct drm_encoder *encoder)
 {
struct tda998x_priv *priv = to_tda998x_priv(encoder);
-   drm_i2c_encoder_destroy(encoder);
 
/* disable all IRQs and free the IRQ handler */
cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
@@ -1193,6 +1192,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder)
 
if (priv->cec)
i2c_unregister_device(priv->cec);
+   drm_i2c_encoder_destroy(encoder);
kfree(priv);
 }
 
-- 
2.0.0

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


[PATCH/RESEND 0/9] drm: tilcdc driver fixes

2014-06-17 Thread Guido Martínez
The tilcdc driver could be compiled as a module, but was severely broken
and could not be used as such. This patchset attempts to fix the issues
preventing a proper load/unload of the module.

Issues included dangling sysfs nodes, dangling devices, memory leaks and
a double kfree.

It now seems to be working ok. We have tested this by loading and
unloading the driver repeteadly, with both panel and slave connectors
and found no flaws.

There is still one warning left on tilcdc_crtc_destroy, caused by
destroying the connector while still in an ON status. We don't know why
this happens or why it's an issue, so we did not fix it.

The first 7 patches are bug fixes which and should probably be applied
in the stable trees. The last two are clean-ups.


Resending this since I got no replies.


Guido Martínez (9):
  drm/i2c: tda998x: move drm_i2c_encoder_destroy call
  drm/tilcdc: panel: fix dangling sysfs connector node
  drm/tilcdc: slave: fix dangling sysfs connector node
  drm/tilcdc: tfp410: fix dangling sysfs connector node
  drm/tilcdc: panel: fix leak when unloading the module
  drm/tilcdc: fix release order on exit
  drm/tilcdc: fix double kfree
  drm/tilcdc: remove submodule destroy calls
  drm/tilcdc: replace late_initcall with module_init

 drivers/gpu/drm/i2c/tda998x_drv.c  |  2 +-
 drivers/gpu/drm/tilcdc/Module.symvers  |  0
 drivers/gpu/drm/tilcdc/tilcdc_drv.c| 15 +
 drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 39 +-
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 27 +--
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 35 +++---
 7 files changed, 59 insertions(+), 60 deletions(-)
 create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers

-- 
2.0.0

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


[PATCH 7/9] drm/tilcdc: fix double kfree

2014-06-06 Thread Guido Martínez
display_timings_release calls kfree on the display_timings object passed
to it. Calling kfree after it is wrong. SLUB debug showed the following
warning:


=
BUG kmalloc-64 (Tainted: GW): Object already free

-

Disabling lock debugging due to kernel taint
INFO: Allocated in of_get_display_timings+0x2c/0x214 age=601 cpu=0
pid=884
 __slab_alloc.constprop.79+0x2e0/0x33c
 kmem_cache_alloc+0xac/0xdc
 of_get_display_timings+0x2c/0x214
 panel_probe+0x7c/0x314 [tilcdc]
 platform_drv_probe+0x18/0x48
 [..snip..]
INFO: Freed in panel_destroy+0x18/0x3c [tilcdc] age=0 cpu=0 pid=907
 __slab_free+0x34/0x330
 panel_destroy+0x18/0x3c [tilcdc]
 tilcdc_unload+0xd0/0x118 [tilcdc]
 drm_dev_unregister+0x24/0x98
 [..snip..]

Signed-off-by: Guido Martínez 
Cc: sta...@vger.kernel.org
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 1943b2f..b085dcc 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -286,10 +286,8 @@ static void panel_destroy(struct tilcdc_module *mod)
 {
struct panel_module *panel_mod = to_panel_module(mod);
 
-   if (panel_mod->timings) {
+   if (panel_mod->timings)
display_timings_release(panel_mod->timings);
-   kfree(panel_mod->timings);
-   }
 
tilcdc_module_cleanup(mod);
kfree(panel_mod->info);
-- 
2.0.0.rc2

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


[PATCH 9/9] drm/tilcdc: replace late_initcall with module_init

2014-06-06 Thread Guido Martínez
Use module_init instead of late_initcall, as is the norm for modular
drivers.

module_init was used until 6e8de0bd6a51fdeebd5d975c4fcc426f730b339b
("drm/tilcdc: add encoder slave (v2)") changed it to a late_initcall,
but it does not explain why. Tests show it's working properly with
module_init.

Signed-off-by: Guido Martínez 
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 702315f..80e6697 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -629,7 +629,7 @@ static void __exit tilcdc_drm_fini(void)
tilcdc_tfp410_fini();
 }
 
-late_initcall(tilcdc_drm_init);
+module_init(tilcdc_drm_init);
 module_exit(tilcdc_drm_fini);
 
 MODULE_AUTHOR("Rob Clark http://vger.kernel.org/majordomo-info.html


[PATCH 5/9] drm/tilcdc: panel: fix leak when unloading the module

2014-06-06 Thread Guido Martínez
The driver did not unregister the allocated framebuffer, which caused
memory leaks (and memory manager WARNs) when unloading. Also, the
framebuffer device under /dev still existed after unloading.

Add a call to drm_fbdev_cma_fini when unloading the module to prevent
both issues.

Signed-off-by: Guido Martínez 
Cc: sta...@vger.kernel.org
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 171a820..de34657 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -122,6 +122,7 @@ static int tilcdc_unload(struct drm_device *dev)
struct tilcdc_drm_private *priv = dev->dev_private;
struct tilcdc_module *mod, *cur;
 
+   drm_fbdev_cma_fini(priv->fbdev);
drm_kms_helper_poll_fini(dev);
drm_mode_config_cleanup(dev);
drm_vblank_cleanup(dev);
-- 
2.0.0.rc2

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


[PATCH 8/9] drm/tilcdc: remove submodule destroy calls

2014-06-06 Thread Guido Martínez
The TI tilcdc driver is designed with a notion of submodules. Currently,
at unload time, these submodules are iterated and destroyed.

Now that the tilcdc remove order is fixed, this can be handled perfectly
by the kernel using the device infrastructure, since each submodule
is a kernel driver itself, and they are only destroy()'ed at unload
time. Therefore we move the destroy() functionality to each submodule's
remove().

Also, remove some checks in the unloading process since the new code
guarantees the resources are allocated and need a release.

Signed-off-by: Guido Martínez 
---
 drivers/gpu/drm/tilcdc/Module.symvers  |  0
 drivers/gpu/drm/tilcdc/tilcdc_drv.c|  6 --
 drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 36 +-
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 26 +---
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 34 
 6 files changed, 50 insertions(+), 53 deletions(-)
 create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers

diff --git a/drivers/gpu/drm/tilcdc/Module.symvers 
b/drivers/gpu/drm/tilcdc/Module.symvers
new file mode 100644
index 000..e69de29
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 0644429..702315f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -120,7 +120,6 @@ static int cpufreq_transition(struct notifier_block *nb,
 static int tilcdc_unload(struct drm_device *dev)
 {
struct tilcdc_drm_private *priv = dev->dev_private;
-   struct tilcdc_module *mod, *cur;
 
drm_fbdev_cma_fini(priv->fbdev);
drm_kms_helper_poll_fini(dev);
@@ -149,11 +148,6 @@ static int tilcdc_unload(struct drm_device *dev)
 
pm_runtime_disable(dev->dev);
 
-   list_for_each_entry_safe(mod, cur, &module_list, list) {
-   DBG("destroying module: %s", mod->name);
-   mod->funcs->destroy(mod);
-   }
-
kfree(priv);
 
return 0;
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
index 0938036..7596c14 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h
@@ -98,7 +98,6 @@ struct tilcdc_module;
 struct tilcdc_module_ops {
/* create appropriate encoders/connectors: */
int (*modeset_init)(struct tilcdc_module *mod, struct drm_device *dev);
-   void (*destroy)(struct tilcdc_module *mod);
 #ifdef CONFIG_DEBUG_FS
/* create debugfs nodes (can be NULL): */
int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor);
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index b085dcc..2f6efae 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -282,21 +282,8 @@ static int panel_modeset_init(struct tilcdc_module *mod, 
struct drm_device *dev)
return 0;
 }
 
-static void panel_destroy(struct tilcdc_module *mod)
-{
-   struct panel_module *panel_mod = to_panel_module(mod);
-
-   if (panel_mod->timings)
-   display_timings_release(panel_mod->timings);
-
-   tilcdc_module_cleanup(mod);
-   kfree(panel_mod->info);
-   kfree(panel_mod);
-}
-
 static const struct tilcdc_module_ops panel_module_ops = {
.modeset_init = panel_modeset_init,
-   .destroy = panel_destroy,
 };
 
 /*
@@ -372,6 +359,7 @@ static int panel_probe(struct platform_device *pdev)
return -ENOMEM;
 
mod = &panel_mod->base;
+   pdev->dev.platform_data = mod;
 
tilcdc_module_init(mod, "panel", &panel_module_ops);
 
@@ -379,17 +367,16 @@ static int panel_probe(struct platform_device *pdev)
if (IS_ERR(pinctrl))
dev_warn(&pdev->dev, "pins are not configured\n");
 
-
panel_mod->timings = of_get_display_timings(node);
if (!panel_mod->timings) {
dev_err(&pdev->dev, "could not get panel timings\n");
-   goto fail;
+   goto fail_free;
}
 
panel_mod->info = of_get_panel_info(node);
if (!panel_mod->info) {
dev_err(&pdev->dev, "could not get panel info\n");
-   goto fail;
+   goto fail_timings;
}
 
mod->preferred_bpp = panel_mod->info->bpp;
@@ -400,13 +387,26 @@ static int panel_probe(struct platform_device *pdev)
 
return 0;
 
-fail:
-   panel_destroy(mod);
+fail_timings:
+   display_timings_release(panel_mod->timings);
+
+fail_free:
+   kfree(panel_mod);
+   tilcdc_module_cleanup(mod);
return ret;
 }
 
 static int panel_remove(struct platform_device *pdev)
 {
+   struct tilcdc_module *mod = dev_get_platdata(&pdev->de

[PATCH 2/9] drm/tilcdc: panel: fix dangling sysfs connector node

2014-06-06 Thread Guido Martínez
Add a drm_sysfs_connector_remove call when we destroy the panel to make
sure the connector node in sysfs gets deleted.

This is required for proper unload and re-load of this driver as a
module. Without this, we would get a warning at re-load time like so:

   [ cut here ]
   WARNING: CPU: 0 PID: 824 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x54/0x74()
   sysfs: cannot create duplicate filename '/class/drm/card0-LVDS-1'
   Modules linked in: [...]
   CPU: 0 PID: 824 Comm: modprobe Not tainted 3.15.0-rc4-00027-g6484f96-dirty 
#81
   [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
   [] (show_stack) from [] (warn_slowpath_common+0x68/0x88)
   [] (warn_slowpath_common) from [] 
(warn_slowpath_fmt+0x30/0x40)
   [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x54/0x74)
   [] (sysfs_warn_dup) from [] 
(sysfs_do_create_link_sd.isra.2+0xb0/0xb8)
   [] (sysfs_do_create_link_sd.isra.2) from [] 
(device_add+0x338/0x520)
   [] (device_add) from [] 
(device_create_groups_vargs+0xa0/0xc4)
   [] (device_create_groups_vargs) from [] 
(device_create+0x24/0x2c)
   [] (device_create) from [] 
(drm_sysfs_connector_add+0x64/0x204)
   [] (drm_sysfs_connector_add) from [] 
(panel_modeset_init+0xb8/0x134 [tilcdc])
   [] (panel_modeset_init [tilcdc]) from [] 
(tilcdc_load+0x214/0x4c0 [tilcdc])
   [] (tilcdc_load [tilcdc]) from [] 
(drm_dev_register+0xa4/0x104)
  [ .. snip .. ]
   ---[ end trace b2d09cd9578b0497 ]---
   [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: 
-17

Signed-off-by: Guido Martínez 
Cc: sta...@vger.kernel.org
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c 
b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 86c6732..1943b2f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -151,6 +151,7 @@ struct panel_connector {
 static void panel_connector_destroy(struct drm_connector *connector)
 {
struct panel_connector *panel_connector = to_panel_connector(connector);
+   drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector);
kfree(panel_connector);
 }
-- 
2.0.0.rc2

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


[PATCH 1/9] drm/i2c: tda998x: move drm_i2c_encoder_destroy call

2014-06-06 Thread Guido Martínez
Currently tda998x_encoder_destroy() calls cec_write() and reg_clear(),
as part of the release procedure. Such calls need to access the I2C bus
and therefore, we need to call them before drm_i2c_encoder_destroy()
which unregisters the I2C device.

This commit moves the latter so it's done afterwards.

Signed-off-by: Guido Martínez 
Signed-off-by: Ezequiel García 
Cc: sta...@vger.kernel.org
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c 
b/drivers/gpu/drm/i2c/tda998x_drv.c
index 219c7e8..d06eff6 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1183,7 +1183,6 @@ static void
 tda998x_encoder_destroy(struct drm_encoder *encoder)
 {
struct tda998x_priv *priv = to_tda998x_priv(encoder);
-   drm_i2c_encoder_destroy(encoder);
 
/* disable all IRQs and free the IRQ handler */
cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
@@ -1193,6 +1192,7 @@ tda998x_encoder_destroy(struct drm_encoder *encoder)
 
if (priv->cec)
i2c_unregister_device(priv->cec);
+   drm_i2c_encoder_destroy(encoder);
kfree(priv);
 }
 
-- 
2.0.0.rc2

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


[PATCH 0/9] tilcdc driver fixes

2014-06-06 Thread Guido Martínez
The tilcdc driver could be compiled as a module, but was severely broken
and could not be used as such. This patchset attempts to fix the issues
preventing a proper load/unload of the module.

Issues included dangling sysfs nodes, dangling devices, memory leaks and
a double kfree.

It now seems to be working ok. We have tested this by loading and
unloading the driver repeteadly, with both panel and slave connectors
and found no flaws.

There is still one warning left on tilcdc_crtc_destroy, caused by
destroying the connector while still in an ON status. We don't know why
this happens or why it's an issue, so we did not fix it.

The first 7 patches are bug fixes which and should probably be applied
in the stable trees. The last two are clean-ups.

The series applies cleanly over -next and 3.15-rc8, and will be resent
for v3.16-rc1, once it's out.

Guido Martínez (9):
  drm/i2c: tda998x: move drm_i2c_encoder_destroy call
  drm/tilcdc: panel: fix dangling sysfs connector node
  drm/tilcdc: slave: fix dangling sysfs connector node
  drm/tilcdc: tfp410: fix dangling sysfs connector node
  drm/tilcdc: panel: fix leak when unloading the module
  drm/tilcdc: fix release order on exit
  drm/tilcdc: fix double kfree
  drm/tilcdc: remove submodule destroy calls
  drm/tilcdc: replace late_initcall with module_init

 drivers/gpu/drm/i2c/tda998x_drv.c  |  2 +-
 drivers/gpu/drm/tilcdc/Module.symvers  |  0
 drivers/gpu/drm/tilcdc/tilcdc_drv.c| 15 +
 drivers/gpu/drm/tilcdc/tilcdc_drv.h|  1 -
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 39 +-
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  | 27 +--
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 35 +++---
 7 files changed, 59 insertions(+), 60 deletions(-)
 create mode 100644 drivers/gpu/drm/tilcdc/Module.symvers

-- 
2.0.0.rc2

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


[PATCH 3/9] drm/tilcdc: slave: fix dangling sysfs connector node

2014-06-06 Thread Guido Martínez
Add a drm_sysfs_connector_remove call when we destroy the panel to make
sure the connector node in sysfs gets deleted.

This is required for proper unload and re-load of this driver as a
module. Without this, we would get a warning at re-load time like so:

   tda998x 0-0070: found TDA19988
   [ cut here ]
   WARNING: CPU: 0 PID: 825 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x54/0x74()
   sysfs: cannot create duplicate filename '/class/drm/card0-HDMI-A-1'
   Modules linked in: [..]
   CPU: 0 PID: 825 Comm: modprobe Not tainted 3.15.0-rc4-00027-g9dcdef4 #82
   [] (unwind_backtrace) from [] (show_stack+0x10/0x14)
   [] (show_stack) from [] (warn_slowpath_common+0x68/0x88)
   [] (warn_slowpath_common) from [] 
(warn_slowpath_fmt+0x30/0x40)
   [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x54/0x74)
   [] (sysfs_warn_dup) from [] 
(sysfs_do_create_link_sd.isra.2+0xb0/0xb8)
   [] (sysfs_do_create_link_sd.isra.2) from [] 
(device_add+0x338/0x520)
   [] (device_add) from [] 
(device_create_groups_vargs+0xa0/0xc4)
   [] (device_create_groups_vargs) from [] 
(device_create+0x24/0x2c)
   [] (device_create) from [] 
(drm_sysfs_connector_add+0x64/0x204)
   [] (drm_sysfs_connector_add) from [] 
(slave_modeset_init+0x120/0x1bc [tilcdc])
   [] (slave_modeset_init [tilcdc]) from [] 
(tilcdc_load+0x214/0x4c0 [tilcdc])
   [] (tilcdc_load [tilcdc]) from [] 
(drm_dev_register+0xa4/0x104)
  [..snip..]
   ---[ end trace 4df8d614936ebdee ]---
   [drm:drm_sysfs_connector_add] *ERROR* failed to register connector device: 
-17

Signed-off-by: Guido Martínez 
Cc: sta...@vger.kernel.org
---
 drivers/gpu/drm/tilcdc/tilcdc_slave.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave.c 
b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
index a37924e..28c8478 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
@@ -176,6 +176,7 @@ struct slave_connector {
 static void slave_connector_destroy(struct drm_connector *connector)
 {
struct slave_connector *slave_connector = to_slave_connector(connector);
+   drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector);
kfree(slave_connector);
 }
-- 
2.0.0.rc2

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


[PATCH 6/9] drm/tilcdc: fix release order on exit

2014-06-06 Thread Guido Martínez
Unregister resources in the correct order on tilcdc_drm_fini, which is
the reverse order they were registered during tilcdc_drm_init.

This also means unregistering the driver before releasing its resources.

Signed-off-by: Guido Martínez 
Cc: sta...@vger.kernel.org
---
 drivers/gpu/drm/tilcdc/tilcdc_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c 
b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index de34657..0644429 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -629,10 +629,10 @@ static int __init tilcdc_drm_init(void)
 static void __exit tilcdc_drm_fini(void)
 {
DBG("fini");
-   tilcdc_tfp410_fini();
-   tilcdc_slave_fini();
-   tilcdc_panel_fini();
platform_driver_unregister(&tilcdc_platform_driver);
+   tilcdc_panel_fini();
+   tilcdc_slave_fini();
+   tilcdc_tfp410_fini();
 }
 
 late_initcall(tilcdc_drm_init);
-- 
2.0.0.rc2

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


[PATCH 4/9] drm/tilcdc: tfp410: fix dangling sysfs connector node

2014-06-06 Thread Guido Martínez
Add a drm_sysfs_connector_remove call when we destroy the panel to make
sure the connector node in sysfs gets deleted.

This is required for proper unload and re-load of this driver, otherwise
we will get a warning about a duplicate filename in sysfs.

Signed-off-by: Guido Martínez 
Cc: sta...@vger.kernel.org
---
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c 
b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
index c38b56b..ce75ac8 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
@@ -167,6 +167,7 @@ struct tfp410_connector {
 static void tfp410_connector_destroy(struct drm_connector *connector)
 {
struct tfp410_connector *tfp410_connector = 
to_tfp410_connector(connector);
+   drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector);
kfree(tfp410_connector);
 }
-- 
2.0.0.rc2

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


[PATCH v2 4/4] ARM: dts: am335x-igep0033: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
Cc: Enric Balletbo i Serra 
---
 arch/arm/boot/dts/am335x-igep0033.dtsi | 38 +-
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi 
b/arch/arm/boot/dts/am335x-igep0033.dtsi
index 9f22c18..9c53b50 100644
--- a/arch/arm/boot/dts/am335x-igep0033.dtsi
+++ b/arch/arm/boot/dts/am335x-igep0033.dtsi
@@ -200,31 +200,31 @@
 
 &usb {
status = "okay";
+};
 
-   control@44e10620 {
-   status = "okay";
-   };
+&usb_ctrl_mod {
+   status = "okay";
+};
 
-   usb-phy@47401300 {
-   status = "okay";
-   };
+&usb0_phy {
+   status = "okay";
+};
 
-   usb-phy@47401b00 {
-   status = "okay";
-   };
+&usb1_phy {
+   status = "okay";
+};
 
-   usb@47401000 {
-   status = "okay";
-   };
+&usb0 {
+   status = "okay";
+};
 
-   usb@47401800 {
-   status = "okay";
-   dr_mode = "host";
-   };
+&usb1 {
+   status = "okay";
+   dr_mode = "host";
+};
 
-   dma-controller@47402000  {
-   status = "okay";
-   };
+&cppi41dma  {
+   status = "okay";
 };
 
 #include "tps65910.dtsi"
-- 
1.9.2

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


[PATCH v2 3/4] ARM: dts: am335x-evmsk: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
---
 arch/arm/boot/dts/am335x-evmsk.dts | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index ab23885..a460c2e 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -363,31 +363,31 @@
 
 &usb {
status = "okay";
+};
 
-   control@44e10620 {
-   status = "okay";
-   };
+&usb_ctrl_mod {
+   status = "okay";
+};
 
-   usb-phy@47401300 {
-   status = "okay";
-   };
+&usb0_phy {
+   status = "okay";
+};
 
-   usb-phy@47401b00 {
-   status = "okay";
-   };
+&usb1_phy {
+   status = "okay";
+};
 
-   usb@47401000 {
-   status = "okay";
-   };
+&usb0 {
+   status = "okay";
+};
 
-   usb@47401800 {
-   status = "okay";
-   dr_mode = "host";
-   };
+&usb1 {
+   status = "okay";
+   dr_mode = "host";
+};
 
-   dma-controller@47402000  {
-   status = "okay";
-   };
+&cppi41dma  {
+   status = "okay";
 };
 
 &epwmss2 {
-- 
1.9.2

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


[PATCH v2 2/4] ARM: dts: am335x-evm: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
---
 arch/arm/boot/dts/am335x-evm.dts | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 6028217..33f7c57 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -330,31 +330,31 @@
 
 &usb {
status = "okay";
+};
 
-   control@44e10620 {
-   status = "okay";
-   };
+&usb_ctrl_mod {
+   status = "okay";
+};
 
-   usb-phy@47401300 {
-   status = "okay";
-   };
+&usb0_phy {
+   status = "okay";
+};
 
-   usb-phy@47401b00 {
-   status = "okay";
-   };
+&usb1_phy {
+   status = "okay";
+};
 
-   usb@47401000 {
-   status = "okay";
-   };
+&usb0 {
+   status = "okay";
+};
 
-   usb@47401800 {
-   status = "okay";
-   dr_mode = "host";
-   };
+&usb1 {
+   status = "okay";
+   dr_mode = "host";
+};
 
-   dma-controller@47402000  {
-   status = "okay";
-   };
+&cppi41dma  {
+   status = "okay";
 };
 
 &i2c1 {
-- 
1.9.2

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


[PATCH v2 1/4] ARM: dts: am335x-bone-common: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
---
 arch/arm/boot/dts/am335x-bone-common.dtsi | 38 +++
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi 
b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 2e7d932..ded1283 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -182,31 +182,31 @@
 
 &usb {
status = "okay";
+};
 
-   control@44e10620 {
-   status = "okay";
-   };
+&usb_ctrl_mod {
+   status = "okay";
+};
 
-   usb-phy@47401300 {
-   status = "okay";
-   };
+&usb0_phy {
+   status = "okay";
+};
 
-   usb-phy@47401b00 {
-   status = "okay";
-   };
+&usb1_phy {
+   status = "okay";
+};
 
-   usb@47401000 {
-   status = "okay";
-   };
+&usb0 {
+   status = "okay";
+};
 
-   usb@47401800 {
-   status = "okay";
-   dr_mode = "host";
-   };
+&usb1 {
+   status = "okay";
+   dr_mode = "host";
+};
 
-   dma-controller@47402000  {
-   status = "okay";
-   };
+&cppi41dma  {
+   status = "okay";
 };
 
 &i2c0 {
-- 
1.9.2

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


Re: [PATCH 1/4] ARM: dts: am335x-bone-common: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
On Mon, Apr 28, 2014 at 08:11:33PM +0530, George Cherian wrote:
> On 4/28/2014 7:28 PM, Guido Martínez wrote:
> >Use phandles instead of unit adresses to reference usb and dma nodes.
> >This makes the DT more robust and readable.
> The series will give dtb build errors
> Error: arch/arm/boot/dts/am335x-bone-common.dtsi:186.2-15 syntax error
> FATAL ERROR: Unable to parse input tree
> Error: arch/arm/boot/dts/am335x-evmsk.dts:367.2-15 syntax error
> FATAL ERROR: Unable to parse input tree
> make[1]: *** [arch/arm/boot/dts/am335x-bone.dtb] Error 1
> make[1]: *** Waiting for unfinished jobs
> Error: arch/arm/boot/dts/am335x-evm.dts:334.2-15 syntax error
> FATAL ERROR: Unable to parse input tree
> make[1]: *** [arch/arm/boot/dts/am335x-evmsk.dtb] Error 1
> make[1]: *** [arch/arm/boot/dts/am335x-evm.dtb] Error 1
> Error: arch/arm/boot/dts/am335x-igep0033.dtsi:204.2-15 syntax error
> FATAL ERROR: Unable to parse input tree
> make[1]: *** [arch/arm/boot/dts/am335x-base0033.dtb] Error 1
> Error: arch/arm/boot/dts/am335x-bone-common.dtsi:186.2-15 syntax error
> FATAL ERROR: Unable to parse input tree
> make[1]: *** [arch/arm/boot/dts/am335x-boneblack.dtb] Error 1
> make: *** [dtbs] Error 2
> 
Terribly sorry about this. I'll send a v2.

> >
> >Signed-off-by: Guido Martínez 
> >---
> >  arch/arm/boot/dts/am335x-bone-common.dtsi | 12 ++--
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> >diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi 
> >b/arch/arm/boot/dts/am335x-bone-common.dtsi
> >index 2e7d932..b95bc9a 100644
> >--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> >+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> >@@ -183,28 +183,28 @@
> >  &usb {
> > status = "okay";
> >-control@44e10620 {
> >+&usb_ctrl_mod {
> > status = "okay";
> > };
> >-usb-phy@47401300 {
> >+&usb0_phy {
> > status = "okay";
> > };
> >-usb-phy@47401b00 {
> >+&usb1_phy {
> > status = "okay";
> > };
> >-usb@47401000 {
> >+&usb0 {
> > status = "okay";
> > };
> >-usb@47401800 {
> >+&usb1 {
> > status = "okay";
> > dr_mode = "host";
> > };
> >-dma-controller@47402000  {
> >+&cppi41dma  {
> > status = "okay";
> > };
> >  };
> Instead the patch should be
> 
>  diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi
> b/arch/arm/boot/dts/am335x-bone-common.dtsi
>  index 2e7d932..06be20a 100644
>  --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
>  +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
>  @@ -182,31 +182,30 @@
> 
>   &usb {
>  status = "okay";
>  +};
>  +&usb_ctrl_mod {
>  +   status = "okay";
>  +};
> 
>  -   control@44e10620 {
>  -   status = "okay";
>  -   };
>  -
>  -   usb-phy@47401300 {
>  -   status = "okay";
>  -   };
>  +&usb0_phy {
>  +   status = "okay";
>  +};
> 
>  -   usb-phy@47401b00 {
>  -   status = "okay";
>  -   };
>  +&usb1_phy {
>  +   status = "okay";
>  +};
> 
>  -   usb@47401000 {
>  -   status = "okay";
>  -   };
>  +&usb {
>  +   status = "okay";
>  +};
> 
>  -   usb@47401800 {
>  -   status = "okay";
>  -   dr_mode = "host";
>  -   };
>  +&usb1 {
>  +   status = "okay";
>  +   dr_mode = "host";
>  +};
> 
>  -   dma-controller@47402000  {
>  -   status = "okay";
>  -   };
>  +&cppi41dma  {
>  +   status = "okay";
>   };
> 
> 
> 
> -- 
> -George
> 

-- 
Guido Martínez, VanguardiaSur
www.vanguardiasur.com.ar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] ARM: dts: am335x-evm: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
---
 arch/arm/boot/dts/am335x-evm.dts | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 6028217..e802627 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -331,28 +331,28 @@
 &usb {
status = "okay";
 
-   control@44e10620 {
+   &usb_ctrl_mod {
status = "okay";
};
 
-   usb-phy@47401300 {
+   &usb0_phy {
status = "okay";
};
 
-   usb-phy@47401b00 {
+   &usb1_phy {
status = "okay";
};
 
-   usb@47401000 {
+   &usb0 {
status = "okay";
};
 
-   usb@47401800 {
+   &usb1 {
status = "okay";
dr_mode = "host";
};
 
-   dma-controller@47402000  {
+   &cppi41dma  {
status = "okay";
};
 };
-- 
1.9.2

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


[PATCH 3/4] ARM: dts: am335x-evmsk: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
---
 arch/arm/boot/dts/am335x-evmsk.dts | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index ab23885..44b8d75 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -364,28 +364,28 @@
 &usb {
status = "okay";
 
-   control@44e10620 {
+   &usb_ctrl_mod {
status = "okay";
};
 
-   usb-phy@47401300 {
+   &usb0_phy {
status = "okay";
};
 
-   usb-phy@47401b00 {
+   &usb1_phy {
status = "okay";
};
 
-   usb@47401000 {
+   &usb0 {
status = "okay";
};
 
-   usb@47401800 {
+   &usb1 {
status = "okay";
dr_mode = "host";
};
 
-   dma-controller@47402000  {
+   &cppi41dma  {
status = "okay";
};
 };
-- 
1.9.2

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


[PATCH 4/4] ARM: dts: am335x-igep0033: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
---
 arch/arm/boot/dts/am335x-igep0033.dtsi | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi 
b/arch/arm/boot/dts/am335x-igep0033.dtsi
index 9f22c18..81cf68b 100644
--- a/arch/arm/boot/dts/am335x-igep0033.dtsi
+++ b/arch/arm/boot/dts/am335x-igep0033.dtsi
@@ -201,28 +201,28 @@
 &usb {
status = "okay";
 
-   control@44e10620 {
+   &usb_ctrl_mod {
status = "okay";
};
 
-   usb-phy@47401300 {
+   &usb0_phy {
status = "okay";
};
 
-   usb-phy@47401b00 {
+   &usb1_phy {
status = "okay";
};
 
-   usb@47401000 {
+   &usb0 {
status = "okay";
};
 
-   usb@47401800 {
+   &usb1 {
status = "okay";
dr_mode = "host";
};
 
-   dma-controller@47402000  {
+   &cppi41dma  {
status = "okay";
};
 };
-- 
1.9.2

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


[PATCH 1/4] ARM: dts: am335x-bone-common: use phandles for USB and DMA refs

2014-04-28 Thread Guido Martínez
Use phandles instead of unit adresses to reference usb and dma nodes.
This makes the DT more robust and readable.

Signed-off-by: Guido Martínez 
---
 arch/arm/boot/dts/am335x-bone-common.dtsi | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi 
b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 2e7d932..b95bc9a 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -183,28 +183,28 @@
 &usb {
status = "okay";
 
-   control@44e10620 {
+   &usb_ctrl_mod {
status = "okay";
};
 
-   usb-phy@47401300 {
+   &usb0_phy {
status = "okay";
};
 
-   usb-phy@47401b00 {
+   &usb1_phy {
status = "okay";
};
 
-   usb@47401000 {
+   &usb0 {
status = "okay";
};
 
-   usb@47401800 {
+   &usb1 {
status = "okay";
dr_mode = "host";
};
 
-   dma-controller@47402000  {
+   &cppi41dma  {
status = "okay";
};
 };
-- 
1.9.2

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