From: Matthew Hagan <hidden> Date: 2021-06-05 17:41:58
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
Signed-off-by: Matthew Hagan <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++++
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
include/linux/stmmac.h | 1 +
3 files changed, 15 insertions(+)
@@ -6840,6 +6840,13 @@ int stmmac_dvr_probe(struct device *device,reset_control_reset(priv->plat->stmmac_rst);}+if(priv->plat->stmmac_ahb_rst){+ret=reset_control_deassert(priv->plat->stmmac_ahb_rst);+if(ret==-ENOTSUPP)+dev_err(priv->device,+"unable to bring out of ahb reset\n");+}+/* Init MAC and get the capabilities */ret=stmmac_hw_init(priv);if(ret)
From: Matthew Hagan <hidden> Date: 2021-06-05 17:42:01
Add ahb reset to the reset properties within the example gmac node.
Signed-off-by: Matthew Hagan <redacted>
---
Documentation/devicetree/bindings/net/ipq806x-dwmac.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
On Sat 05 Jun 12:35 CDT 2021, Matthew Hagan wrote:
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
Sounds good, just some small style comments below.
From: Matthew Hagan <hidden> Date: 2021-06-06 09:37:40
On 06/06/2021 04:24, Bjorn Andersson wrote:
On Sat 05 Jun 12:35 CDT 2021, Matthew Hagan wrote:
quoted
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
Sounds good, just some small style comments below.
From: Matthew Hagan <hidden> Date: 2021-06-06 10:37:05
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
v2 changes:
- remove NULL condition check for stmmac_ahb_rst in stmmac_main.c
- unwrap dev_err() message in stmmac_main.c
- add PTR_ERR() around plat->stmmac_ahb_rst in stmmac_platform.c
Signed-off-by: Matthew Hagan <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
include/linux/stmmac.h | 1 +
3 files changed, 12 insertions(+)
@@ -6840,6 +6840,10 @@ int stmmac_dvr_probe(struct device *device,reset_control_reset(priv->plat->stmmac_rst);}+ret=reset_control_deassert(priv->plat->stmmac_ahb_rst);+if(ret==-ENOTSUPP)+dev_err(priv->device,"unable to bring out of ahb reset\n");+/* Init MAC and get the capabilities */ret=stmmac_hw_init(priv);if(ret)
You need a PTR_ERR() around the plat->stmmac_ahb_rst.
This is giving a warning. Shouldn't v1 be kept as it is here? Please refer
to "net: stmmac: platform: use optional clk/reset get APIs" [1] which
modified error handling for plat->stmmac_rst. PTR_ERR() would then be
called by the parent function on the returned value of ret.
[1]: https://lore.kernel.org/netdev/20201112092606.5173aa6f@xhacker.debian/
Thanks,
Matthew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2021-06-07 09:46:07
On Sun, 2021-06-06 at 11:30 +0100, Matthew Hagan wrote:
quoted hunk
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
v2 changes:
- remove NULL condition check for stmmac_ahb_rst in stmmac_main.c
- unwrap dev_err() message in stmmac_main.c
- add PTR_ERR() around plat->stmmac_ahb_rst in stmmac_platform.c
Signed-off-by: Matthew Hagan <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
include/linux/stmmac.h | 1 +
3 files changed, 12 insertions(+)
@@ -6840,6 +6840,10 @@ int stmmac_dvr_probe(struct device *device,reset_control_reset(priv->plat->stmmac_rst);}+ret=reset_control_deassert(priv->plat->stmmac_ahb_rst);+if(ret==-ENOTSUPP)+dev_err(priv->device,"unable to bring out of ahb reset\n");+
I would make this
if (ret)
dev_err(priv->device, "unable to bring out of ahb reset: %pe\n", ERR_PTR(ret));
Also consider asserting the reset again in the remove path. Or is there
a reason not to?
With that addressed,
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Matthew Hagan <hidden> Date: 2021-06-08 19:07:05
On 07/06/2021 10:45, Philipp Zabel wrote:
On Sun, 2021-06-06 at 11:30 +0100, Matthew Hagan wrote:
quoted
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
v2 changes:
- remove NULL condition check for stmmac_ahb_rst in stmmac_main.c
- unwrap dev_err() message in stmmac_main.c
- add PTR_ERR() around plat->stmmac_ahb_rst in stmmac_platform.c
Signed-off-by: Matthew Hagan <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
include/linux/stmmac.h | 1 +
3 files changed, 12 insertions(+)
@@ -6840,6 +6840,10 @@ int stmmac_dvr_probe(struct device *device,reset_control_reset(priv->plat->stmmac_rst);}+ret=reset_control_deassert(priv->plat->stmmac_ahb_rst);+if(ret==-ENOTSUPP)+dev_err(priv->device,"unable to bring out of ahb reset\n");+
I would make this
if (ret)
dev_err(priv->device, "unable to bring out of ahb reset: %pe\n", ERR_PTR(ret));
Done.
Also consider asserting the reset again in the remove path. Or is there
a reason not to?
Don't see any issue doing this. As this is a shared reset, the assert will only occur
when the final GMAC is removed, due to the tracking of deassert_count.
With that addressed,
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
From: Matthew Hagan <hidden> Date: 2021-06-08 19:16:54
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
v2 changes:
- remove NULL condition check for stmmac_ahb_rst in stmmac_main.c
- unwrap dev_err() message in stmmac_main.c
- add PTR_ERR() around plat->stmmac_ahb_rst in stmmac_platform.c
v3 changes:
- add error pointer to dev_err() output
- add reset_control_assert(stmmac_ahb_rst) in stmmac_dvr_remove
- revert PTR_ERR() around plat->stmmac_ahb_rst since this is performed
on the returned value of ret by the calling function
Signed-off-by: Matthew Hagan <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 7 +++++++
include/linux/stmmac.h | 1 +
3 files changed, 14 insertions(+)
@@ -6840,6 +6840,11 @@ int stmmac_dvr_probe(struct device *device,reset_control_reset(priv->plat->stmmac_rst);}+ret=reset_control_deassert(priv->plat->stmmac_ahb_rst);+if(ret==-ENOTSUPP)+dev_err(priv->device,"unable to bring out of ahb reset: %pe\n",+ERR_PTR(ret));+/* Init MAC and get the capabilities */ret=stmmac_hw_init(priv);if(ret)
@@ -7072,6 +7077,7 @@ int stmmac_dvr_remove(struct device *dev)phylink_destroy(priv->phylink);if(priv->plat->stmmac_rst)reset_control_assert(priv->plat->stmmac_rst);+reset_control_assert(priv->plat->stmmac_ahb_rst);pm_runtime_put(dev);pm_runtime_disable(dev);if(priv->hw->pcs!=STMMAC_PCS_TBI&&
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Tue, 8 Jun 2021 19:59:06 +0100 you wrote:
We are currently assuming that GMAC_AHB_RESET will already be deasserted
by the bootloader. However if this has not been done, probing of the GMAC
will fail. To remedy this we must ensure GMAC_AHB_RESET has been deasserted
prior to probing.
v2 changes:
- remove NULL condition check for stmmac_ahb_rst in stmmac_main.c
- unwrap dev_err() message in stmmac_main.c
- add PTR_ERR() around plat->stmmac_ahb_rst in stmmac_platform.c
[...]