From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:32
This patch set aims to remove the init/exit callbacks from the
dwmac-sti driver and instead use standard PM callbacks. Doing this
will also allow us to cleanup the driver.
Eventually the init/exit callbacks will be deprecated and removed
from all drivers dwmac-* except for dwmac-generic. Drivers will be
refactored to use standard PM and remove callbacks.
Note that this patch set has only been test compiled and no functional
change is intended.
Joachim Eastwood (7):
stmmac: dwmac-sti: remove useless of_node check
stmmac: dwmac-sti: remove clk NULL checks
stmmac: dwmac-sti: add PM ops and resume function
stmmac: dwmac-sti: move st,gmac_en parsing to sti_dwmac_parse_data
stmmac: dwmac-sti: move clk_prepare_enable out of init and add error handling
stmmac: dwmac-sti: clean up and rename sti_dwmac_init
stmmac: dwmac-sti: remove unused priv dev member
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 86 ++++++++++++++++---------
1 file changed, 57 insertions(+), 29 deletions(-)
--
2.10.1
From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:33
Since dwmac-sti is a DT only driver checking for OF node is not necessary.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 3 ---
1 file changed, 3 deletions(-)
From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:35
Since sti_dwmac_parse_data() sets dwmac->clk to NULL if not clock was
provided in DT and NULL is a valid clock there is no need to check for
NULL before using this clock.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:36
Implement PM callbacks and driver remove in the driver instead
of relying on the init/exit hooks in stmmac_platform. This gives
the driver more flexibility in how the code is organized.
Eventually the init/exit callbacks will be deprecated in favor
of the standard PM callbacks and driver remove function.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 46 +++++++++++++++++++------
1 file changed, 36 insertions(+), 10 deletions(-)
From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:37
The sti_dwmac_init() function is called both from probe and resume.
Since DT properties doesn't change between suspend/resume cycles move
parsing of this parameter into sti_dwmac_parse_data() where it belongs.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:38
Add clock error handling to probe and in the process move clock enabling
out of sti_dwmac_init() to make this easier.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:39
Rename sti_dwmac_init to sti_dwmac_set_phy_mode which is a better
description for what it really does.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
From: Joachim Eastwood <hidden> Date: 2016-10-30 20:06:41
The dev member of struct sti_dwmac is not used anywhere in the driver
so lets just remove it.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 2 --
1 file changed, 2 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2016-10-31 19:47:28
From: Joachim Eastwood <redacted>
Date: Sun, 30 Oct 2016 21:05:00 +0100
This patch set aims to remove the init/exit callbacks from the
dwmac-sti driver and instead use standard PM callbacks. Doing this
will also allow us to cleanup the driver.
Eventually the init/exit callbacks will be deprecated and removed
from all drivers dwmac-* except for dwmac-generic. Drivers will be
refactored to use standard PM and remove callbacks.
Note that this patch set has only been test compiled and no functional
change is intended.
I would really like to see some review and testing before applying this
series.
From: David Miller <davem@davemloft.net> Date: 2016-11-01 15:56:35
From: David Miller <davem@davemloft.net>
Date: Mon, 31 Oct 2016 15:47:26 -0400 (EDT)
From: Joachim Eastwood <redacted>
Date: Sun, 30 Oct 2016 21:05:00 +0100
quoted
This patch set aims to remove the init/exit callbacks from the
dwmac-sti driver and instead use standard PM callbacks. Doing this
will also allow us to cleanup the driver.
Eventually the init/exit callbacks will be deprecated and removed
from all drivers dwmac-* except for dwmac-generic. Drivers will be
refactored to use standard PM and remove callbacks.
Note that this patch set has only been test compiled and no functional
change is intended.
I would really like to see some review and testing before applying this
series.
From: Joachim Eastwood <hidden> Date: 2016-11-01 17:00:37
Hi,
On 1 November 2016 at 16:56, David Miller [off-list ref] wrote:
From: David Miller <davem@davemloft.net>
Date: Mon, 31 Oct 2016 15:47:26 -0400 (EDT)
quoted
From: Joachim Eastwood <redacted>
Date: Sun, 30 Oct 2016 21:05:00 +0100
quoted
This patch set aims to remove the init/exit callbacks from the
dwmac-sti driver and instead use standard PM callbacks. Doing this
will also allow us to cleanup the driver.
Eventually the init/exit callbacks will be deprecated and removed
from all drivers dwmac-* except for dwmac-generic. Drivers will be
refactored to use standard PM and remove callbacks.
Note that this patch set has only been test compiled and no functional
change is intended.
I would really like to see some review and testing before applying this
series.
Ping?
Adding some more ST people.
Could anyone with a stih407 platform please give these patches a try?
The series can found at https://github.com/manabian/linux-lpc.git in
the net-sti-dwmac branch (based on net-next).
Alternatively they can also be picked from netdev's patchwork.
regards,
Joachim Eastwood
From: Joachim Eastwood <hidden> Date: 2016-11-01 17:19:43
On 30 October 2016 at 21:05, Joachim Eastwood [off-list ref] wrote:
Implement PM callbacks and driver remove in the driver instead
of relying on the init/exit hooks in stmmac_platform. This gives
the driver more flexibility in how the code is organized.
Eventually the init/exit callbacks will be deprecated in favor
of the standard PM callbacks and driver remove function.
Signed-off-by: Joachim Eastwood <redacted>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 46 +++++++++++++++++++------
1 file changed, 36 insertions(+), 10 deletions(-)
+#ifdef CONFIG_PM_SLEEP
+static int sti_dwmac_suspend(struct device *dev)
+{
+ struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev);
+ int ret = stmmac_suspend(dev);
+
+ clk_disable_unprepare(dwmac->clk);
+
+ return ret;
+}
+
+static int sti_dwmac_resume(struct device *dev)
+{
+ struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev);
+ struct platform_device *pdev = to_platform_device(dev);
+
+ sti_dwmac_init(pdev, dwmac);
+
+ return stmmac_resume(dev);
+}
+#endif /* CONFIG_PM_SLEEP */
+
+SIMPLE_DEV_PM_OPS(sti_dwmac_pm_ops, sti_dwmac_suspend, sti_dwmac_resume);
Just noticed that I am missing a 'static' here.
As this not critical for testing I'll resend the patch set after I
(hopefully) get some response from someone with the hw that can do a
test.
regards,
Joachim Eastwood
From: Giuseppe CAVALLARO <hidden> Date: 2016-11-02 06:39:39
Hello Joachim
thx for this series, I will review them and test the changes
on my board asap ... I let you known.
Peppe
On 10/30/2016 9:05 PM, Joachim Eastwood wrote:
This patch set aims to remove the init/exit callbacks from the
dwmac-sti driver and instead use standard PM callbacks. Doing this
will also allow us to cleanup the driver.
Eventually the init/exit callbacks will be deprecated and removed
from all drivers dwmac-* except for dwmac-generic. Drivers will be
refactored to use standard PM and remove callbacks.
Note that this patch set has only been test compiled and no functional
change is intended.
Joachim Eastwood (7):
stmmac: dwmac-sti: remove useless of_node check
stmmac: dwmac-sti: remove clk NULL checks
stmmac: dwmac-sti: add PM ops and resume function
stmmac: dwmac-sti: move st,gmac_en parsing to sti_dwmac_parse_data
stmmac: dwmac-sti: move clk_prepare_enable out of init and add error handling
stmmac: dwmac-sti: clean up and rename sti_dwmac_init
stmmac: dwmac-sti: remove unused priv dev member
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 86 ++++++++++++++++---------
1 file changed, 57 insertions(+), 29 deletions(-)
From: Giuseppe CAVALLARO <hidden> Date: 2016-11-04 13:49:38
Hello Joachim.
I have tested the patches on STiH390 with GMAC4 and the driver is ok.
So you can add my Acked-by/Tested-by in the V2.
I just ask you, when rename the sti_dwmac_init in sti_dwmac_set_phy_mode
to use another name: sti_dwmac_set_mode could be good, IMO.
In fact, this function is not strictly related to the PHY and the
system config registers could touch different MAC/MII settings.
Regards
Peppe
On 10/30/2016 9:05 PM, Joachim Eastwood wrote:
This patch set aims to remove the init/exit callbacks from the
dwmac-sti driver and instead use standard PM callbacks. Doing this
will also allow us to cleanup the driver.
Eventually the init/exit callbacks will be deprecated and removed
from all drivers dwmac-* except for dwmac-generic. Drivers will be
refactored to use standard PM and remove callbacks.
Note that this patch set has only been test compiled and no functional
change is intended.
Joachim Eastwood (7):
stmmac: dwmac-sti: remove useless of_node check
stmmac: dwmac-sti: remove clk NULL checks
stmmac: dwmac-sti: add PM ops and resume function
stmmac: dwmac-sti: move st,gmac_en parsing to sti_dwmac_parse_data
stmmac: dwmac-sti: move clk_prepare_enable out of init and add error handling
stmmac: dwmac-sti: clean up and rename sti_dwmac_init
stmmac: dwmac-sti: remove unused priv dev member
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 86 ++++++++++++++++---------
1 file changed, 57 insertions(+), 29 deletions(-)