Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1792244imc; Tue, 12 Mar 2019 00:14:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzw4+CylE+a4XqucbZ8oC4PUcjPCUoRXTKayORib8YlePLCrr2KS9Ikvk/p1Qod6b8SUzv/ X-Received: by 2002:a17:902:1486:: with SMTP id k6mr27208699pla.3.1552374857089; Tue, 12 Mar 2019 00:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552374857; cv=none; d=google.com; s=arc-20160816; b=lN5+YGcw4KI+dCwt04EBS5OU9YPDP6fD8j1x+N6jTX6KC84Yn13ssCAjcvDPbdMA6u PFVWBY6/pG8O4anRMRJ5UyH7ZerdXdLia6mlp3H0eDJgXMAhDFlmBzq4KTot6/kgZYt3 w/k4InpgizOEGTasqKzudrkWyj92V1C35nDKP6Htn5x1kDJzqfB7uDHLAIWeYkWufgbc MOk/lShWqpICqgjG2lSSTHPb+G0p7Il4i4d3cjOtBBlBaS6/mn1IDgbXzWTdIutAozMC vQYeQvPmcn83xf2tAdv7ftgrcx7n0bxjWETOO/d7HthWBT5kCvHG//p72V4IpUiDmqME vsJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xCFrT5Dk9BrTtqWKA2Hf7ZWjM/jdpQuDsvsgS3kB8Q8=; b=l6uPhJjUyPFn20TCWdT9kjMhUuGealfJaaCrJSbU2PuzBq66aR6797aIYVtF4NEuDL 1DOS5ULf3P+qYhaonZ3wJIPptcMQOp2ZaJdZ73RGaAtDfkf3omhN/IfB/rRVH/IN9kAt KOU5d7SifnuAyxUZtCga/yPBxZBLEC2x8sfAkH5pJQIubHya19DyMl7Y9JkHvlNL4rvl W5aV9Qh53s4Z8pbsuAr2An53O616ejsWk3DBCYXbe/tmBqXtcB011s9AeN8zrZ+gtfv+ lwYnaTKyP5gbzNNVIO/sP8qm55hBXNLFeY6aaaHM10+OvKa4FSoHZac00h3Wgj+nuN8B V3rA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si7130589pgc.472.2019.03.12.00.14.01; Tue, 12 Mar 2019 00:14:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbfCLHNS (ORCPT + 99 others); Tue, 12 Mar 2019 03:13:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbfCLHNS (ORCPT ); Tue, 12 Mar 2019 03:13:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4259A308125D; Tue, 12 Mar 2019 07:13:18 +0000 (UTC) Received: from localhost (ovpn-204-138.brq.redhat.com [10.40.204.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 770EC60A9A; Tue, 12 Mar 2019 07:13:15 +0000 (UTC) Date: Tue, 12 Mar 2019 08:13:14 +0100 From: Stanislaw Gruszka To: Rosen Penev Cc: Joerg Roedel , Lorenzo Bianconi , linux-wireless , Samuel Sieb , Alexander Duyck , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, jan.viktorin@gmail.com Subject: Re: MT76x2U crashes XHCI driver on AMD Ryzen system Message-ID: <20190312071314.GB2483@redhat.com> References: <20190226103450.GA2989@redhat.com> <20190226104413.GH20740@8bytes.org> <20190226112407.GB2989@redhat.com> <20190228090411.GA24938@redhat.com> <20190228104223.GA2749@redhat.com> <20190228121948.GD6072@redhat.com> <20190228134029.GC1594@8bytes.org> <20190304071037.GA2787@redhat.com> <20190311084319.GA3310@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190311084319.GA3310@redhat.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 12 Mar 2019 07:13:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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