From: Lee Jones <hidden> Date: 2016-09-08 09:12:03
Before we had critical-clock support, it was not possible to boot a kernel
without using the 'clk_ignore_unused' kernel command-line parameter. This
was due to the existance of inter-connect clocks which weren't associated
with any physical device and thus could not be handled (think get, enable,
disable) correctly. As a consequence the platform would catastrophically
fail when the Common Clock Framework tried to disable unused clocks.
Now we do have critical-clock support, it has identified some additional
clocks which are required for the successful functioning of some key IP.
With the introduction of critical-clock support in v4.8, our developers'
default configuration is to run with 'clk_ignore_unused' removed. This
patch-set ensures they can achieve successful boot when a) booting from
an SD Card and when b) booting using USB->Eth adaptors for NFS booting.
Please consider this set for your respective -fixes branches for
inclusion into the v4.8-rcs.
Lee Jones (4):
ARM: dts: STiH410: Handle interconnect clock required by EHCI/OHCI
(USB)
ARM: dts: STiH407-family: Provide interconnect clock for consumption
in ST SDHCI
dt-bindings: mmc: sdhci-st: Mention the discretionary "icn" clock
mmc: sdhci-st: Handle interconnect clock
Documentation/devicetree/bindings/mmc/sdhci-st.txt | 2 +-
arch/arm/boot/dts/stih407-family.dtsi | 10 ++++++----
arch/arm/boot/dts/stih410.dtsi | 12 ++++++++----
drivers/mmc/host/sdhci-st.c | 15 ++++++++++++++-
4 files changed, 29 insertions(+), 10 deletions(-)
--
2.9.3
From: Lee Jones <hidden> Date: 2016-09-08 09:12:10
Some ST platforms contain interconnect (ICN) clocks which must be handed
correctly in order to obtain full functionality of a given IP. In this
case, if the ICN clocks are not handled properly by the ST SDHCI driver
MMC will break and the following output can be observed:
[ 13.916949] mmc0: Timeout waiting for hardware interrupt.
[ 13.922349] sdhci: =========== REGISTER DUMP (mmc0)===========
[ 13.928175] sdhci: Sys addr: 0x00000000 | Version: 0x00001002
[ 13.933999] sdhci: Blk size: 0x00007040 | Blk cnt: 0x00000001
[ 13.939825] sdhci: Argument: 0x00fffff0 | Trn mode: 0x00000013
[ 13.945650] sdhci: Present: 0x1fff0206 | Host ctl: 0x00000011
[ 13.951475] sdhci: Power: 0x0000000f | Blk gap: 0x00000080
[ 13.957300] sdhci: Wake-up: 0x00000000 | Clock: 0x00003f07
[ 13.963126] sdhci: Timeout: 0x00000004 | Int stat: 0x00000000
[ 13.968952] sdhci: Int enab: 0x02ff008b | Sig enab: 0x02ff008b
[ 13.974777] sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 13.980602] sdhci: Caps: 0x21ed3281 | Caps_1: 0x00000000
[ 13.986428] sdhci: Cmd: 0x0000063a | Max curr: 0x00000000
[ 13.992252] sdhci: Host ctl2: 0x00000000
[ 13.996166] sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x7c048200
[ 14.001990] sdhci: ===========================================
[ 14.009802] mmc0: Got data interrupt 0x02000000 even though no data operation was in progress.
A decent point was raised about minimising the use of a local variable that
we 'could' do without. I've chosen consistency over the possibility of
reducing the local variable count by 1. Thinking that it's more important
for the code to be grouped and authoured in a similar manner/style for
greater maintainability/readability.
Cc: stable at vger.kernel.org
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <redacted>
---
drivers/mmc/host/sdhci-st.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
@@ -353,7 +354,7 @@ static int sdhci_st_probe(struct platform_device *pdev)structsdhci_host*host;structst_mmc_platform_data*pdata;structsdhci_pltfm_host*pltfm_host;-structclk*clk;+structclk*clk,*icnclk;intret=0;u16host_version;structresource*res;
@@ -365,6 +366,11 @@ static int sdhci_st_probe(struct platform_device *pdev)returnPTR_ERR(clk);}+/* ICN clock isn't compulsory, but use it if it's provided. */+icnclk=devm_clk_get(&pdev->dev,"icn");+if(IS_ERR(icnclk))+icnclk=NULL;+rstc=devm_reset_control_get(&pdev->dev,NULL);if(IS_ERR(rstc))rstc=NULL;
@@ -389,6 +395,7 @@ static int sdhci_st_probe(struct platform_device *pdev)}clk_prepare_enable(clk);+clk_prepare_enable(icnclk);/* Configure the FlashSS Top registers for setting eMMC TX/RX delay */res=platform_get_resource_byname(pdev,IORESOURCE_MEM,
@@ -400,6 +407,7 @@ static int sdhci_st_probe(struct platform_device *pdev)}pltfm_host->clk=clk;+pdata->icnclk=icnclk;/* Configure the Arasan HC inside the flashSS */st_mmcss_cconfig(np,host);
@@ -422,6 +430,7 @@ static int sdhci_st_probe(struct platform_device *pdev)return0;err_out:+clk_disable_unprepare(icnclk);clk_disable_unprepare(clk);err_of:sdhci_pltfm_free(pdev);
@@ -442,6 +451,8 @@ static int sdhci_st_remove(struct platform_device *pdev)ret=sdhci_pltfm_unregister(pdev);+clk_disable_unprepare(pdata->icnclk);+if(rstc)reset_control_assert(rstc);
@@ -462,6 +473,7 @@ static int sdhci_st_suspend(struct device *dev)if(pdata->rstc)reset_control_assert(pdata->rstc);+clk_disable_unprepare(pdata->icnclk);clk_disable_unprepare(pltfm_host->clk);out:returnret;
@@ -475,6 +487,7 @@ static int sdhci_st_resume(struct device *dev)structdevice_node*np=dev->of_node;clk_prepare_enable(pltfm_host->clk);+clk_prepare_enable(pdata->icnclk);if(pdata->rstc)reset_control_deassert(pdata->rstc);
@@ -10,7 +10,7 @@ Required properties: subsystem (mmcss) inside the FlashSS (available in STiH407 SoC family).-- clock-names: Should be "mmc".+- clock-names: Should be "mmc" and "icn". (NB: The latter is not compulsory) See: Documentation/devicetree/bindings/resource-names.txt - clocks: Phandle to the clock. See: Documentation/devicetree/bindings/clock/clock-bindings.txt
From: Lee Jones <hidden> Date: 2016-09-08 09:13:04
The STiH4{07,10} platform contains some interconnect clocks which are used
by various IPs. If this clock isn't handled correctly by ST's EHCI/OHCI
drivers, their hub won't be found, the following error be shown and the
result will be non-working USB:
[ 97.221963] hub 2-1:1.0: hub_ext_port_status failed (err = -110)
Cc: stable at vger.kernel.org
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih410.dtsi | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
Some ST platforms contain interconnect (ICN) clocks which must be handed
correctly in order to obtain full functionality of a given IP. In this
case, if the ICN clocks are not handled properly by the ST SDHCI driver
MMC will break and the following output can be observed:
[ 13.916949] mmc0: Timeout waiting for hardware interrupt.
[ 13.922349] sdhci: =========== REGISTER DUMP (mmc0)===========
[ 13.928175] sdhci: Sys addr: 0x00000000 | Version: 0x00001002
[ 13.933999] sdhci: Blk size: 0x00007040 | Blk cnt: 0x00000001
[ 13.939825] sdhci: Argument: 0x00fffff0 | Trn mode: 0x00000013
[ 13.945650] sdhci: Present: 0x1fff0206 | Host ctl: 0x00000011
[ 13.951475] sdhci: Power: 0x0000000f | Blk gap: 0x00000080
[ 13.957300] sdhci: Wake-up: 0x00000000 | Clock: 0x00003f07
[ 13.963126] sdhci: Timeout: 0x00000004 | Int stat: 0x00000000
[ 13.968952] sdhci: Int enab: 0x02ff008b | Sig enab: 0x02ff008b
[ 13.974777] sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 13.980602] sdhci: Caps: 0x21ed3281 | Caps_1: 0x00000000
[ 13.986428] sdhci: Cmd: 0x0000063a | Max curr: 0x00000000
[ 13.992252] sdhci: Host ctl2: 0x00000000
[ 13.996166] sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x7c048200
[ 14.001990] sdhci: ===========================================
[ 14.009802] mmc0: Got data interrupt 0x02000000 even though no data operation was in progress.
A decent point was raised about minimising the use of a local variable that
we 'could' do without. I've chosen consistency over the possibility of
reducing the local variable count by 1. Thinking that it's more important
for the code to be grouped and authoured in a similar manner/style for
greater maintainability/readability.
Cc: stable at vger.kernel.org
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <redacted>
---
drivers/mmc/host/sdhci-st.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
@@ -353,7 +354,7 @@ static int sdhci_st_probe(struct platform_device *pdev)structsdhci_host*host;structst_mmc_platform_data*pdata;structsdhci_pltfm_host*pltfm_host;-structclk*clk;+structclk*clk,*icnclk;intret=0;u16host_version;structresource*res;
@@ -365,6 +366,11 @@ static int sdhci_st_probe(struct platform_device *pdev)returnPTR_ERR(clk);}+/* ICN clock isn't compulsory, but use it if it's provided. */+icnclk=devm_clk_get(&pdev->dev,"icn");+if(IS_ERR(icnclk))+icnclk=NULL;+rstc=devm_reset_control_get(&pdev->dev,NULL);if(IS_ERR(rstc))rstc=NULL;
@@ -389,6 +395,7 @@ static int sdhci_st_probe(struct platform_device *pdev)}clk_prepare_enable(clk);+clk_prepare_enable(icnclk);/* Configure the FlashSS Top registers for setting eMMC TX/RX delay */res=platform_get_resource_byname(pdev,IORESOURCE_MEM,
@@ -400,6 +407,7 @@ static int sdhci_st_probe(struct platform_device *pdev)}pltfm_host->clk=clk;+pdata->icnclk=icnclk;/* Configure the Arasan HC inside the flashSS */st_mmcss_cconfig(np,host);
@@ -422,6 +430,7 @@ static int sdhci_st_probe(struct platform_device *pdev)return0;err_out:+clk_disable_unprepare(icnclk);clk_disable_unprepare(clk);err_of:sdhci_pltfm_free(pdev);
@@ -442,6 +451,8 @@ static int sdhci_st_remove(struct platform_device *pdev)ret=sdhci_pltfm_unregister(pdev);+clk_disable_unprepare(pdata->icnclk);+if(rstc)reset_control_assert(rstc);
@@ -462,6 +473,7 @@ static int sdhci_st_suspend(struct device *dev)if(pdata->rstc)reset_control_assert(pdata->rstc);+clk_disable_unprepare(pdata->icnclk);clk_disable_unprepare(pltfm_host->clk);out:returnret;
@@ -475,6 +487,7 @@ static int sdhci_st_resume(struct device *dev)structdevice_node*np=dev->of_node;clk_prepare_enable(pltfm_host->clk);+clk_prepare_enable(pdata->icnclk);if(pdata->rstc)reset_control_deassert(pdata->rstc);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
The STiH4{07,10} platform contains some interconnect clocks which are used
by various IPs. If this clock isn't handled correctly by ST's EHCI/OHCI
drivers, their hub won't be found, the following error be shown and the
result will be non-working USB:
[ 97.221963] hub 2-1:1.0: hub_ext_port_status failed (err = -110)
Cc: stable at vger.kernel.org
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih410.dtsi | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
The STiH4{07,10} platform contains some interconnect clocks which are used
by various IPs. If this clock isn't handled correctly by ST's EHCI/OHCI
drivers, their hub won't be found, the following error be shown and the
result will be non-working USB:
[ 97.221963] hub 2-1:1.0: hub_ext_port_status failed (err = -110)
Cc: stable at vger.kernel.org
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <redacted>
---
arch/arm/boot/dts/stih410.dtsi | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
@@ -10,7 +10,7 @@ Required properties: subsystem (mmcss) inside the FlashSS (available in STiH407 SoC family).-- clock-names: Should be "mmc".+- clock-names: Should be "mmc" and "icn". (NB: The latter is not compulsory) See: Documentation/devicetree/bindings/resource-names.txt - clocks: Phandle to the clock. See: Documentation/devicetree/bindings/clock/clock-bindings.txt--
2.9.3
This looks good to me!
I am guessing you want this to go through my mmc tree, as I think
patch 3 and patch 4 should go together. If not, tell me.
Kind regards
Uffe
@@ -10,7 +10,7 @@ Required properties: subsystem (mmcss) inside the FlashSS (available in STiH407 SoC family).-- clock-names: Should be "mmc".+- clock-names: Should be "mmc" and "icn". (NB: The latter is not compulsory) See: Documentation/devicetree/bindings/resource-names.txt - clocks: Phandle to the clock. See: Documentation/devicetree/bindings/clock/clock-bindings.txt--
2.9.3
This looks good to me!
I am guessing you want this to go through my mmc tree, as I think
patch 3 and patch 4 should go together. If not, tell me.
That's correct, thanks.
--
Lee Jones
Linaro ST Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
@@ -10,7 +10,7 @@ Required properties: subsystem (mmcss) inside the FlashSS (available in STiH407 SoC family).-- clock-names: Should be "mmc".+- clock-names: Should be "mmc" and "icn". (NB: The latter is not compulsory) See: Documentation/devicetree/bindings/resource-names.txt - clocks: Phandle to the clock. See: Documentation/devicetree/bindings/clock/clock-bindings.txt--
Some ST platforms contain interconnect (ICN) clocks which must be handed
correctly in order to obtain full functionality of a given IP. In this
case, if the ICN clocks are not handled properly by the ST SDHCI driver
MMC will break and the following output can be observed:
[ 13.916949] mmc0: Timeout waiting for hardware interrupt.
[ 13.922349] sdhci: =========== REGISTER DUMP (mmc0)===========
[ 13.928175] sdhci: Sys addr: 0x00000000 | Version: 0x00001002
[ 13.933999] sdhci: Blk size: 0x00007040 | Blk cnt: 0x00000001
[ 13.939825] sdhci: Argument: 0x00fffff0 | Trn mode: 0x00000013
[ 13.945650] sdhci: Present: 0x1fff0206 | Host ctl: 0x00000011
[ 13.951475] sdhci: Power: 0x0000000f | Blk gap: 0x00000080
[ 13.957300] sdhci: Wake-up: 0x00000000 | Clock: 0x00003f07
[ 13.963126] sdhci: Timeout: 0x00000004 | Int stat: 0x00000000
[ 13.968952] sdhci: Int enab: 0x02ff008b | Sig enab: 0x02ff008b
[ 13.974777] sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000
[ 13.980602] sdhci: Caps: 0x21ed3281 | Caps_1: 0x00000000
[ 13.986428] sdhci: Cmd: 0x0000063a | Max curr: 0x00000000
[ 13.992252] sdhci: Host ctl2: 0x00000000
[ 13.996166] sdhci: ADMA Err: 0x00000000 | ADMA Ptr: 0x7c048200
[ 14.001990] sdhci: ===========================================
[ 14.009802] mmc0: Got data interrupt 0x02000000 even though no data operation was in progress.
A decent point was raised about minimising the use of a local variable that
we 'could' do without. I've chosen consistency over the possibility of
reducing the local variable count by 1. Thinking that it's more important
for the code to be grouped and authoured in a similar manner/style for
greater maintainability/readability.
Cc: stable at vger.kernel.org
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Lee Jones <redacted>
Thanks, applied for fixes!
Adrian, please tell if you have any objections else I intend to send
this for the rcs later this week.
Kind regards
Uffe
@@ -353,7 +354,7 @@ static int sdhci_st_probe(struct platform_device *pdev)structsdhci_host*host;structst_mmc_platform_data*pdata;structsdhci_pltfm_host*pltfm_host;-structclk*clk;+structclk*clk,*icnclk;intret=0;u16host_version;structresource*res;
@@ -365,6 +366,11 @@ static int sdhci_st_probe(struct platform_device *pdev)returnPTR_ERR(clk);}+/* ICN clock isn't compulsory, but use it if it's provided. */+icnclk=devm_clk_get(&pdev->dev,"icn");+if(IS_ERR(icnclk))+icnclk=NULL;+rstc=devm_reset_control_get(&pdev->dev,NULL);if(IS_ERR(rstc))rstc=NULL;
@@ -389,6 +395,7 @@ static int sdhci_st_probe(struct platform_device *pdev)}clk_prepare_enable(clk);+clk_prepare_enable(icnclk);/* Configure the FlashSS Top registers for setting eMMC TX/RX delay */res=platform_get_resource_byname(pdev,IORESOURCE_MEM,
@@ -400,6 +407,7 @@ static int sdhci_st_probe(struct platform_device *pdev)}pltfm_host->clk=clk;+pdata->icnclk=icnclk;/* Configure the Arasan HC inside the flashSS */st_mmcss_cconfig(np,host);
@@ -422,6 +430,7 @@ static int sdhci_st_probe(struct platform_device *pdev)return0;err_out:+clk_disable_unprepare(icnclk);clk_disable_unprepare(clk);err_of:sdhci_pltfm_free(pdev);
@@ -442,6 +451,8 @@ static int sdhci_st_remove(struct platform_device *pdev)ret=sdhci_pltfm_unregister(pdev);+clk_disable_unprepare(pdata->icnclk);+if(rstc)reset_control_assert(rstc);
@@ -462,6 +473,7 @@ static int sdhci_st_suspend(struct device *dev)if(pdata->rstc)reset_control_assert(pdata->rstc);+clk_disable_unprepare(pdata->icnclk);clk_disable_unprepare(pltfm_host->clk);out:returnret;
@@ -475,6 +487,7 @@ static int sdhci_st_resume(struct device *dev)structdevice_node*np=dev->of_node;clk_prepare_enable(pltfm_host->clk);+clk_prepare_enable(pdata->icnclk);if(pdata->rstc)reset_control_deassert(pdata->rstc);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog