Re: [PATCH] ARM: OMAP2+: Use handle_fasteoi_irq for INTC interrupt handling

2014-03-01 Thread Sørensen , Stefan
On Fri, 2014-02-28 at 09:11 -0800, Tony Lindgren wrote:
> * Stefan Sørensen  [140224 02:12]:
> > Currently INTC interrupts are handled using handle_level_irq which
> > will acknowledge the interrupt before running the handler. If a second
> > interrupt is then asserted and this interrupt is disabled while
> > running the first handler, the INTC will be brought into an
> > inconsistent state.
> 
> Hmm care to explain a bit more here if the second interrupt you're
> talking about is the same interrupt or any interrupt in the same
> interrupt bank? Is this limited to GPIO interrupts?

I am seeing it with the cpsw driver on a custom board and on the
beaglebone. When a tx irq is handled the cpsw irq handler disables both
the tx and the rx irqs, and if the rx irq was also asserted (i.e. duplex
traffic), this bug will trigger. Reproducing it is very simple, just hit
a beaglebone with a flood ping and watch a function trace.

Applying this patch I see a significant performance boost on duplex
traffic. An iperf full duplex test gives a 50-100% increase in receive
bandwidth - it now fully saturates a 100Mb interface, so the increase
might be even larger with a gigabit interface.

> The reason I'm asking is because of the issues we've seen earlier
> with not flushing posted writes from the interrupt handlers. In
> those case the interrupt on the device gets acked too late without
> the read back call.

I am not very familiar with the low level details of the irq handling,  
but am335x TRM states that a data synchronization barrier should be used
after the ACK is posted to the INTC, and I don't see that anywhere in
the code. Is this related?

Stefan



[PATCH v2 0/7] ARM: dts: omap3-gta04: Various devicetree updates

2014-03-01 Thread Marek Belisko
This updated series fix issue with proper gta04 booting in 3.14 kernel
and add various devices to devicetree.

Changes from V1: 
- removed fixes which was merged to 3.14 already
- add bma180 accelerometer + booting fix

Marek Belisko (2):
  ARM: dts: omap3-gta04: Add ti,omap36xx to compatible property to avoid
problems with booting
  ARM: dts: omap3-gta04: Add touchscreen properties

NeilBrown (5):
  ARM: dts: omap3-gta04: Add support for magnetometer
  ARM: dts: omap3-gta04: Add twl4030 charger
  ARM: dts: omap3-gta04: Add basic sound support
  ARM: dts: omap3-gta04: Enable mmc2 for wifi
  ARM: dts: omap3-gta04: Add bma180 accelerometer

 arch/arm/boot/dts/omap3-gta04.dts | 53 +--
 1 file changed, 51 insertions(+), 2 deletions(-)

-- 
1.8.3.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 7/7] ARM: dts: omap3-gta04: Add bma180 accelerometer

2014-03-01 Thread Marek Belisko
From: NeilBrown 

Add node for bma180 driver.

Signed-off-by: NeilBrown 
---
 arch/arm/boot/dts/omap3-gta04.dts | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-gta04.dts 
b/arch/arm/boot/dts/omap3-gta04.dts
index d556e3a..f8ad125 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -110,6 +110,14 @@
interrupts = <17 IRQ_TYPE_EDGE_RISING>;
};
 
+   /* accelerometer */
+   bma180@41 {
+   compatible = "bosch,bma180";
+   reg = <0x41>;
+   interrupt-parent = <&gpio3>;
+   interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
+   };
+
/* leds */
tca6507@45 {
compatible = "ti,tca6507";
-- 
1.8.3.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/7] ARM: dts: omap3-gta04: Add ti,omap36xx to compatible property to avoid problems with booting

2014-03-01 Thread Marek Belisko
Without that change booting leads to crash with more warnings like below:
[0.284454] omap_hwmod: uart4: cannot clk_get main_clk uart4_fck
[0.284484] omap_hwmod: uart4: cannot _init_clocks
[0.284484] [ cut here ]
[0.284545] WARNING: CPU: 0 PID: 1 at arch/arm/mach-omap2/omap_hwmod.c:2543 
_init+0x300/0x3e4()
[0.284545] omap_hwmod: uart4: couldn't init clocks
[0.284576] Modules linked in:
[0.284606] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 
3.13.0-next-20140124-00020-gd2aefec-dirty #26
[0.284637] [] (unwind_backtrace) from [] 
(show_stack+0x10/0x14)
[0.284667] [] (show_stack) from [] 
(dump_stack+0x7c/0x94)
[0.284729] [] (dump_stack) from [] 
(warn_slowpath_common+0x6c/0x90)
[0.284729] [] (warn_slowpath_common) from [] 
(warn_slowpath_fmt+0x30/0x40)
[0.284759] [] (warn_slowpath_fmt) from [] 
(_init+0x300/0x3e4)
[0.284790] [] (_init) from [] 
(__omap_hwmod_setup_all+0x40/0x8c)
[0.284820] [] (__omap_hwmod_setup_all) from [] 
(do_one_initcall+0xe8/0x14c)
[0.284851] [] (do_one_initcall) from [] 
(kernel_init_freeable+0x104/0x1c8)
[0.284881] [] (kernel_init_freeable) from [] 
(kernel_init+0x8/0x118)
[0.284912] [] (kernel_init) from [] 
(ret_from_fork+0x14/0x2c)
[0.285064] ---[ end trace 63de210ad43b627d ]---

Reference:
https://lkml.org/lkml/2013/10/8/553

Signed-off-by: Marek Belisko 
---
 arch/arm/boot/dts/omap3-gta04.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3-gta04.dts 
b/arch/arm/boot/dts/omap3-gta04.dts
index c551e4a..d3b253b 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -13,7 +13,7 @@
 
 / {
model = "OMAP3 GTA04";
-   compatible = "ti,omap3-gta04", "ti,omap3";
+   compatible = "ti,omap3-gta04", "ti,omap36xx", "ti,omap3";
 
cpus {
cpu@0 {
-- 
1.8.3.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/7] ARM: dts: omap3-gta04: Add support for magnetometer

2014-03-01 Thread Marek Belisko
From: NeilBrown 

Add magnetometer hmc5843 node.

Signed-off-by: NeilBrown 
Signed-off-by: Marek Belisko 
---
 arch/arm/boot/dts/omap3-gta04.dts | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-gta04.dts 
b/arch/arm/boot/dts/omap3-gta04.dts
index d3b253b..d9917b8 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -124,6 +124,12 @@
reg = <0x4>;
};
};
+
+   /* compass aka magnetometer */
+   hmc5843@1e {
+   compatible = "honeywell,hmc5843";
+   reg = <0x1e>;
+   };
 };
 
 &i2c3 {
-- 
1.8.3.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 4/7] ARM: dts: omap3-gta04: Add twl4030 charger

2014-03-01 Thread Marek Belisko
From: NeilBrown 

Define twl4030 charger node used for charging.

Signed-off-by: Marek Belisko 
---
 arch/arm/boot/dts/omap3-gta04.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-gta04.dts 
b/arch/arm/boot/dts/omap3-gta04.dts
index 7f29315..42fc12e 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -186,3 +186,7 @@
pinctrl-0 = <&uart3_pins>;
 };
 
+&charger {
+   bb_uvolt = <320>;
+   bb_uamp = <150>;
+};
-- 
1.8.3.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 6/7] ARM: dts: omap3-gta04: Enable mmc2 for wifi

2014-03-01 Thread Marek Belisko
From: NeilBrown 

This requires vaux4.

Reset line isn't used yet, so wifi isn't reliable.
But it does work once per boot.

Signed-off-by: NeilBrown 
Signed-off-by: Marek Belisko 
---
 arch/arm/boot/dts/omap3-gta04.dts | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3-gta04.dts 
b/arch/arm/boot/dts/omap3-gta04.dts
index 41a21bd..d556e3a 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -178,7 +178,9 @@
 };
 
 &mmc2 {
-   status = "disabled";
+   vmmc-supply = <&vaux4>;
+   bus-width = <4>;
+   ti,non-removable;
 };
 
 &mmc3 {
@@ -204,3 +206,8 @@
bb_uvolt = <320>;
bb_uamp = <150>;
 };
+
+&vaux4 {
+   regulator-min-microvolt = <280>;
+   regulator-max-microvolt = <315>;
+};
-- 
1.8.3.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 5/7] ARM: dts: omap3-gta04: Add basic sound support

2014-03-01 Thread Marek Belisko
From: NeilBrown 

This adds basic sound support for gta04 board.

Signed-off-by: NeilBrown 
Signed-off-by: Marek Belisko 
---
 arch/arm/boot/dts/omap3-gta04.dts | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-gta04.dts 
b/arch/arm/boot/dts/omap3-gta04.dts
index 42fc12e..41a21bd 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -36,6 +36,14 @@
gpio-key,wakeup;
};
};
+
+   sound {
+   compatible = "ti,omap-twl4030";
+   ti,model = "gta04";
+
+   ti,mcbsp = <&mcbsp2>;
+   ti,codec = <&twl_audio>;
+   };
 };
 
 &omap3_pmx_core {
@@ -80,6 +88,12 @@
interrupts = <7>; /* SYS_NIRQ cascaded to intc */
interrupt-parent = <&intc>;
};
+
+   twl_audio: audio {
+   compatible = "ti,twl4030-audio";
+   codec {
+   };
+   };
 };
 
 #include "twl4030.dtsi"
-- 
1.8.3.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/7] ARM: dts: omap3-gta04: Add touchscreen properties

2014-03-01 Thread Marek Belisko
Gta04 using tcs2007 touchscreen. Add support for that.

Signed-off-by: Marek Belisko 
---
 arch/arm/boot/dts/omap3-gta04.dts | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-gta04.dts 
b/arch/arm/boot/dts/omap3-gta04.dts
index d9917b8..7f29315 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -130,6 +130,16 @@
compatible = "honeywell,hmc5843";
reg = <0x1e>;
};
+
+   /* touchscreen */
+   tsc2007@48 {
+   compatible = "ti,tsc2007";
+   reg = <0x48>;
+   interrupt-parent = <&gpio6>;
+   interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+   gpios = <&gpio6 0 GPIO_ACTIVE_LOW>;
+   ti,x-plate-ohms = <600>;
+   };
 };
 
 &i2c3 {
-- 
1.8.3.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] sound: omap: n810: fix init with DT boot

2014-03-01 Thread Aaro Koskinen
Since 3.14-rc1 only DT boot has been supported on N810. Make a minimal
fix to retain functionality. This file should be properly converted
to DT in longer term.

Signed-off-by: Aaro Koskinen 
---
 sound/soc/omap/n810.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index 3fde9e4..d163e18 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -305,7 +305,9 @@ static int __init n810_soc_init(void)
int err;
struct device *dev;
 
-   if (!(machine_is_nokia_n810() || machine_is_nokia_n810_wimax()))
+   if (!of_have_populated_dt() ||
+   (!of_machine_is_compatible("nokia,n810") &&
+!of_machine_is_compatible("nokia,n810-wimax")))
return -ENODEV;
 
n810_snd_device = platform_device_alloc("soc-audio", -1);
-- 
1.8.3.3

--
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 v4 3/4] ARM: OMAP2+: add legacy display for omap3 DBB056

2014-03-01 Thread Christoph Fritz
On Fri, 2014-02-28 at 14:38 -0800, Tony Lindgren wrote:
> * Tomi Valkeinen  [140214 06:38]:
> > git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git work/dss-dt
> > 
> > That way you have it ready and tested if DSS DT goes forward.
> 
> Applying only patches 1 & 2 into omap-for-v3.15/dt thanks.

I'll send a display support patch as soon as DSS DT is in linux-next.

 Thanks
  -- Christoph

--
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: [PATCHv2] ARM: OMAP2+: Add support for thumb mode on DT booted N900

2014-03-01 Thread Pali Rohár
2014-02-17 22:30 GMT+01:00 Sebastian Reichel :
> Without enabling the workaround for ARM errata 430973 thumb
> compiled userland crashes randomly on the Nokia N900.
>
> Signed-off-by: Sebastian Reichel 
> Reviewed-by: Pavel Machek 
> ---
> Hi,
>
> This is PATCHv2 for the thumb errata workaround for N900 DT
> boot, which should go into 3.14-rc.
>
> Changes since PATCHv1:
>  * Add Reviewed-By: Pavel Machek
>  * Add more verbose warning about the errata as suggested by Pavel
>
> I did not increase the verbose level, since the next higher verbose
> level is pr_err and the message is not an error.
>
> I think it would make sense to update the Kconfig entry for the errata to
> enable the workaround by default for the Nokia N900. That should be done in
> its own patch, though.
>
> Apart from that it would be nice if errata workaround could be enabled
> via DeviceTree instead of kernel configuration. This will require some
> discussion though, so I think we should start with this patch for now.
>
> -- Sebastian
> ---
>  arch/arm/mach-omap2/pdata-quirks.c | 20 +++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
> b/arch/arm/mach-omap2/pdata-quirks.c
> index 3d5b24d..0cc710d 100644
> --- a/arch/arm/mach-omap2/pdata-quirks.c
> +++ b/arch/arm/mach-omap2/pdata-quirks.c
> @@ -22,6 +22,8 @@
>  #include "common-board-devices.h"
>  #include "dss-common.h"
>  #include "control.h"
> +#include "omap-secure.h"
> +#include "soc.h"
>
>  struct pdata_init {
> const char *compatible;
> @@ -169,6 +171,22 @@ static void __init am3517_evm_legacy_init(void)
> omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
> omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
>  }
> +
> +static void __init nokia_n900_legacy_init(void)
> +{
> +   hsmmc2_internal_input_clk();
> +
> +   if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
> +   if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
> +   pr_info("RX-51: Enabling ARM errata 430973 
> workaround\n");
> +   /* set IBE to 1 */
> +   rx51_secure_update_aux_cr(BIT(6), 0);
> +   } else {
> +   pr_warning("RX-51: Not enabling ARM errata 430973 
> workaround\n");
> +   pr_warning("Thumb binaries may crash randomly without 
> this workaround\n");
> +   }
> +   }
> +}
>  #endif /* CONFIG_ARCH_OMAP3 */
>
>  #ifdef CONFIG_ARCH_OMAP4
> @@ -259,7 +277,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
>  static struct pdata_init pdata_quirks[] __initdata = {
>  #ifdef CONFIG_ARCH_OMAP3
> { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
> -   { "nokia,omap3-n900", hsmmc2_internal_input_clk, },
> +   { "nokia,omap3-n900", nokia_n900_legacy_init, },
> { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
> { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
> { "isee,omap3-igep0020", omap3_igep0020_legacy_init, },
> --
> 1.8.5.3
>

Hello,

now when this patch was accepted and there is secure code for rx51,
what about adding hwrng secure code?
Non DT version is here:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d2065e2b5bb3ec986f0f3ba044a81a136767d0b4
I think it could be simple to register needed driver when omap type is
OMAP2_DEVICE_TYPE_SEC.

-- 
Pali Rohár
pali.ro...@gmail.com
--
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: [PATCHv4 4/7] hwspinlock/core: add common OF helpers

2014-03-01 Thread Ohad Ben-Cohen
On Mon, Feb 10, 2014 at 9:14 PM, Suman Anna  wrote:
> On 02/07/2014 04:49 PM, Bjorn Andersson wrote:
>> It seems to be standard practice to pass the error value back to the
>> consumer, so you should
>> return ERR_PTR(ret); here instead of the NULL...
>
>
> I have modelled the return values in this function based on the return
> values in the existing hwspin_lock_request interfaces. I would need to
> change those functions as well.
>
> Ohad,
> Do you have any objections to the return code convention change?

Unless strictly needed, I prefer we don't switch to the ERR_PTR code
convention, as it reduces code readability and increases chances of
user bugs.

In our case, switching to ERR_PTR and friends seems only to optimize a
few error paths, and I'm not sure it's a big win over simplicity.

Thanks,
Ohad.
--
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