[PATCH] clocksource: put nodes passed to CLOCKSOURCE_OF_DECLARE callbacks centrally

2013-10-01 Thread Uwe Kleine-König
Instead of letting each driver call of_node_put do it centrally in the
loop that also calls the CLOCKSOURCE_OF_DECLARE callbacks. This is less
prone to error and also moves getting and putting the references into the
same function.

Consequently all respective of_node_put calls in drivers are removed.

Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
---
 arch/arm/mach-msm/timer.c | 1 -
 drivers/clocksource/clksrc-of.c   | 1 +
 drivers/clocksource/dw_apb_timer_of.c | 2 --
 drivers/clocksource/tegra20_timer.c   | 4 
 drivers/clocksource/vt8500_timer.c| 2 --
 5 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 696fb73..1e9c338 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -274,7 +274,6 @@ static void __init msm_dt_timer_init(struct device_node *np)
pr_err(Unknown frequency\n);
return;
}
-   of_node_put(np);
 
event_base = base + 0x4;
sts_base = base + 0x88;
diff --git a/drivers/clocksource/clksrc-of.c b/drivers/clocksource/clksrc-of.c
index 37f5325..8b2ed14 100644
--- a/drivers/clocksource/clksrc-of.c
+++ b/drivers/clocksource/clksrc-of.c
@@ -32,5 +32,6 @@ void __init clocksource_of_init(void)
for_each_matching_node_and_match(np, __clksrc_of_table, match) {
init_func = match-data;
init_func(np);
+   of_node_put(np);
}
 }
diff --git a/drivers/clocksource/dw_apb_timer_of.c 
b/drivers/clocksource/dw_apb_timer_of.c
index 4cbae4f..294aeb7 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -138,12 +138,10 @@ static void __init dw_apb_timer_init(struct device_node 
*timer)
case 0:
pr_debug(%s: found clockevent timer\n, __func__);
add_clockevent(timer);
-   of_node_put(timer);
break;
case 1:
pr_debug(%s: found clocksource timer\n, __func__);
add_clocksource(timer);
-   of_node_put(timer);
init_sched_clock();
break;
default:
diff --git a/drivers/clocksource/tegra20_timer.c 
b/drivers/clocksource/tegra20_timer.c
index 9396170..fc173a6 100644
--- a/drivers/clocksource/tegra20_timer.c
+++ b/drivers/clocksource/tegra20_timer.c
@@ -181,8 +181,6 @@ static void __init tegra20_init_timer(struct device_node 
*np)
rate = clk_get_rate(clk);
}
 
-   of_node_put(np);
-
switch (rate) {
case 1200:
timer_writel(0x000b, TIMERUS_USEC_CFG);
@@ -241,8 +239,6 @@ static void __init tegra20_init_rtc(struct device_node *np)
else
clk_prepare_enable(clk);
 
-   of_node_put(np);
-
register_persistent_clock(NULL, tegra_read_persistent_clock);
 }
 CLOCKSOURCE_OF_DECLARE(tegra20_rtc, nvidia,tegra20-rtc, tegra20_init_rtc);
diff --git a/drivers/clocksource/vt8500_timer.c 
b/drivers/clocksource/vt8500_timer.c
index 64f553f..ad3c0e8 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -137,14 +137,12 @@ static void __init vt8500_timer_init(struct device_node 
*np)
if (!regbase) {
pr_err(%s: Missing iobase description in Device Tree\n,
__func__);
-   of_node_put(np);
return;
}
timer_irq = irq_of_parse_and_map(np, 0);
if (!timer_irq) {
pr_err(%s: Missing irq description in Device Tree\n,
__func__);
-   of_node_put(np);
return;
}
 
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm 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 1/3] usb: dwc3: msm: Add device tree binding information

2013-10-01 Thread Ivan T. Ivanov

Hi, 

On Mon, 2013-09-23 at 14:31 -0500, Felipe Balbi wrote: 
 Hi,
 
 On Tue, Aug 20, 2013 at 12:56:03PM +0300, Ivan T. Ivanov wrote:
  From: Ivan T. Ivanov iiva...@mm-sol.com
  
  MSM USB3.0 core wrapper consist of USB3.0 IP from Synopsys
  (SNPS) and HS, SS PHY's control and configuration registers.
  
  It could operate in device mode (SS, HS, FS) and host
  mode (SS, HS, FS, LS).
  
  Signed-off-by: Ivan T. Ivanov iiva...@mm-sol.com
 
 Any acks for the DT part ? This patch has been pending forever.

Thanks you for you patience Felipe. There are also several small
fixups in the driver code that I will like to address. Will send 
updated version with all pending comments shortly.


Regards,
Ivan

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


Re: [PATCH v5 1/3] usb: dwc3: msm: Add device tree binding information

2013-10-01 Thread Ivan T. Ivanov
Hi, 

On Mon, 2013-09-23 at 16:03 -0600, Stephen Warren wrote: 
 On 09/23/2013 01:32 PM, Felipe Balbi wrote:
  Hi,
  
  On Wed, Aug 21, 2013 at 04:29:44PM +0300, Ivan T. Ivanov wrote:
  From: Ivan T. Ivanov iiva...@mm-sol.com
  
  MSM USB3.0 core wrapper consist of USB3.0 IP from Synopsys (SNPS)
  and HS, SS PHY's control and configuration registers.
  
  It could operate in device mode (SS, HS, FS) and host mode (SS,
  HS, FS, LS).
  
  Signed-off-by: Ivan T. Ivanov iiva...@mm-sol.com
  
  and here's a new version from same patch
 
 The binding looks pretty simple, so I don't think it's too contentious.
 
  diff --git a/Documentation/devicetree/bindings/usb/msm-ssusb.txt
  b/Documentation/devicetree/bindings/usb/msm-ssusb.txt
 
  +MSM DWC3 controller wrapper
 
  +Optional properties : +- gdsc-supply : phandle to the globally
  distributed switch controller +  regulator node to the USB
  controller.
 
 If that's a regulator node, why not use xxx-supply properties to
 interface with it?

That was the intention. What about:

Optional supply-name :
gdsc - supply from globally distributed switch controller


 
 Aside from that, the binding,
 Acked-by: Stephen Warren swar...@nvidia.com

Thank you.

Regards,
Ivan

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


Re: [PATCH v2 1/1] usb: gadget: f_fs: Add support for SuperSpeed Mode

2013-10-01 Thread Felipe Balbi
Hi,

On Mon, Sep 30, 2013 at 02:31:50PM +0530, Manu Gautam wrote:
 On 9/28/2013 1:52 AM, Paul Zimmerman wrote:
  From: linux-usb-ow...@vger.kernel.org 
  [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of Manu Gautam
  Sent: Thursday, September 26, 2013 12:08 AM
 
  On 9/26/2013 2:10 AM, Felipe Balbi wrote:
 
  On Tue, Sep 24, 2013 at 03:00:20PM +0530, Manu Gautam wrote:
  Hi Felipe,
 
  I wanted to mention one point with respect to this patch: Below
  changes in the functionfs.h to add ss_count (super speed descriptors
  count) in desc_header (which is passed from userspace) make the driver
  incompatible with existing userspace applications compiled against old
  header file. Let me know if that is acceptable.  We are using this
  driver with Android for adbd (android debug bridge) and these changes
  are required to support adb over Super Speed controllers e.g. DWC3
  along with changed in adbd to pass SS EP and companion descriptors.
 
  Good you mentioned, it saves me the trouble of reviewing this patch :-)
 
  It's not acceptable to break userspace ABI at all. If you want
  SuperSpeed support on function fs, we need to figure out a way to do so
  without breaking userspace.
 
  This might mean adding a separate userspace interface to be used with
  superspeed. While at that, we might want to add a few bytes of reserved,
  unused space in our structures for situations where we need to add more
  data into it, just to make it slightly future proof.
 
 
  Thanks for your reply.
  As you suggested we can have a different interface for super speed
  which would be optional to workaround ABI compatibility issue.
  Let me know if below interface looks fine to you, I will then implement
  accordingly:
  
  Just a suggestion: Instead of a new interface for SuperSpeed, why not
  just add the new fields to the end of the ffs_data struct? And have the
  functions that copy the struct to/from userspace check the 'len' value
  passed in, and only handle the SuperSpeed stuff if the length indicates
  it is new userspace?
  
 
 Initially I thought on similar lines but then adding a new interface for
 SS looked cleaner to me. But, your suggestion also make sense as we can
 avoid extra system call and the same interface can be extended later.
 One more thing we can do is to add a magic number after hs_desc (i.e. at
 the end of existing ffs_data) to specify that ss_descriptors are following.
 This can be used by kernel driver to check if userspace is trying pass
 ss desc only or some invalid data. 
 Felipe: Your recommendation on this?

We need to have some more people look at this. I remember there were
always some concerns about Chris architecture when doing such changes.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] clocksource: put nodes passed to CLOCKSOURCE_OF_DECLARE callbacks centrally

2013-10-01 Thread David Brown

On Tue, Oct 01, 2013 at 11:00:53AM +0200, Uwe Kleine-König wrote:

Instead of letting each driver call of_node_put do it centrally in the
loop that also calls the CLOCKSOURCE_OF_DECLARE callbacks. This is less
prone to error and also moves getting and putting the references into the
same function.

Consequently all respective of_node_put calls in drivers are removed.

Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
---
arch/arm/mach-msm/timer.c | 1 -


Acked-by: David Brown dav...@codeaurora.org


--
sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/1] usb: gadget: f_fs: Add support for SuperSpeed Mode

2013-10-01 Thread Manu Gautam
On 10/1/2013 8:07 PM, Felipe Balbi wrote:
 Hi,
 
 On Mon, Sep 30, 2013 at 02:31:50PM +0530, Manu Gautam wrote:
 On 9/28/2013 1:52 AM, Paul Zimmerman wrote:
 From: linux-usb-ow...@vger.kernel.org 
 [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of Manu Gautam
 Sent: Thursday, September 26, 2013 12:08 AM

 On 9/26/2013 2:10 AM, Felipe Balbi wrote:

 On Tue, Sep 24, 2013 at 03:00:20PM +0530, Manu Gautam wrote:
 Hi Felipe,

 I wanted to mention one point with respect to this patch: Below
 changes in the functionfs.h to add ss_count (super speed descriptors
 count) in desc_header (which is passed from userspace) make the driver
 incompatible with existing userspace applications compiled against old
 header file. Let me know if that is acceptable.  We are using this
 driver with Android for adbd (android debug bridge) and these changes
 are required to support adb over Super Speed controllers e.g. DWC3
 along with changed in adbd to pass SS EP and companion descriptors.

 Good you mentioned, it saves me the trouble of reviewing this patch :-)

 It's not acceptable to break userspace ABI at all. If you want
 SuperSpeed support on function fs, we need to figure out a way to do so
 without breaking userspace.

 This might mean adding a separate userspace interface to be used with
 superspeed. While at that, we might want to add a few bytes of reserved,
 unused space in our structures for situations where we need to add more
 data into it, just to make it slightly future proof.


 Thanks for your reply.
 As you suggested we can have a different interface for super speed
 which would be optional to workaround ABI compatibility issue.
 Let me know if below interface looks fine to you, I will then implement
 accordingly:

 Just a suggestion: Instead of a new interface for SuperSpeed, why not
 just add the new fields to the end of the ffs_data struct? And have the
 functions that copy the struct to/from userspace check the 'len' value
 passed in, and only handle the SuperSpeed stuff if the length indicates
 it is new userspace?


 Initially I thought on similar lines but then adding a new interface for
 SS looked cleaner to me. But, your suggestion also make sense as we can
 avoid extra system call and the same interface can be extended later.
 One more thing we can do is to add a magic number after hs_desc (i.e. at
 the end of existing ffs_data) to specify that ss_descriptors are following.
 This can be used by kernel driver to check if userspace is trying pass
 ss desc only or some invalid data. 
 Felipe: Your recommendation on this?
 
 We need to have some more people look at this. I remember there were
 always some concerns about Chris architecture when doing such changes.
 

Can you please add appropriate folks to this thread who can check this as
well?

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html