From: Lee Jones <lee.jones@linaro.org>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Hans de Goede <hdegoede@redhat.com>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Chen-Yu Tsai <wens@csie.org>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Vineet Gupta <Vineet.Gupta1@synopsys.com>,
srinivas.kandagatla@linaro.org, kernel@stlinux.com
Subject: Re: [PATCH] stmmac: extend DMA initialization delay to 2.5 seconds
Date: Thu, 5 Jun 2014 15:30:15 +0100 [thread overview]
Message-ID: <20140605143015.GD24240@lee--X1> (raw)
In-Reply-To: <1401973080-10085-1-git-send-email-abrodkin@synopsys.com>
+Srinivas and the ST list.
> On some platforms existing 100 msecond delay is not enough for DMA block to
> recover after reset. This is because MAC DMA waits for all PHY input clocks
> to present and depending on the board reset bit deassertion may take much
> longer than previously used 100 milliseconds
>
> I have a board that requires more than 2 seconds for DMA to zero "reset" bit.
> If for other boards it's still not long enough this value should be extended
> once again.
>
> In the same change I convert "mdelay" to "msleep" to make CPU available for
> other processes during DMA init delay which is especially useful in case of
> delay for a few seconds.
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Cc: Vineet Gupta <vgupta@synopsys.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c | 4 ++--
> drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
> index 0c2058a..f713ea7 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
> @@ -39,11 +39,11 @@ static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
> /* DMA SW reset */
> value |= DMA_BUS_MODE_SFT_RESET;
> writel(value, ioaddr + DMA_BUS_MODE);
> - limit = 10;
> + limit = 100;
> while (limit--) {
> if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET))
> break;
> - mdelay(10);
> + msleep(25);
> }
> if (limit < 0)
> return -EBUSY;
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
> index 7d1dce9..043585f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
> @@ -41,11 +41,11 @@ static int dwmac100_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
> /* DMA SW reset */
> value |= DMA_BUS_MODE_SFT_RESET;
> writel(value, ioaddr + DMA_BUS_MODE);
> - limit = 10;
> + limit = 100;
> while (limit--) {
> if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET))
> break;
> - mdelay(10);
> + msleep(25);
> }
> if (limit < 0)
> return -EBUSY;
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2014-06-05 14:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 12:58 [PATCH] stmmac: extend DMA initialization delay to 2.5 seconds Alexey Brodkin
2014-06-05 14:30 ` Lee Jones [this message]
[not found] ` <1401973080-10085-1-git-send-email-abrodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2014-06-05 22:24 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140605143015.GD24240@lee--X1 \
--to=lee.jones@linaro.org \
--cc=Alexey.Brodkin@synopsys.com \
--cc=Vineet.Gupta1@synopsys.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=hdegoede@redhat.com \
--cc=kernel@stlinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).