Linux IOMMU Development
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Rosen Penev <rosenp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Samuel Sieb <samuel-yL8jFUf1A1M@public.gmane.org>,
	linux-wireless
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Alexander Duyck
	<alexander.h.duyck-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	jan.viktorin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Lorenzo Bianconi
	<lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: MT76x2U crashes XHCI driver on AMD Ryzen system
Date: Tue, 12 Mar 2019 08:13:14 +0100	[thread overview]
Message-ID: <20190312071314.GB2483@redhat.com> (raw)
In-Reply-To: <20190311084319.GA3310-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Mon, Mar 11, 2019 at 09:43:19AM +0100, Stanislaw Gruszka wrote:
> > > However after fixing that mt76usb still did not work. To make things
> > > work we had to change rx frag size from 2048 to PAGE_SIZE and change
> > > virt_to_head_page() to virt_to_page() when setting SG's.
> >
> > > I think I understand why first change was needed. If we do 2 separate
> > > dma maps of 2 different buffers in single page i.e (PAGE + off=0
> > > and PAGE + off=2048) it causes problem. So either map_sg() return
> > > error which mt76usb does not handle correctly or there is issue
> > > in AMD IOMMU because two dma maps use the same page.
> 
> Any comment on that? Is fine or not to do 2 or more dma mappings
> within the same single page on AMD IOMMU? If not, is there any
> mechanism for drivers to find out about this limitation to prevent
> to prepare wrong SG buffers?

FTR: it was confirmed by Jan (bug reporter) the 2 or more dma mappings
within single page works with AMD IOMMU. Most likely it was needed
previously to workaround this sg->offset problem until proper fix to
AMD IOMMU was applied.

Stanislaw 

      parent reply	other threads:[~2019-03-12  7:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKxU2N9o5WeUwFMUwwXKHaPj7R+oiSKV1c2n8RtXwGNZRtw5Sw@mail.gmail.com>
     [not found] ` <CAJ0CqmVNF83bWgc+LSQ3_i=zfp-sXC5Nf=nKfqB3SWa8r7sKdQ@mail.gmail.com>
     [not found]   ` <83A1D243-9073-48D1-9F26-5A2581DCB829@gmail.com>
     [not found]     ` <CAJ0CqmUgPWNJtCW4Q__sOtB8w-YtwW+uZy7crxMNrmSgQ6OFyA@mail.gmail.com>
     [not found]       ` <1547404075.1582.0@smtp.gmail.com>
     [not found]         ` <CAJ0CqmU7k5i26g7dGPxNdts7Gm67W6qNsr4vYuW05ugsEF1ohw@mail.gmail.com>
     [not found]           ` <CAKxU2N-+CTaRdJMFVRdozJ5TTpN+_4thiDRBJBFq8gGtuRVYvA@mail.gmail.com>
     [not found]             ` <20190114091841.GA23045@localhost.localdomain>
     [not found]               ` <CAKxU2N8ioMszBCyQcH7CVhgBdW4aj7yZ+kYQe14DCV5OSAnxrg@mail.gmail.com>
     [not found]                 ` <20190115090400.GA2267@localhost.localdomain>
     [not found]                   ` <20190115090400.GA2267-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2019-02-18 14:37                     ` MT76x2U crashes XHCI driver on AMD Ryzen system Stanislaw Gruszka
2019-02-18 17:01                       ` Robin Murphy
     [not found]                         ` <2cc5674a-a3a0-d8fe-65f5-4357da9b85d3-5wv7dgnIgG8@public.gmane.org>
2019-02-19 11:08                           ` Stanislaw Gruszka
     [not found]                       ` <20190218143742.GA11872-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-02-18 15:15                         ` Lorenzo Bianconi
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
     [not found]                                             ` <CAKxU2N-k-9DCYBv6W3CohL963dr3AeY3VHyt8FrUuo=BfacDsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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 15:47                                                   ` Alexander Duyck
2019-03-12  7:08                                                     ` Stanislaw Gruszka
     [not found]                                                       ` <20190312070832.GA2483-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-03-12 15:18                                                         ` Alexander Duyck
2019-03-13  9:03                                                           ` [PATCH v2] " Stanislaw Gruszka
2019-03-18 10:17                                                             ` Joerg Roedel
     [not found]                                                 ` <20190311084319.GA3310-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2019-03-12  7:13                                                   ` Stanislaw Gruszka [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=20190312071314.GB2483@redhat.com \
    --to=sgruszka-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=alexander.h.duyck-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jan.viktorin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=rosenp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=samuel-yL8jFUf1A1M@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