[no subject]

2012-12-29 Thread steve.zhan
Hi,

It is good idea add this feature.

1: Can we let the ret = hwspin_lock_tests(ops, hwlock); add after
hwspin_lock_register_single have return
succeed, that can avoid test duplicated Or error lockid. Of course, If
this interface is intend to test soc hardware capability only, we can
put it in the arch module not this core framework. For driver hardware
sanity check, i would add it after software have register it.


2:Is it possible that interface add configs that choose which locks
will be test? Because the hwspinlock module is init late in
postcore_initcall phase, Maybe MACH/ARCH code(for example: code in
early_initcall) need use private other interfaces to lock some
hwspinlocks and then register hw locks to hwspinlock framework, Maybe
some hw locks is in lock status but which test failed.




-- 
Steve Zhan


 From: Ido Yariv i...@wizery.com
 To: Ohad Ben-Cohen o...@wizery.com, linux-ker...@vger.kernel.org,
   linux-arm-ker...@lists.infradead.org, linux-omap@vger.kernel.org
 Cc: Ido Yariv i...@wizery.com
 Subject: [PATCH] hwspinlock/core: Add testing capabilities
 Message-ID: 1355344026-17222-1-git-send-email-...@wizery.com

 Add testing capabilities for verifying correctness of the underlying
 hwspinlock layers. This can be handy especially during development.
 These tests are performed only once as part of the hwspinlock
 registration.

 Signed-off-by: Ido Yariv i...@wizery.com
 ---
  drivers/hwspinlock/Kconfig   |9 +
  drivers/hwspinlock/hwspinlock_core.c |   54
 ++
  2 files changed, 63 insertions(+), 0 deletions(-)

 diff --git a/drivers/hwspinlock/Kconfig b/drivers/hwspinlock/Kconfig
 index c7c3128..ad632cd 100644
 --- a/drivers/hwspinlock/Kconfig
 +++ b/drivers/hwspinlock/Kconfig
 @@ -8,6 +8,15 @@ config HWSPINLOCK

  menu Hardware Spinlock drivers

 +config HWSPINLOCK_TEST
 + bool Verify underlying hwspinlock implementation
 + depends on HWSPINLOCK
 + help
 +   Say Y here to perform tests on the underlying hwspinlock
 +   implementation. The tests are only performed once per implementation.
 +
 +   Say N, unless you absolutely know what you are doing.
 +
  config HWSPINLOCK_OMAP
   tristate OMAP Hardware Spinlock device
   depends on ARCH_OMAP4
 diff --git a/drivers/hwspinlock/hwspinlock_core.c
 b/drivers/hwspinlock/hwspinlock_core.c
 index 085e28e..1874e85 100644
 --- a/drivers/hwspinlock/hwspinlock_core.c
 +++ b/drivers/hwspinlock/hwspinlock_core.c
 @@ -307,6 +307,53 @@ out:
   return hwlock;
  }

 +#ifdef CONFIG_HWSPINLOCK_TEST
 +#define NUM_OF_TEST_ITERATIONS 100
 +static int hwspin_lock_tests(const struct hwspinlock_ops *ops,
 +  struct hwspinlock *hwlock)
 +{
 + int i;
 + int ret;
 +
 + for (i = 0; i  NUM_OF_TEST_ITERATIONS; i++) {
 + ret = ops-trylock(hwlock);
 + if (!ret) {
 + pr_err(%s: Initial lock failed\n, __func__);
 + return -EFAULT;
 + }
 +
 + /* Verify lock actually works - re-acquiring it should fail */
 + ret = ops-trylock(hwlock);
 + if (ret) {
 + /* Keep locks balanced even in failure cases */
 + ops-unlock(hwlock);
 + ops-unlock(hwlock);
 + pr_err(%s: Recursive lock succeeded unexpectedly\n,
 +__func__);
 + return -EFAULT;
 + }
 +
 + /* Verify unlock by re-acquiring the lock after releasing it */
 + ops-unlock(hwlock);
 + ret = ops-trylock(hwlock);
 + if (!ret) {
 + pr_err(%s: Unlock failed\n, __func__);
 + return -EINVAL;
 + }
 +
 + ops-unlock(hwlock);
 + }
 +
 + return 0;
 +}
 +#else /* CONFIG_HWSPINLOCK_TEST*/
 +static int hwspin_lock_tests(const struct hwspinlock_ops *ops,
 +  struct hwspinlock *hwlock)
 +{
 + return 0;
 +}
 +#endif
 +
  /**
   * hwspin_lock_register() - register a new hw spinlock device
   * @bank: the hwspinlock device, which usually provides numerous hw locks
 @@ -345,6 +392,13 @@ int hwspin_lock_register(struct hwspinlock_device
 *bank, struct device *dev,
   spin_lock_init(hwlock-lock);
   hwlock-bank = bank;

 + ret = hwspin_lock_tests(ops, hwlock);
 + if (ret) {
 + pr_err(hwspinlock tests failed on lock %d\n,
 +base_id + i);
 + goto reg_failed;
 + }
 +
   ret = hwspin_lock_register_single(hwlock, base_id + i);
   if (ret)
   goto reg_failed;
 --
 1.7.7.6
--
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] hwspinlock/core: Add testing capabilities

2012-12-29 Thread steve.zhan
Hi,

It is good idea add this feature.

1: Can we let the ret = hwspin_lock_tests(ops, hwlock); add after
hwspin_lock_register_single have return
succeed, that can avoid test duplicated Or error lockid. Of course, If
this interface is intend to test soc hardware capability only, we can
put it in the arch module not this core framework. For driver hardware
sanity check, i would add it after software have register it.


2:Is it possible that interface add configs that choose which locks
will be test? Because the hwspinlock module is init late in
postcore_initcall phase, Maybe MACH/ARCH code(for example: code in
early_initcall) need use private other interfaces to lock some
hwspinlocks and then register hw locks to hwspinlock framework, Maybe
some hw locks is in lock status but which test failed.




-- 
Steve Zhan


 From: Ido Yariv i...@wizery.com
 To: Ohad Ben-Cohen o...@wizery.com, linux-ker...@vger.kernel.org,
   linux-arm-ker...@lists.infradead.org, linux-omap@vger.kernel.org
 Cc: Ido Yariv i...@wizery.com
 Subject: [PATCH] hwspinlock/core: Add testing capabilities
 Message-ID: 1355344026-17222-1-git-send-email-...@wizery.com

 Add testing capabilities for verifying correctness of the underlying
 hwspinlock layers. This can be handy especially during development.
 These tests are performed only once as part of the hwspinlock
 registration.

 Signed-off-by: Ido Yariv i...@wizery.com
 ---
  drivers/hwspinlock/Kconfig   |9 +
  drivers/hwspinlock/hwspinlock_core.c |   54
 ++
  2 files changed, 63 insertions(+), 0 deletions(-)

 diff --git a/drivers/hwspinlock/Kconfig b/drivers/hwspinlock/Kconfig
 index c7c3128..ad632cd 100644
 --- a/drivers/hwspinlock/Kconfig
 +++ b/drivers/hwspinlock/Kconfig
 @@ -8,6 +8,15 @@ config HWSPINLOCK

  menu Hardware Spinlock drivers

 +config HWSPINLOCK_TEST
 + bool Verify underlying hwspinlock implementation
 + depends on HWSPINLOCK
 + help
 +   Say Y here to perform tests on the underlying hwspinlock
 +   implementation. The tests are only performed once per implementation.
 +
 +   Say N, unless you absolutely know what you are doing.
 +
  config HWSPINLOCK_OMAP
   tristate OMAP Hardware Spinlock device
   depends on ARCH_OMAP4
 diff --git a/drivers/hwspinlock/hwspinlock_core.c
 b/drivers/hwspinlock/hwspinlock_core.c
 index 085e28e..1874e85 100644
 --- a/drivers/hwspinlock/hwspinlock_core.c
 +++ b/drivers/hwspinlock/hwspinlock_core.c
 @@ -307,6 +307,53 @@ out:
   return hwlock;
  }

 +#ifdef CONFIG_HWSPINLOCK_TEST
 +#define NUM_OF_TEST_ITERATIONS 100
 +static int hwspin_lock_tests(const struct hwspinlock_ops *ops,
 +  struct hwspinlock *hwlock)
 +{
 + int i;
 + int ret;
 +
 + for (i = 0; i  NUM_OF_TEST_ITERATIONS; i++) {
 + ret = ops-trylock(hwlock);
 + if (!ret) {
 + pr_err(%s: Initial lock failed\n, __func__);
 + return -EFAULT;
 + }
 +
 + /* Verify lock actually works - re-acquiring it should fail */
 + ret = ops-trylock(hwlock);
 + if (ret) {
 + /* Keep locks balanced even in failure cases */
 + ops-unlock(hwlock);
 + ops-unlock(hwlock);
 + pr_err(%s: Recursive lock succeeded unexpectedly\n,
 +__func__);
 + return -EFAULT;
 + }
 +
 + /* Verify unlock by re-acquiring the lock after releasing it */
 + ops-unlock(hwlock);
 + ret = ops-trylock(hwlock);
 + if (!ret) {
 + pr_err(%s: Unlock failed\n, __func__);
 + return -EINVAL;
 + }
 +
 + ops-unlock(hwlock);
 + }
 +
 + return 0;
 +}
 +#else /* CONFIG_HWSPINLOCK_TEST*/
 +static int hwspin_lock_tests(const struct hwspinlock_ops *ops,
 +  struct hwspinlock *hwlock)
 +{
 + return 0;
 +}
 +#endif
 +
  /**
   * hwspin_lock_register() - register a new hw spinlock device
   * @bank: the hwspinlock device, which usually provides numerous hw locks
 @@ -345,6 +392,13 @@ int hwspin_lock_register(struct hwspinlock_device
 *bank, struct device *dev,
   spin_lock_init(hwlock-lock);
   hwlock-bank = bank;

 + ret = hwspin_lock_tests(ops, hwlock);
 + if (ret) {
 + pr_err(hwspinlock tests failed on lock %d\n,
 +base_id + i);
 + goto reg_failed;
 + }
 +
   ret = hwspin_lock_register_single(hwlock, base_id + i);
   if (ret)
   goto reg_failed;
 --
 1.7.7.6
--
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: OMAP2+: omap_device: remove obsolete pm_lats and early_device code

2012-12-29 Thread Paul Walmsley

Remove now-obsolete code from arch/arm/mach-omap2/omap_device.c.  This
mostly consists of removing the first attempt at device PM latency
handling.  This was never really used, has been replaced by the common
dev_pm_qos code, and needs to go away as part of the DT conversion.
Also, the early platform_device creation code has been removed, as it
does not appear to be used.

Signed-off-by: Paul Walmsley p...@pwsan.com
Cc: Kevin Hilman khil...@deeprootsystems.com
---
 arch/arm/mach-omap2/am35xx-emac.c |2 +-
 arch/arm/mach-omap2/devices.c |   25 +-
 arch/arm/mach-omap2/display.c |2 +-
 arch/arm/mach-omap2/dma.c |2 +-
 arch/arm/mach-omap2/drm.c |3 +-
 arch/arm/mach-omap2/gpio.c|3 +-
 arch/arm/mach-omap2/gpmc.c|2 +-
 arch/arm/mach-omap2/hdq1w.c   |2 +-
 arch/arm/mach-omap2/hsmmc.c   |2 +-
 arch/arm/mach-omap2/hwspinlock.c  |3 +-
 arch/arm/mach-omap2/i2c.c |3 +-
 arch/arm/mach-omap2/mcbsp.c   |2 +-
 arch/arm/mach-omap2/msdi.c|2 +-
 arch/arm/mach-omap2/omap-iommu.c  |3 +-
 arch/arm/mach-omap2/omap_device.c |  537 -
 arch/arm/mach-omap2/omap_device.h |   79 +-
 arch/arm/mach-omap2/pm.c  |4 +-
 arch/arm/mach-omap2/pmu.c |3 +-
 arch/arm/mach-omap2/serial.c  |3 +-
 arch/arm/mach-omap2/sr_device.c   |3 +-
 arch/arm/mach-omap2/timer.c   |3 +-
 arch/arm/mach-omap2/usb-host.c|   16 +-
 arch/arm/mach-omap2/usb-musb.c|2 +-
 arch/arm/mach-omap2/wd_timer.c|3 +-
 24 files changed, 99 insertions(+), 610 deletions(-)

diff --git a/arch/arm/mach-omap2/am35xx-emac.c 
b/arch/arm/mach-omap2/am35xx-emac.c
index af11dcd..a00d391 100644
--- a/arch/arm/mach-omap2/am35xx-emac.c
+++ b/arch/arm/mach-omap2/am35xx-emac.c
@@ -63,7 +63,7 @@ static int __init omap_davinci_emac_dev_init(struct 
omap_hwmod *oh,
struct platform_device *pdev;
 
pdev = omap_device_build(oh-class-name, 0, oh, pdata, pdata_len,
-NULL, 0, false);
+false);
if (IS_ERR(pdev)) {
WARN(1, Can't build omap_device for %s:%s.\n,
 oh-class-name, oh-name);
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 5e304d0..2b71352 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -61,8 +61,7 @@ static int __init omap3_l3_init(void)
if (!oh)
pr_err(could not look up %s\n, oh_name);
 
-   pdev = omap_device_build(omap_l3_smx, 0, oh, NULL, 0,
-  NULL, 0, 0);
+   pdev = omap_device_build(omap_l3_smx, 0, oh, NULL, 0);
 
WARN(IS_ERR(pdev), could not build omap_device for %s\n, oh_name);
 
@@ -96,8 +95,7 @@ static int __init omap4_l3_init(void)
pr_err(could not look up %s\n, oh_name);
}
 
-   pdev = omap_device_build_ss(omap_l3_noc, 0, oh, 3, NULL,
-0, NULL, 0, 0);
+   pdev = omap_device_build_ss(omap_l3_noc, 0, oh, 3, NULL, 0);
 
WARN(IS_ERR(pdev), could not build omap_device for %s\n, oh_name);
 
@@ -273,7 +271,7 @@ int __init omap4_keyboard_init(struct 
omap4_keypad_platform_data
keypad_data = sdp4430_keypad_data;
 
pdev = omap_device_build(name, id, oh, keypad_data,
-   sizeof(struct omap4_keypad_platform_data), NULL, 0, 0);
+sizeof(struct omap4_keypad_platform_data));
 
if (IS_ERR(pdev)) {
WARN(1, Can't build omap_device for %s:%s.\n,
@@ -297,7 +295,7 @@ static inline void __init omap_init_mbox(void)
return;
}
 
-   pdev = omap_device_build(omap-mailbox, -1, oh, NULL, 0, NULL, 0, 0);
+   pdev = omap_device_build(omap-mailbox, -1, oh, NULL, 0);
WARN(IS_ERR(pdev), %s: could not build device, err %ld\n,
__func__, PTR_ERR(pdev));
 }
@@ -337,7 +335,7 @@ static void __init omap_init_mcpdm(void)
return;
}
 
-   pdev = omap_device_build(omap-mcpdm, -1, oh, NULL, 0, NULL, 0, 0);
+   pdev = omap_device_build(omap-mcpdm, -1, oh, NULL, 0);
WARN(IS_ERR(pdev), Can't build omap_device for omap-mcpdm.\n);
 }
 #else
@@ -358,7 +356,7 @@ static void __init omap_init_dmic(void)
return;
}
 
-   pdev = omap_device_build(omap-dmic, -1, oh, NULL, 0, NULL, 0, 0);
+   pdev = omap_device_build(omap-dmic, -1, oh, NULL, 0);
WARN(IS_ERR(pdev), Can't build omap_device for omap-dmic.\n);
 }
 #else
@@ -384,8 +382,7 @@ static void __init omap_init_hdmi_audio(void)
return;
}
 
-   pdev = omap_device_build(omap-hdmi-audio-dai,
-   -1, oh, NULL, 0, NULL, 0, 0);
+   pdev = omap_device_build(omap-hdmi-audio-dai, -1, oh, NULL, 0, 0);
 

[PATCH] ARM: dts: omap3-igep: Add fixed always-on regulators to common dtsi file

2012-12-29 Thread Ezequiel Garcia
These regulators are common to igep0020 and igep0030 boards
and are needed by smsc911x controller.

Cc: BenoƮt Cousson b-cous...@ti.com
Cc: Tony Lindgren t...@atomide.com
Cc: Enric Balletbo i Serra eballe...@gmail.com
Cc: Javier Martinez Canillas jav...@dowhile0.org
Signed-off-by: Ezequiel Garcia ezequiel.gar...@free-electrons.com
---
 arch/arm/boot/dts/omap3-igep.dtsi |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-igep.dtsi 
b/arch/arm/boot/dts/omap3-igep.dtsi
index dd01c46..91a42ce 100644
--- a/arch/arm/boot/dts/omap3-igep.dtsi
+++ b/arch/arm/boot/dts/omap3-igep.dtsi
@@ -24,6 +24,18 @@
ti,mcbsp = mcbsp2;
ti,codec = twl_audio;
};
+
+vddvario: regulator-vddvario {
+compatible = regulator-fixed;
+regulator-name = vddvario;
+regulator-always-on;
+};
+
+vdd33a: regulator-vdd33a {
+compatible = regulator-fixed;
+regulator-name = vdd33a;
+regulator-always-on;
+};
 };
 
 omap3_pmx_core {
-- 
1.7.8.6

--
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/1] arm :omap :DMA: fix a bug on reserving the omap SDMA channels

2012-12-29 Thread Santosh Shilimkar

$subject
s/arm:omap/ARM: OMAP:

On Sunday 30 December 2012 02:13 AM, ahema...@gmail.com wrote:

From: ahemaily ahema...@gmail.com

The variable  dma_lch_count  used for comparison  (omap_dma_reserve_channels = 
dma_lch_count)
before it initialized to the value from omap_dma_dev_attr : d-lch_count.

s/it/it is


I change the place of dma_lch_count initialization to be before the comparison.

s/I change the place of dma_lch_count initialization to be before the 
comparison./ Initialize dma_lch_count before it is being used for 
comparison.



Signed-off-by: Abdelrahman Hemaily ahema...@gmail.com
---

Change looks good to my eyes o.w

Acked-by: Santosh Shilimkar santosh.shilim...@ti.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