2019-06-25 23:33:43

by Suman Anna

[permalink] [raw]
Subject: [PATCH 0/5] 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(-)

--
2.21.0


2019-06-25 23:33:50

by Suman Anna

[permalink] [raw]
Subject: [PATCH 3/5] bus: ti-sysc: Switch to SPDX license identifier

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.

Signed-off-by: Suman Anna <[email protected]>
---
drivers/bus/ti-sysc.c | 10 +---------
include/linux/platform_data/ti-sysc.h | 2 ++
2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index e6deabd8305d..3030c9eadfb1 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -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>
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index 0c587d4fc718..7d009dc08a54 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
#ifndef __TI_SYSC_DATA_H__
#define __TI_SYSC_DATA_H__

--
2.21.0

2019-06-25 23:33:56

by Suman Anna

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

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.

Signed-off-by: Suman Anna <[email protected]>
---
drivers/bus/ti-sysc.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index ccdd1f0871f9..a7e704e0840d 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -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)
--
2.21.0

2019-06-25 23:33:59

by Suman Anna

[permalink] [raw]
Subject: [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.

Signed-off-by: Suman Anna <[email protected]>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index d0ed735994a5..d45c456bc051 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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]>
--
2.21.0

2019-06-25 23:35:22

by Suman Anna

[permalink] [raw]
Subject: [PATCH 2/5] dt-bindings: ti-sysc: Add SPDX license identifier

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

Signed-off-by: Suman Anna <[email protected]>
---
include/dt-bindings/bus/ti-sysc.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/dt-bindings/bus/ti-sysc.h b/include/dt-bindings/bus/ti-sysc.h
index 7138384e2ef9..babd08a1d226 100644
--- a/include/dt-bindings/bus/ti-sysc.h
+++ b/include/dt-bindings/bus/ti-sysc.h
@@ -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 */
--
2.21.0

2019-06-25 23:36:13

by Suman Anna

[permalink] [raw]
Subject: [PATCH 4/5] bus: ti-sysc: Add missing kerneldoc comments

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

Signed-off-by: Suman Anna <[email protected]>
---
drivers/bus/ti-sysc.c | 7 +++++++
include/linux/platform_data/ti-sysc.h | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 3030c9eadfb1..ccdd1f0871f9 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -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
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index 7d009dc08a54..1a0905435b32 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -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
*/
--
2.21.0

2019-06-27 12:12:40

by Tony Lindgren

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

Hi,

* Suman Anna <[email protected]> [190625 23:33]:
> 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

2019-06-27 15:24:52

by Suman Anna

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

On 6/27/19 7:11 AM, Tony Lindgren wrote:
> Hi,
>
> * Suman Anna <[email protected]> [190625 23:33]:
>> 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.

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

2019-07-01 07:50:51

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH 0/5] Minor ti-sysc cleanups

On 26/06/2019 02:33, Suman Anna wrote:
> 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()

For all patches.

Acked-by: Roger Quadros <[email protected]>

>
> 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(-)
>

--
cheers,
-roger

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

2019-08-13 11:27:53

by Tony Lindgren

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

* Suman Anna <[email protected]> [190627 15:24]:
> On 6/27/19 7:11 AM, Tony Lindgren wrote:
> > Hi,
> >
> > * Suman Anna <[email protected]> [190625 23:33]:
> >> 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.
>
> 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