netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yanteng Si <si.yanteng@linux.dev>
To: Qunqin Zhao <zhaoqunqin@loongson.cn>,
	kuba@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com
Cc: chenhuacai@kernel.org, fancer.lancer@gmail.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: stmmac: dwmac-loongson: Add fix_soc_reset function
Date: Tue, 21 Jan 2025 21:41:46 +0800	[thread overview]
Message-ID: <4787f868-a384-4753-8cfd-3027f5c88fd0@linux.dev> (raw)
In-Reply-To: <20250121082536.11752-1-zhaoqunqin@loongson.cn>


在 1/21/25 16:25, Qunqin Zhao 写道:
> Loongson's GMAC device takes nearly two seconds to complete DMA reset,
> however, the default waiting time for reset is 200 milliseconds
Is only GMAC like this?
>
> Signed-off-by: Qunqin Zhao <zhaoqunqin@loongson.cn>
> ---
>   .../net/ethernet/stmicro/stmmac/dwmac-loongson.c    | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index bfe6e2d631bd..35639d26256c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -516,6 +516,18 @@ static int loongson_dwmac_acpi_config(struct pci_dev *pdev,
>   	return 0;
>   }
>   
How about putting a part of the commit message here as a comment?
> +static int loongson_fix_soc_reset(void *priv, void __iomem *ioaddr)


> +{
> +	u32 value = readl(ioaddr + DMA_BUS_MODE);
> +
> +	value |= DMA_BUS_MODE_SFT_RESET;
> +	writel(value, ioaddr + DMA_BUS_MODE);
> +
> +	return readl_poll_timeout(ioaddr + DMA_BUS_MODE, value,
> +				  !(value & DMA_BUS_MODE_SFT_RESET),
> +				  10000, 2000000);
> +}
> +
>   static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>   {
>   	struct plat_stmmacenet_data *plat;
> @@ -566,6 +578,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
>   
>   	plat->bsp_priv = ld;
>   	plat->setup = loongson_dwmac_setup;
> +	plat->fix_soc_reset = loongson_fix_soc_reset;

If only GMAC needs to be done this way, how about putting it inside the 
loongson_gmac_data()?

Thanks,

Yanteng


  parent reply	other threads:[~2025-01-21 13:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21  8:25 [PATCH] net: stmmac: dwmac-loongson: Add fix_soc_reset function Qunqin Zhao
2025-01-21  9:29 ` Huacai Chen
2025-01-21 13:47   ` Yanteng Si
2025-01-22  1:32     ` Qunqin Zhao
2025-01-21 18:11   ` Jakub Kicinski
2025-01-22  4:09     ` Huacai Chen
2025-01-23  3:44       ` Jakub Kicinski
2025-01-22  1:22   ` Qunqin Zhao
2025-01-21 13:41 ` Yanteng Si [this message]
2025-01-22  1:31   ` Qunqin Zhao
2025-01-22  8:53     ` Yanteng Si
2025-02-06  7:22       ` Qunqin Zhao
2025-02-06  8:36         ` Yanteng Si

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=4787f868-a384-4753-8cfd-3027f5c88fd0@linux.dev \
    --to=si.yanteng@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=chenhuacai@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zhaoqunqin@loongson.cn \
    /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).