iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
To: Andy Shevchenko
	<andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	hch-jcswGhMUV9g@public.gmane.org
Cc: "linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"jesper.nilsson-VrBV9hrLPhE@public.gmane.org"
	<jesper.nilsson-VrBV9hrLPhE@public.gmane.org>,
	Alexey Brodkin
	<Alexey.Brodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Evgeniy Didin
	<Evgeniy.Didin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>,
	"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
	<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	"geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org"
	<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>,
	"dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	Eugeniy Paltsev
	<Eugeniy.Paltsev-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
Subject: Re: dma-mapping: clearing GFP_ZERO flag caused crashes of Ethernet on arc/hsdk board.
Date: Tue, 27 Mar 2018 11:24:51 -0700	[thread overview]
Message-ID: <a4bc637f-9464-c585-c6d2-663e2e38f18f@synopsys.com> (raw)
In-Reply-To: <CAHp75VeZSsdR1=ZhOM6jseYCP3m0GyE=8EjJUxWosze9BBw9rQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Christoph, Andy

On 03/27/2018 11:11 AM, Andy Shevchenko wrote:
> On Tue, Mar 27, 2018 at 8:12 PM, Evgeniy Didin
> <Evgeniy.Didin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org> wrote:
>> Hello,
>>
>> After commit  57bf5a8963f8 ("dma-mapping: clear harmful GFP_* flags in common code")  we noticed problems with Ethernet controller on one of our platforms (namely ARC HSDK).
>> I
>> n particular we see that removal of __GFP_ZERO flag in function dma_alloc_attrs() was the culprit because in our implementation of arc_dma_alloc() we only allocate zeroed pages if
>> that flag is explicitly set by the caller. Now with unconditional removal of that flag in dma_alloc_attrs() we allocate non-zeroed pages and that seem to cause problems.
>>
>> From
>> mentioned commit message I may conclude that architectural code is supposed to always allocate zeroed pages but I cannot find any requirement of that in kernel's documentation.
>> Coul
>> d you please point me to that requirement if that exists at all, then we'll implement a fix in our arch code like that:

[snip]

> Another question why caller can't ask for zero pages explicitly?

Question to whom ? The caller can ask for it - but the problem here is generic dma 
API code is clearing out GFP_ZERO and expecting arch code to memst unconditionally 
- is that expected of arch code - and is documented ?

That is broken to begin with - arch dma_alloc* simply passes thru gfp flags to 
page allocator and doesn't muck around with them. We could in theory but doesn't 
seem like the right thing to do IMO.

-Vineet

  parent reply	other threads:[~2018-03-27 18:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 17:12 dma-mapping: clearing GFP_ZERO flag caused crashes of Ethernet on arc/hsdk board Evgeniy Didin
     [not found] ` <1522170774.2593.9.camel-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2018-03-27 18:11   ` Andy Shevchenko
     [not found]     ` <CAHp75VeZSsdR1=ZhOM6jseYCP3m0GyE=8EjJUxWosze9BBw9rQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-27 18:24       ` Vineet Gupta [this message]
2018-03-27 21:19       ` Alexey Brodkin
     [not found]         ` <1522185558.6917.7.camel-HKixBCOQz3hWk0Htik3J/w@public.gmane.org>
2018-03-28  7:53           ` hch-jcswGhMUV9g

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=a4bc637f-9464-c585-c6d2-663e2e38f18f@synopsys.com \
    --to=vineet.gupta1-hkixbcoqz3hwk0htik3j/w@public.gmane.org \
    --cc=Alexey.Brodkin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=Eugeniy.Paltsev-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=Evgeniy.Didin-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jesper.nilsson-VrBV9hrLPhE@public.gmane.org \
    --cc=linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=linux-snps-arc-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.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).