From: Andrew Lunn <andrew@lunn.ch>
To: Tan En De <endeneer@gmail.com>
Cc: netdev@vger.kernel.org, alexandre.torgue@foss.st.com,
joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com,
linux-kernel@vger.kernel.org, leyfoon.tan@starfivetech.com,
Tan En De <ende.tan@starfivetech.com>
Subject: Re: [net,1/1] net: stmmac: Set OWN bit last in dwmac4_set_rx_owner()
Date: Fri, 9 Aug 2024 22:25:09 +0200 [thread overview]
Message-ID: <06297829-0bf7-4a06-baaf-e32c39888947@lunn.ch> (raw)
In-Reply-To: <20240809144229.1370-1-ende.tan@starfivetech.com>
On Fri, Aug 09, 2024 at 10:42:29PM +0800, Tan En De wrote:
> Ensure that all other bits in the RDES3 descriptor are configured before
> transferring ownership of the descriptor to DMA via the OWN bit.
Are you seeing things going wrong with real hardware, or is this just
code review? If this is a real problem, please add a description of
what the user would see.
Does this need to be backported in stable?
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
If it does, you should add a Fixes: tag and 'Cc: stable@vger.kernel.org'
This will also decide which tree you need to base the patch on:
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq
> static void dwmac4_set_rx_owner(struct dma_desc *p, int disable_rx_ic)
> {
> - p->des3 |= cpu_to_le32(RDES3_OWN | RDES3_BUFFER1_VALID_ADDR);
> + p->des3 |= cpu_to_le32(RDES3_BUFFER1_VALID_ADDR);
>
> if (!disable_rx_ic)
> p->des3 |= cpu_to_le32(RDES3_INT_ON_COMPLETION_EN);
> +
> + dma_wmb();
> + p->des3 |= cpu_to_le32(RDES3_OWN);
Is the problem here that RDES3_INT_ON_COMPLETION_EN is added after the
RDES3_OWN above has hit the hardware, so it gets ignored?
It seems like it would be better to calculate the value in a local
variable, and then assign to p->des3 once.
Andrew
next prev parent reply other threads:[~2024-08-09 20:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 14:42 Tan En De
2024-08-09 20:25 ` Andrew Lunn [this message]
2024-08-10 2:58 ` EnDe Tan
2024-08-10 15:36 ` Andrew Lunn
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=06297829-0bf7-4a06-baaf-e32c39888947@lunn.ch \
--to=andrew@lunn.ch \
--cc=alexandre.torgue@foss.st.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ende.tan@starfivetech.com \
--cc=endeneer@gmail.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=leyfoon.tan@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcoquelin.stm32@gmail.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®