All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>,
	Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Cc: Samuel Sieb <samuel@sieb.net>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	Rosen Penev <rosenp@gmail.com>,
	Alexander Duyck <alexander.h.duyck@linux.intel.com>
Subject: Re: MT76x2U crashes XHCI driver on AMD Ryzen system
Date: Mon, 18 Feb 2019 17:01:59 +0000	[thread overview]
Message-ID: <2cc5674a-a3a0-d8fe-65f5-4357da9b85d3@arm.com> (raw)
In-Reply-To: <20190218143742.GA11872@redhat.com>

On 18/02/2019 14:37, Stanislaw Gruszka wrote:
[...]
> Another issue is that dma_map_sg() & dma_map_page() may require some
> constraints. I'm not sure about that and I want to clarify that with
> CCed mm maintainers. I think DMA drivers may expect sg->offset < PAGE_SIZE
> for both dma_map_sg() and dma_map_page(). Additionally dma_map_page()
> maight expect that offset & length specify buffer within one page.

Luckily, this came up a while back[1] and we seemed to reach a consensus 
that sg->offset >= PAGE_SIZE for dma_map_sg() was weird but valid. IIRC 
it was only the Intel IOMMU code which failed to handle that case 
appropriately (and which I fixed) - the AMD IOMMU code always looked 
like it should be OK, but I'm not sure I've ever seen definitive test 
results (and I don't have hardware to do so myself).

For dma_map_page(), length >= PAGE_SIZE should be perfectly valid and 
handled correctly. The offset >= PAGE_SIZE case is a bit harder to 
justify, but at the same time has less scope for the DMA API backend to 
get it wrong, so either way is likely to be OK in practice (in 
particular the AMD IOMMU code looks like it won't have a problem, since 
its map_page() implementation converts page and offset to a plain 
physical address before doing anything else).

Robin.

[1] 
https://lists.linuxfoundation.org/pipermail/iommu/2017-September/024148.html

  parent reply	other threads:[~2019-02-18 17:37 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 22:55 MT76x2U crashes XHCI driver on AMD Ryzen system Rosen Penev
2019-01-11 17:29 ` Lorenzo Bianconi
2019-01-11 19:01   ` Rosen Penev
2019-01-13 13:33     ` Lorenzo Bianconi
     [not found]       ` <1547404075.1582.0@smtp.gmail.com>
2019-01-13 19:00         ` Lorenzo Bianconi
2019-01-14  2:20           ` Rosen Penev
2019-01-14  3:13             ` Samuel Sieb
2019-01-14  9:18             ` Lorenzo Bianconi
2019-01-14  9:22               ` Tom Psyborg
2019-01-14 20:06               ` Rosen Penev
2019-01-15  9:04                 ` Lorenzo Bianconi
2019-02-18 14:37                   ` Stanislaw Gruszka
2019-02-18 14:37                     ` Stanislaw Gruszka
2019-02-18 15:15                     ` Lorenzo Bianconi
2019-02-18 15:15                       ` Lorenzo Bianconi
2019-02-18 17:01                     ` Robin Murphy [this message]
2019-02-19 11:08                       ` Stanislaw Gruszka
2019-02-19 11:08                         ` Stanislaw Gruszka
2019-02-26 10:05                     ` Joerg Roedel
2019-02-26 10:05                       ` Joerg Roedel
2019-02-26 10:34                       ` Stanislaw Gruszka
2019-02-26 10:44                         ` Joerg Roedel
2019-02-26 11:24                           ` Stanislaw Gruszka
2019-02-28  9:04                             ` Stanislaw Gruszka
2019-02-28 10:42                               ` Stanislaw Gruszka
2019-02-28 12:19                                 ` Stanislaw Gruszka
2019-02-28 13:40                                   ` Joerg Roedel
2019-03-04  7:10                                     ` Stanislaw Gruszka
2019-03-04  7:20                                       ` Rosen Penev
2019-03-11  8:43                                         ` Stanislaw Gruszka
2019-03-11  8:43                                           ` Stanislaw Gruszka
2019-03-11  8:43                                           ` Stanislaw Gruszka
2019-03-11  9:03                                           ` [PATCH] iommu/amd: fix sg->dma_address for sg->offset bigger than PAGE_SIZE Stanislaw Gruszka
2019-03-11  9:03                                             ` Stanislaw Gruszka
2019-03-11  9:03                                             ` Stanislaw Gruszka
2019-03-11 15:47                                             ` Alexander Duyck
2019-03-11 15:47                                               ` Alexander Duyck
2019-03-11 15:47                                               ` Alexander Duyck
2019-03-12  7:08                                               ` Stanislaw Gruszka
2019-03-12  7:08                                                 ` Stanislaw Gruszka
2019-03-12 15:18                                                 ` Alexander Duyck
2019-03-12 15:18                                                   ` Alexander Duyck
2019-03-12 15:18                                                   ` Alexander Duyck
2019-03-13  9:03                                                   ` [PATCH v2] " Stanislaw Gruszka
2019-03-13  9:03                                                     ` Stanislaw Gruszka
2019-03-13  9:03                                                     ` Stanislaw Gruszka
2019-03-18 10:17                                                     ` Joerg Roedel
2019-03-18 10:17                                                       ` Joerg Roedel
     [not found]                                                     ` <20190325003822.2AB72213F2@mail.kernel.org>
2019-03-25 11:19                                                       ` Stanislaw Gruszka
2019-03-12  7:13                                           ` MT76x2U crashes XHCI driver on AMD Ryzen system Stanislaw Gruszka
2019-03-12  7:13                                             ` Stanislaw Gruszka
2019-03-12  7:13                                             ` Stanislaw Gruszka

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=2cc5674a-a3a0-d8fe-65f5-4357da9b85d3@arm.com \
    --to=robin.murphy@arm.com \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=rosenp@gmail.com \
    --cc=samuel@sieb.net \
    --cc=sgruszka@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.