All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Joerg Roedel <joro@8bytes.org>,
	Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Samuel Sieb <samuel@sieb.net>,
	Alexander Duyck <alexander.h.duyck@linux.intel.com>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: MT76x2U crashes XHCI driver on AMD Ryzen system
Date: Sun, 3 Mar 2019 23:20:45 -0800	[thread overview]
Message-ID: <CAKxU2N-k-9DCYBv6W3CohL963dr3AeY3VHyt8FrUuo=BfacDsw@mail.gmail.com> (raw)
In-Reply-To: <20190304071037.GA2787@redhat.com>

On Sun, Mar 3, 2019 at 11:10 PM Stanislaw Gruszka <sgruszka@redhat.com> wrote:
>
> On Thu, Feb 28, 2019 at 02:40:29PM +0100, Joerg Roedel wrote:
> > On Thu, Feb 28, 2019 at 01:19:48PM +0100, Stanislaw Gruszka wrote:
> > > Nevermind, the patch is wrong, s->dma_address is initalized in sg_num_pages().
> >
> > Yes, it is. In sg_num_pages() the offset into the IOMMU mapping is
> > stored in s->dma_address, taking also the segment boundary mask into
> > account. map_sg() later only adds the base-address to that.
>
> I have some more info about the issues in
> https://bugzilla.kernel.org/show_bug.cgi?id=202673
>
> We have some bugs in mt76. Apparently we should not use
> page_frag_alloc() with size bigger than PAGE_SIZE as page_frag_alloc()
> can fallback to single page allocation. And also we should not make
> sizes unaligned as pointed in commit:
> 3bed3cc4156e ("net: Do not allocate page fragments that are not skb aligned"
As a small and totally unrelated note, page_frag_alloc is only used in
mt76 and the nvme driver ;)
>
> 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.
>
> But I don't understand why the second change was needed. Without
> it we have issue with incorrect page->_refcount . It is somehow
> related with AMD IOMMU, because on different platforms we do not
> have such problems.
>
> Joerg, could you look at this ? Thanks.
>
> Stanislaw

  reply	other threads:[~2019-03-04  7:21 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
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 [this message]
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='CAKxU2N-k-9DCYBv6W3CohL963dr3AeY3VHyt8FrUuo=BfacDsw@mail.gmail.com' \
    --to=rosenp@gmail.com \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.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.