From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: "davem@davemloft.net" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"arc-linux-dev@synopsys.com" <arc-linux-dev@synopsys.com>,
"peppe.cavallaro@st.com" <peppe.cavallaro@st.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] stmmac: explicitly zero des0 & des1 on init
Date: Tue, 23 Jun 2015 15:04:31 +0000 [thread overview]
Message-ID: <1435071870.3298.1.camel@synopsys.com> (raw)
In-Reply-To: <1434955394.4269.6.camel@synopsys.com>
Hi David,
On Mon, 2015-06-22 at 09:43 +0300, Alexey Brodkin wrote:
> Hi David,
>
> On Sun, 2015-06-21 at 09:29 -0700, David Miller wrote:
> > From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
> > Date: Tue, 16 Jun 2015 20:40:41 +0300
> >
> > > Current implementtion of descriptor init procedure only takes
> > > care
> > > about
> > > ownership flag. While it is perfectly possible to have underlying
> > >
> > > memory
> > > filled with garbage on boot or driver installation.
> > >
> > > And randomly set flags in non-zeroed des0 and des1 fields may
> > > lead
> > > to
> > > unpredictable behavior of the GMAC DMA block.
> > >
> > > Solution to this problem is as simple as explicit zeroing of both
> > >
> > > des0
> > > and des1 fields of all buffer descriptors.
> > >
> > > Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> >
> > If you need the memory zero initialized, use dma_zalloc_coherent().
>
> Indeed usage of dma_zalloc_coherent() will resolve observed issue.
> But since buffer descriptors are reused extensively I would say that
> explicit zeroing of fields with flags is useful. Probably I need to
> add
> this clarification in commit message.
>
> And then if we do that explicit zeroing of flags and other fields
> which
> hold data size and addresses of data buffer and the next descriptor
> in
> chain are all get set later we may not care about allocation of
> zeroed
> memory.
I'm wondering if my comment makes sense and should I just change commit
message or you'd prefer to still use dma_zalloc_coherent() during
driver probe?
-Alexey
next prev parent reply other threads:[~2015-06-23 15:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 17:40 [PATCH] stmmac: explicitly zero des0 & des1 on init Alexey Brodkin
2015-06-17 7:03 ` [arc-linux-dev] " Vineet Gupta
2015-06-22 8:08 ` Alexey Brodkin
2015-06-22 8:34 ` Vineet Gupta
2015-06-21 16:29 ` David Miller
2015-06-22 6:43 ` Alexey Brodkin
2015-06-23 15:04 ` Alexey Brodkin [this message]
2015-06-24 7:18 ` David Miller
2015-06-24 8:07 ` [PATCH v2] stmmac: troubleshoot unexpected bits in des0 & des1 Alexey Brodkin
2015-06-24 8:44 ` David Miller
2015-06-24 8:36 ` Alexey Brodkin
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=1435071870.3298.1.camel@synopsys.com \
--to=alexey.brodkin@synopsys.com \
--cc=arc-linux-dev@synopsys.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=stable@vger.kernel.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).