linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Hounschell <markh-n2QNKt385d+sTnJN9+BGXg@public.gmane.org>
To: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>,
	"linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> SCSI
	development list"
	<linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: BUG: SCSI aic7xxx driver and AMD IOMMU
Date: Thu, 26 Mar 2015 13:09:45 -0400	[thread overview]
Message-ID: <55143D59.40005@compro.net> (raw)
In-Reply-To: <20150326155248.GW4441-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>

On 03/26/2015 11:52 AM, Joerg Roedel wrote:
> Hi Mark,
>
> On Thu, Mar 26, 2015 at 10:58:15AM -0400, Mark Hounschell wrote:
>> Sorry but CMA was still badly broken. I have a patch below that works.
>
> In which way is it broken? What happens when you try to allocate memory
> with dma_alloc_coherent?
>

I got Oops on both the alloc and free and I had to hit the reset button.

>> I've tested it with small (no CMA) and large (with CMA) dma's using
>> dma_alloc_coherent. The patch below is just the "git diff" from your
>> cloned tree piped to a file then copied into this email. If you require
>> an official patch I can send one. Just let me know.
>
> The main differences I can spot are that you change the order (first
> CMA, then buddy) and you manually align the input size. I can see the
> reason for the later, but why does CMA need to be tried first?
>

I believe that is how dma_alloc_coherent works. If  CMA is present it 
uses it. Even for small allocations. If not present then it does the 
best it can. That patch was derived by looking at the Intel iommu driver 
works properly. Maybe you should take a look at that.

>> Also, in my opinion, this CMA thing is clearly a BUG not a feature
>> request. The AMD iommu clearly breaks CMA. I feel what ever fix
>> you are happy with should be back ported to stable.
>
> It is not a BUG, the interface definition for dma_alloc_coherent does
> not specify that it can allocate infinite amounts of memory. So this
> patch does not qualify for stable.
>
>

I don't care what the "the interface definition for dma_alloc_coherent" 
says. If it does not describe it's use with CMA, it is outdated. Maybe 
the "interface definition for dma_alloc_coherent" was done before CMA 
was implemented.

Maybe you should be looking at CMA Documentation.  Unfortunately there 
does not yet seem to be any in the Documentation dir. Probably because 
CMA is supposed to be transparent to the DMA API. You know, one should 
not need to details about it, etc...

It is a BUG. To access CMA you use dma_alloc_coherent. You have 
completely highjacked that function.  You have broken CMA. PERIOD. That 
is a BUG.

Regards
Mark

      parent reply	other threads:[~2015-03-26 17:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 14:34 BUG: SCSI aic7xxx driver and AMD IOMMU Mark Hounschell
     [not found] ` <54E1FFFA.1060403-n2QNKt385d+sTnJN9+BGXg@public.gmane.org>
2015-03-03 19:36   ` Mark Hounschell
2015-03-23 15:03     ` Joerg Roedel
     [not found]       ` <20150323150304.GQ4441-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-03-24 11:57         ` Mark Hounschell
2015-03-25 13:59           ` Joerg Roedel
     [not found]             ` <20150325135937.GR4441-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-03-25 15:13               ` Joerg Roedel
2015-03-25 16:36                 ` Mark Hounschell
     [not found]                   ` <5512E412.9040807-n2QNKt385d+sTnJN9+BGXg@public.gmane.org>
2015-03-26 12:45                     ` Joerg Roedel
2015-03-26 14:58                       ` Mark Hounschell
2015-03-26 15:52                         ` Joerg Roedel
     [not found]                           ` <20150326155248.GW4441-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-03-26 17:09                             ` Mark Hounschell [this message]

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=55143D59.40005@compro.net \
    --to=markh-n2qnkt385d+stnjn9+bgxg@public.gmane.org \
    --cc=hare-l3A5Bk7waGM@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@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).