mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: stmmac: Return early if invalid in loongson_dwmac_fix_reset()
Date: Wed, 23 Jul 2025 17:42:44 +0800	[thread overview]
Message-ID: <cccf48de-9987-2ea5-bd38-a8e660004039@loongson.cn> (raw)
In-Reply-To: <2fea78e7-9e0a-4c6b-9d86-6433e4c28e5e@loongson.cn>

On 2025/7/22 下午9:10, Tiezhu Yang wrote:
> On 2025/7/22 下午8:48, Maxime Chevallier wrote:
>> On Tue, 22 Jul 2025 14:27:15 +0800
>> Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>>
>>> If the DMA_BUS_MODE_SFT_RESET bit is 1 before software reset,
>>> there is no need to do anything for this abnormal case, just
>>> return -EINVAL immediately in loongson_dwmac_fix_reset().
>>>
>>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>>
>> Do you know when that could ever happen ? I'm asking because this logic
>> for the DMA reset is duplicated in several places in this driver, maybe
>> this could be useful for other users as well. I'm guessing this is to
>> avoid waiting for the timeout when the DMA reset fails, but that is
>> usually when there's a missing clock somewhere (such as the RGMII clock
>> from the PHY), in which case I don't think the RST bit will be set.
> 
> To be honest, I am not quite sure the root cause but this actually
> happened on the test environment, I guess there is a missing clock.
> 
> You are right, the initial aim of this patch is to return early for
> this case to avoid waiting for the timeout when the DMA reset fails.

With the help of hardware engineer to analysis the ‌device‌ of mainboard,
the root cause is that the MAC controller does not connect to any PHY
interface, there is a missing clock, so the DMA reset fails.

I will send v2 later to update the commit message if it makes sense.

Thanks,
Tiezhu


  reply	other threads:[~2025-07-23  9:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22  6:27 [PATCH net-next 0/2] Refine stmmac code Tiezhu Yang
2025-07-22  6:27 ` [PATCH net-next 1/2] net: stmmac: Return early if invalid in loongson_dwmac_fix_reset() Tiezhu Yang
2025-07-22 12:48   ` Maxime Chevallier
2025-07-22 13:10     ` Tiezhu Yang
2025-07-23  9:42       ` Tiezhu Yang [this message]
2025-07-22  6:27 ` [PATCH net-next 2/2] net: stmmac: Check stmmac_hw_setup() in stmmac_resume() Tiezhu Yang
2025-07-22 12:44   ` Maxime Chevallier
2025-07-23  7:57   ` Huacai Chen

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=cccf48de-9987-2ea5-bd38-a8e660004039@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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

all inboxes | Powered by JetHome®