Skip to contentSkip to conversation

Minor ti-sysc cleanups

PATCH In review Suman Anna 3 participants 10 messages Jun 25, 2019 – Aug 13, 2019

Subsystems (2)
lore
Share & tools
lore

Suman Anna

author
#0 lore raw

cover Minor ti-sysc cleanups

Hi Tony,

The following series includes minor cleanup patches against the ti-sysc code. Patches are based on top of all your 5.3 staged branches. Feel free to pick them up for either 5.3 (if it is not too late) or 5.4 merge window.

The first 4 patches are non-coding changes, and the last patch is a minor fixup cleaning up the code flow on failure error paths in sysc_probe() function. I have boot tested on the limited boards that I have - AM335x BeagleBone Black, AM437x IDK, AM57xx GP EVM, OMAP4 PandaBoard and OMAP5 uEVM.

regards
Suman

Suman Anna (5):
MAINTAINERS: Add ti-sysc files under the OMAP2+ entry
dt-bindings: ti-sysc: Add SPDX license identifier
bus: ti-sysc: Switch to SPDX license identifier
bus: ti-sysc: Add missing kerneldoc comments
bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()

 MAINTAINERS                           |  2 ++
 drivers/bus/ti-sysc.c                 | 31 +++++++++++++--------------
 include/dt-bindings/bus/ti-sysc.h     |  1 +
 include/linux/platform_data/ti-sysc.h |  7 ++++--
 4 files changed, 23 insertions(+), 18 deletions(-)
Signature · 1 line
2.21.0
author
#1 lore raw

PATCH 1/5 MAINTAINERS: Add ti-sysc files under the OMAP2+ entry

Add the ti-sysc source files under the OMAP2+ entry so that the get_maintainer script also generates the linux-omap list to be cc'd for all patches touching these files.

---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
index d0ed735994a5..d45c456bc051 100644
@@ -11526,6 +11526,7 @@ S:	Maintained
 F:	arch/arm/mach-omap2/
 F:	arch/arm/plat-omap/
 F:	arch/arm/configs/omap2plus_defconfig
+F:	drivers/bus/ti-sysc.c
 F:	drivers/i2c/busses/i2c-omap.c
 F:	drivers/irqchip/irq-omap-intc.c
 F:	drivers/mfd/*omap*.c
@@ -11546,6 +11547,7 @@ F:	drivers/regulator/tps65910-regulator.c
 F:	drivers/regulator/twl-regulator.c
 F:	drivers/regulator/twl6030-regulator.c
 F:	include/linux/platform_data/i2c-omap.h
+F:	include/linux/platform_data/ti-sysc.h
 
 ONION OMEGA2+ BOARD
 M:	Harvey Hunt <[email protected]>
Signature · 1 line
2.21.0
author
#2 lore raw

PATCH 2/5 dt-bindings: ti-sysc: Add SPDX license identifier

In reply to Suman Anna

Add the appropriate SPDX license identifier to the common TI sysc bindings header file.

---
 include/dt-bindings/bus/ti-sysc.h | 1 +
 1 file changed, 1 insertion(+)
include/dt-bindings/bus/ti-sysc.h +1 -0
index 7138384e2ef9..babd08a1d226 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /* TI sysc interconnect target module defines */
 
 /* Generic sysc found on omap2 and later, also known as type1 */
Signature · 1 line
2.21.0
author
#3 lore raw

PATCH 3/5 bus: ti-sysc: Switch to SPDX license identifier

In reply to Suman Anna

Use the appropriate SPDX license identifier in the TI sysc interconnect target driver source files and drop the previous boilerplate license text. Also, add the the SPDX license identifier in the associated ti-sysc header files.

---
 drivers/bus/ti-sysc.c                 | 10 +---------
 include/linux/platform_data/ti-sysc.h |  2 ++
 2 files changed, 3 insertions(+), 9 deletions(-)
drivers/bus/ti-sysc.c +1 -9
index e6deabd8305d..3030c9eadfb1 100644
@@ -1,14 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * ti-sysc.c - Texas Instruments sysc interconnect target driver
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #include <linux/io.h>
include/linux/platform_data/ti-sysc.h +2 -0
index 0c587d4fc718..7d009dc08a54 100644
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
 #ifndef __TI_SYSC_DATA_H__
 #define __TI_SYSC_DATA_H__
 
Signature · 1 line
2.21.0
author
#4 lore raw

PATCH 4/5 bus: ti-sysc: Add missing kerneldoc comments

In reply to Suman Anna

A few fields in various structures is missing the corresponding kerneldoc comments. Add them. Also, fixed the comment for sidlemodes.

---
 drivers/bus/ti-sysc.c                 | 7 +++++++
 include/linux/platform_data/ti-sysc.h | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +7 -0
index 3030c9eadfb1..ccdd1f0871f9 100644
@@ -54,15 +54,22 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = {
  * @module_size: size of the interconnect target module
  * @module_va: virtual address of the interconnect target module
  * @offsets: register offsets from module base
+ * @mdata: ti-sysc to hwmod translation data for a module
  * @clocks: clocks used by the interconnect target module
  * @clock_roles: clock role names for the found clocks
  * @nr_clocks: number of clocks used by the interconnect target module
+ * @rsts: resets used by the interconnect target module
  * @legacy_mode: configured for legacy mode if set
  * @cap: interconnect target module capabilities
  * @cfg: interconnect target module configuration
+ * @cookie: data used by legacy platform callbacks
  * @name: name if available
  * @revision: interconnect target module revision
+ * @enabled: sysc runtime enabled status
  * @needs_resume: runtime resume needed on resume from suspend
+ * @child_needs_resume: runtime resume needed for child on resume from suspend
+ * @disable_on_idle: status flag used for disabling modules with resets
+ * @idle_work: work structure used to perform delayed idle on a module
  * @clk_enable_quirk: module specific clock enable quirk
  * @clk_disable_quirk: module specific clock disable quirk
  * @reset_done_quirk: module specific reset done quirk
include/linux/platform_data/ti-sysc.h +3 -2
index 7d009dc08a54..1a0905435b32 100644
@@ -72,7 +72,7 @@ struct sysc_regbits {
 
 /**
  * struct sysc_capabilities - capabilities for an interconnect target module
- *
+ * @type: sysc type identifier for the module
  * @sysc_mask: bitmask of supported SYSCONFIG register bits
  * @regbits: bitmask of SYSCONFIG register bits
  * @mod_quirks: bitmask of module specific quirks
@@ -87,8 +87,9 @@ struct sysc_capabilities {
 /**
  * struct sysc_config - configuration for an interconnect target module
  * @sysc_val: configured value for sysc register
+ * @syss_mask: configured mask value for SYSSTATUS register
  * @midlemodes: bitmask of supported master idle modes
- * @sidlemodes: bitmask of supported master idle modes
+ * @sidlemodes: bitmask of supported slave idle modes
  * @srst_udelay: optional delay needed after OCP soft reset
  * @quirks: bitmask of enabled quirks
  */
Signature · 1 line
2.21.0
author
#5 lore raw

PATCH 5/5 bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()

In reply to Suman Anna

The clocks are not yet parsed and prepared until after a successful sysc_get_clocks(), so there is no need to unprepare the clocks upon any failure of any of the prior functions in sysc_probe(). The current code path would have been a no-op because of the clock validity checks within sysc_unprepare(), but let's just simplify the cleanup path by returning the error directly.

While at this, also fix the cleanup path for a sysc_init_resets() failure which is executed after the clocks are prepared.

---
 drivers/bus/ti-sysc.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/bus/ti-sysc.c +7 -7
index ccdd1f0871f9..a7e704e0840d 100644
@@ -2384,27 +2384,27 @@ static int sysc_probe(struct platform_device *pdev)
 
 	error = sysc_init_dts_quirks(ddata);
 	if (error)
-		goto unprepare;
+		return error;
 
 	error = sysc_map_and_check_registers(ddata);
 	if (error)
-		goto unprepare;
+		return error;
 
 	error = sysc_init_sysc_mask(ddata);
 	if (error)
-		goto unprepare;
+		return error;
 
 	error = sysc_init_idlemodes(ddata);
 	if (error)
-		goto unprepare;
+		return error;
 
 	error = sysc_init_syss_mask(ddata);
 	if (error)
-		goto unprepare;
+		return error;
 
 	error = sysc_init_pdata(ddata);
 	if (error)
-		goto unprepare;
+		return error;
 
 	sysc_init_early_quirks(ddata);
 
@@ -2414,7 +2414,7 @@ static int sysc_probe(struct platform_device *pdev)
 
 	error = sysc_init_resets(ddata);
 	if (error)
-		return error;
+		goto unprepare;
 
 	error = sysc_init_module(ddata);
 	if (error)
Signature · 1 line
2.21.0
maintainer
#6 lore raw

Re: [PATCH 5/5] bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()

Hi,

Quoted 9 lines · Suman Anna

The clocks are not yet parsed and prepared until after a successful sysc_get_clocks(), so there is no need to unprepare the clocks upon any failure of any of the prior functions in sysc_probe(). The current code path would have been a no-op because of the clock validity checks within sysc_unprepare(), but let's just simplify the cleanup path by returning the error directly.

While at this, also fix the cleanup path for a sysc_init_resets() failure which is executed after the clocks are prepared.

Sounds like this should get queued separately as a fix for v5.3-rc cycle, probably got broken with the recent ti-sysc init order changes.

Regards,

Tony

author
#7 lore raw

Re: [PATCH 5/5] bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()

Quoted 10 lines · Tony Lindgren

Hi,

Quoted 7 lines · Suman Anna

The clocks are not yet parsed and prepared until after a successful sysc_get_clocks(), so there is no need to unprepare the clocks upon any failure of any of the prior functions in sysc_probe(). The current code path would have been a no-op because of the clock validity checks within sysc_unprepare(), but let's just simplify the cleanup path by returning the error directly.

Quoted 5 lines
Quoted 2 lines

While at this, also fix the cleanup path for a sysc_init_resets() failure which is executed after the clocks are prepared.

Sounds like this should get queued separately as a fix for v5.3-rc cycle, probably got broken with the recent ti-sysc init order changes.

Yeah, this patch does not depend on the previous 4 patches, so can be picked up independently for v5.3-rc as well.

regards
Suman

maintainer
#8 lore raw

Re: [PATCH 5/5] bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()

Quoted 11 lines · Suman Anna
Quoted 10 lines · Tony Lindgren

Hi,

Quoted 7 lines · Suman Anna

The clocks are not yet parsed and prepared until after a successful sysc_get_clocks(), so there is no need to unprepare the clocks upon any failure of any of the prior functions in sysc_probe(). The current code path would have been a no-op because of the clock validity checks within sysc_unprepare(), but let's just simplify the cleanup path by returning the error directly.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

While at this, also fix the cleanup path for a sysc_init_resets() failure which is executed after the clocks are prepared.

Sounds like this should get queued separately as a fix for v5.3-rc cycle, probably got broken with the recent ti-sysc init order changes.

Yeah, this patch does not depend on the previous 4 patches, so can be picked up independently for v5.3-rc as well.

OK applying the $subject patch into fixes, and the rest into omap-for-v5.4/ti-sysc.

Regards,

Tony

Acked-by on the v1 series
#9 lore raw
In reply to Suman Anna
Quoted 15 lines · Suman Anna

Hi Tony,

The following series includes minor cleanup patches against the ti-sysc code. Patches are based on top of all your 5.3 staged branches. Feel free to pick them up for either 5.3 (if it is not too late) or 5.4 merge window.

The first 4 patches are non-coding changes, and the last patch is a minor fixup cleaning up the code flow on failure error paths in sysc_probe() function. I have boot tested on the limited boards that I have - AM335x BeagleBone Black, AM437x IDK, AM57xx GP EVM, OMAP4 PandaBoard and OMAP5 uEVM.

regards
Suman

Quoted 6 lines

Suman Anna (5):
MAINTAINERS: Add ti-sysc files under the OMAP2+ entry
dt-bindings: ti-sysc: Add SPDX license identifier
bus: ti-sysc: Switch to SPDX license identifier
bus: ti-sysc: Add missing kerneldoc comments
bus: ti-sysc: Simplify cleanup upon failures in sysc_probe()

For all patches.

Quoted 7 lines
 MAINTAINERS                           |  2 ++
 drivers/bus/ti-sysc.c                 | 31 +++++++++++++--------------
 include/dt-bindings/bus/ti-sysc.h     |  1 +
 include/linux/platform_data/ti-sysc.h |  7 ++++--
 4 files changed, 23 insertions(+), 18 deletions(-)
Signature · 5 lines
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki