From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> To: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Rosen Penev <rosenp@gmail.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, Joerg Roedel <joro@8bytes.org>, linux-kernel@vger.kernel.org Subject: Re: MT76x2U crashes XHCI driver on AMD Ryzen system Date: Mon, 18 Feb 2019 16:15:22 +0100 [thread overview] Message-ID: <20190218151521.GB9283@localhost.localdomain> (raw) In-Reply-To: <20190218143742.GA11872@redhat.com> > (cc: IOMMU & page_frag_alloc maintainers) > > On Tue, Jan 15, 2019 at 10:04:01AM +0100, Lorenzo Bianconi wrote: > > > On Mon, Jan 14, 2019 at 1:18 AM Lorenzo Bianconi > > > <lorenzo.bianconi@redhat.com> wrote: > > > > > > > > > On Sun, Jan 13, 2019 at 11:00 AM Lorenzo Bianconi > > > > > <lorenzo.bianconi@redhat.com> wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > On Sun, Jan 13, 2019 at 5:33 AM, Lorenzo Bianconi <lorenzo.bianconi@redhat.com> wrote: > > > > > > > > > > > > > > Direct. No VM used. This is the only peripheral causing this issue. > > > > > > > > > > > > > > Is the device connected to a usb3.0 port? If so, could you please try to connect the dongle to a 2.0 one? > > > > > > > > > > > > > > I tried through a USB 2.0 port. Shouldn't make a difference as they both use the xhci driver. > > > > > > > > > > > > > > > > > > > mt76x2u supports scatter-gather on usb 3.0 (not on 2.0) > > > > > Tried a USB 3 port. Same result. > > > > > > > > > > > > > Could you please double check if IOMMU is enabled? > > > > > > > > > > > > > > > > > > > Have you tried to disable it? Does it make any difference? > > > > > No idea how. UEFI doesn't seem to show anything similar. > > > > > > > > > > Similar bug report: https://bugzilla.kernel.org/show_bug.cgi?id=202241 > > FWIW: I provided some patches in the bugzilla, which were reported to > solve the problem. But I looking for confirmation if both are needed: > > 0001-mt76x02u-use-usb_bulk_msg-to-upload-firmware.patch > 0002-mt76usb-do-not-use-compound-head-page-for-SG-I-O.patch > > Or problem can be solved by just one of it (either first or second). > > Additionally I'm not 100% sure if > > 0002-mt76usb-do-not-use-compound-head-page-for-SG-I-O.patch > > is correct. So perhaps some IOMMU maintainer could look at it. > > > > > You should be able to disable iommu using GRUB_CMDLINE_LINUX in > > > > /etc/default/grub (I guess setting iommu=off and reinstalling grub) > > > > https://wiki.gentoo.org/wiki/IOMMU_SWIOTLB > > > Yep. Working great now. I wonder what mt76 is doing to cause the crash though... > > > > Thanks for bisecting the issue. > > Lorenzo, what you mean by 'bisecting' here ? Someone did 'git bisect' > on this issue? > Hi Stanislaw, I was meaning 'help bisecting' the issue > > I think amd iommu does not support well usb scatter-gather > > (used by default in mt76u). I am working on a series in order to add the possibility to > > disable it. > > Even if that true that AMD IOMMU does not support 'well' SG (what I think > is not true) disabling SG in mt76 driver is not right solution. Right > solution would be propagate the issue to AMD IOMMU maintainers > (already CCed). I meant that AMD iommu seems to have different constraints respect to Intel one. Regards, Lorenzo > > One problem in mt76 is page_frag_alloc() usage with different sizes. > page_frag_alloc() unlike like other allocators do not assure alignment > and relay on callers to provide buffers sizes that are aligned. > Unaligned buffer might then not be appropriate for DMA. > > 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. > > Stanislaw
WARNING: multiple messages have this Message-ID (diff)
From: Lorenzo Bianconi <lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> To: Stanislaw Gruszka <sgruszka-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> Cc: Rosen Penev <rosenp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, linux-wireless <linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, Samuel Sieb <samuel-yL8jFUf1A1M@public.gmane.org>, Alexander Duyck <alexander.h.duyck-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: MT76x2U crashes XHCI driver on AMD Ryzen system Date: Mon, 18 Feb 2019 16:15:22 +0100 [thread overview] Message-ID: <20190218151521.GB9283@localhost.localdomain> (raw) In-Reply-To: <20190218143742.GA11872-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > (cc: IOMMU & page_frag_alloc maintainers) > > On Tue, Jan 15, 2019 at 10:04:01AM +0100, Lorenzo Bianconi wrote: > > > On Mon, Jan 14, 2019 at 1:18 AM Lorenzo Bianconi > > > <lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > > > > > > > > > On Sun, Jan 13, 2019 at 11:00 AM Lorenzo Bianconi > > > > > <lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > On Sun, Jan 13, 2019 at 5:33 AM, Lorenzo Bianconi <lorenzo.bianconi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > > > > > > > > > > > > > > Direct. No VM used. This is the only peripheral causing this issue. > > > > > > > > > > > > > > Is the device connected to a usb3.0 port? If so, could you please try to connect the dongle to a 2.0 one? > > > > > > > > > > > > > > I tried through a USB 2.0 port. Shouldn't make a difference as they both use the xhci driver. > > > > > > > > > > > > > > > > > > > mt76x2u supports scatter-gather on usb 3.0 (not on 2.0) > > > > > Tried a USB 3 port. Same result. > > > > > > > > > > > > > Could you please double check if IOMMU is enabled? > > > > > > > > > > > > > > > > > > > Have you tried to disable it? Does it make any difference? > > > > > No idea how. UEFI doesn't seem to show anything similar. > > > > > > > > > > Similar bug report: https://bugzilla.kernel.org/show_bug.cgi?id=202241 > > FWIW: I provided some patches in the bugzilla, which were reported to > solve the problem. But I looking for confirmation if both are needed: > > 0001-mt76x02u-use-usb_bulk_msg-to-upload-firmware.patch > 0002-mt76usb-do-not-use-compound-head-page-for-SG-I-O.patch > > Or problem can be solved by just one of it (either first or second). > > Additionally I'm not 100% sure if > > 0002-mt76usb-do-not-use-compound-head-page-for-SG-I-O.patch > > is correct. So perhaps some IOMMU maintainer could look at it. > > > > > You should be able to disable iommu using GRUB_CMDLINE_LINUX in > > > > /etc/default/grub (I guess setting iommu=off and reinstalling grub) > > > > https://wiki.gentoo.org/wiki/IOMMU_SWIOTLB > > > Yep. Working great now. I wonder what mt76 is doing to cause the crash though... > > > > Thanks for bisecting the issue. > > Lorenzo, what you mean by 'bisecting' here ? Someone did 'git bisect' > on this issue? > Hi Stanislaw, I was meaning 'help bisecting' the issue > > I think amd iommu does not support well usb scatter-gather > > (used by default in mt76u). I am working on a series in order to add the possibility to > > disable it. > > Even if that true that AMD IOMMU does not support 'well' SG (what I think > is not true) disabling SG in mt76 driver is not right solution. Right > solution would be propagate the issue to AMD IOMMU maintainers > (already CCed). I meant that AMD iommu seems to have different constraints respect to Intel one. Regards, Lorenzo > > One problem in mt76 is page_frag_alloc() usage with different sizes. > page_frag_alloc() unlike like other allocators do not assure alignment > and relay on callers to provide buffers sizes that are aligned. > Unaligned buffer might then not be appropriate for DMA. > > 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. > > Stanislaw
next prev parent reply other threads:[~2019-02-18 15:15 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 [this message] 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 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=20190218151521.GB9283@localhost.localdomain \ --to=lorenzo.bianconi@redhat.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=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: linkBe 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.