mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cho KyongHo <pullip.cho@samsung.com>
To: Grant Grundler <grundler@chromium.org>
Cc: Joerg Roedel <joro@8bytes.org>, Tomasz Figa <t.figa@samsung.com>,
	Linux ARM Kernel <linux-arm-kernel@lists.infradead.org>,
	Linux IOMMU <iommu@lists.linux-foundation.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Linux Samsung SOC <linux-samsung-soc@vger.kernel.org>,
	devicetree@vger.kernel.org, Kukjin Kim <kgene.kim@samsung.com>,
	Prathyush <prathyush.k@samsung.com>,
	Rahul Sharma <rahul.sharma@samsung.com>,
	Subash Patel <supash.ramaswamy@linaro.org>,
	Antonios Motakis <a.motakis@virtualopensystems.com>,
	kvmarm@lists.cs.columbia.edu,
	Sachin Kamat <sachin.kamat@linaro.org>
Subject: Re: [PATCH v9 03/16] iommu/exynos: fix page table maintenance
Date: Fri, 16 Aug 2013 20:17:21 +0900	[thread overview]
Message-ID: <20130816201721.b93a6e3db960e38b29ca7b1a@samsung.com> (raw)
In-Reply-To: <CANEJEGveOtGs8XEYFnnXoZ575bqKRkc3AMikr_1x02cNikwTng@mail.gmail.com>

On Wed, 14 Aug 2013 13:54:53 -0700, Grant Grundler wrote:
> On Wed, Aug 14, 2013 at 3:49 AM, Joerg Roedel <joro@8bytes.org> wrote:
> > On Thu, Aug 08, 2013 at 11:28:44AM -0700, Grant Grundler wrote:
> >> I can't speak to the previous BUG_ON(). I believe the EADDRESSINUSE
> >> failures could be either WARN_ON or BUG_ON.   This condition is
> >> clearly a bug in the generic IOMMU allocator and I think that's why
> >> KyongHo Cho used BUG_ON.
> >>
> >> Handing out duplicate addresses will generally lead to some sort of
> >> data corruption or other fault depending on how robust the underlying
> >> device drivers are written.  So my preference is a BUG_ON to
> >> immediately flag this condition instead of hoping a device driver will
> >> correctly handling the dma mapping failure (Some do, most currently
> >> don't).
> >>
> >> WARN_ON() + return -EADDRESSINUSE would be a good alternative.
> >
> > Even if it is a real BUG condition, I don't think it is worth to stop
> > execution at this point. It makes debugging harder and the system less
> > reliable. I prefer to go with the WARN_ON and an error return value.
> 
> I'm ok with WARN_ON and an error return value. This is "valid"
> behavior.  I expect this bug to never happen but if and when it does,
> I want a clear symptom (e.g. WARN_ON) that it happened.
> 

Ok.
Finally, everyone thinks that WARN_ON() is OK.
It will be helpful for the kernel code that uses iommu api.

> My concern is that historically, drivers did not get an error return
> value on failure:
>     ftp://193.166.3.4/pub/linux/kernel/v2.3/patch-html/patch-2.3.47/linux_Documentation_DMA-mapping.txt.html
> 
> or later:
>     https://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/Documentation/DMA-mapping.txt
> 
> And thus, some drivers don't check or attempt to handle mapping
> failures based on this existing code. Here is a recent example:
>      http://comments.gmane.org/gmane.linux.network/272969
> 
> I hope very few or none of those exist since Neil Horman demonstrated
> "dma debugging" can flag this behavior.
> 
> Just for fun, I'll include this link : (apperently 2003 was a good
> year for DMA talks :)
>      http://ols.fedoraproject.org/OLS/Reprints-2003/LinuxSymposium2003-2side.pdf
>      (three talks on DMA issues)
> 

Thank you for the resources :)
Those will be helpful for the guys with me.

> thanks
> grant

  reply	other threads:[~2013-08-16 11:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08  9:37 Cho KyongHo
2013-08-08 13:54 ` Tomasz Figa
2013-08-08 18:28   ` Grant Grundler
2013-08-14 10:49     ` Joerg Roedel
2013-08-14 20:54       ` Grant Grundler
2013-08-16 11:17         ` Cho KyongHo [this message]
2013-08-09  4:15   ` Cho KyongHo
2013-08-09  7:47     ` Tomasz Figa
2013-08-09  8:33       ` Cho KyongHo

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=20130816201721.b93a6e3db960e38b29ca7b1a@samsung.com \
    --to=pullip.cho@samsung.com \
    --cc=a.motakis@virtualopensystems.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grundler@chromium.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kgene.kim@samsung.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=prathyush.k@samsung.com \
    --cc=rahul.sharma@samsung.com \
    --cc=sachin.kamat@linaro.org \
    --cc=supash.ramaswamy@linaro.org \
    --cc=t.figa@samsung.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®