Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3355966pxu; Mon, 30 Nov 2020 00:47:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqWlzMT4fwg6waB+11JERoTLgz6JHip7ngQSE1j4n8CW+9BCNQuL9Xp2c/awN+/HSU+FpR X-Received: by 2002:a17:906:c312:: with SMTP id s18mr19940145ejz.185.1606726055052; Mon, 30 Nov 2020 00:47:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606726055; cv=none; d=google.com; s=arc-20160816; b=A+CX7cVcKBRJBoO6j1U5Oh87ApukcmwSMyTEQTsXO7aHrc7z2F4BcTWjBp5BEapjt7 gUw4sos7YBDZPH8Sm2l+mnlSPm6gpEtrc0pZaFBSPLyhxphdGcLQQBCTPAeZlUl45be/ 4HrUlE1FVbU3bBJcKqqtKApqMXfcAR/zaqORW3XgDGKKKl5IAbeWi74Hb5pxijpAIhFd tzPmOga9gZwqMWG99ndxMxhbDnuXVuDBSjhywtBknexWdBECpSWX5nLwA2l4SSS2kvzl fIMUlzUz3mRkVgTm2CbDoB/uQFCYjP7AwCV82R5bdAB6/8vh0uc8cjnlK1TNcwz2KMZY vsvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ey1C0d9PZ+jC1SeRokoRwtQYfI7PDl+5m30mISh+nx8=; b=tEaHRDe/neJWYVPa7OJKwWG54PGBMxrTrIv7AWhx9hMKUOOQMWjeSPyjqiECTdJgDf sFMY5qZIYHW5nzRUZyZ0Kr0EMRv5gC4oV/vWq2E3NjUA59piH1NDHDkx/IGR02bFTx53 LxDPThobIFU0QSl5Q99xMa19nEGBA1ZOLp93e7gjG0EkxouUaRz4goSV7U3KyX34BJTs kjeF16qil1i3G/UtY2SyicbF0kEO5MMICDT7+YZqJC1t6MNyHwVDrmOZJxwkskWl50sq HbSZwjSsyFs/d41kMwmRc7wPXo3tEODS70rWO8QEeJNortkxLDjUs6GDgAsSRpa3hIQC 8qjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N5ElSh6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si10649324ejc.434.2020.11.30.00.47.12; Mon, 30 Nov 2020 00:47:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N5ElSh6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgK3Ipa (ORCPT + 99 others); Mon, 30 Nov 2020 03:45:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27307 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbgK3Ipa (ORCPT ); Mon, 30 Nov 2020 03:45:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606725843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ey1C0d9PZ+jC1SeRokoRwtQYfI7PDl+5m30mISh+nx8=; b=N5ElSh6l3ue4g9AV/+pJ2f21bcxjeWXkMvMb7HleWN/CpBVHo+iO+LzcruagBRkIpQuMH/ aI3H4YwulFfYiNdCGcZ/f30lNfHyRQNm85SKWUh35z0UPXWplGWwwJVLQHsGR3n9BY9qKE DAEBuuSF4QbOsuVb//CSfxtCGqZtBoY= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499-0aEoM6iuO5yMiWc7A36dFQ-1; Mon, 30 Nov 2020 03:44:01 -0500 X-MC-Unique: 0aEoM6iuO5yMiWc7A36dFQ-1 Received: by mail-ej1-f70.google.com with SMTP id e7so5426019eja.15 for ; Mon, 30 Nov 2020 00:44:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ey1C0d9PZ+jC1SeRokoRwtQYfI7PDl+5m30mISh+nx8=; b=HQ3PilWVxEHamLNyLnLF5QuS4c0ED2NZRZay1uZ3PVarxQmGQYVSqdEogmaVSH2rbx j+x8ldhb1n96ooFHOOQh1Jt5AaWLbNtuyMLZfHUYo07jbrJ73hXec5ny5cf/Bz+A8qyx zVXoPUs5qoagsbZUKoxIoe06e3LQZ9fOaOcICQXkWN6vjx7WOkFJz+UTeAe8TpAd7NaT 9dvZ0MXBG5Hs4aGuh6PgB7qbQoo0qLbXTu7XtNRfMa4ttOSXCQ+jpuM/eESJzsUZChx4 kNPaCNJ1IWVUO9uTxHkN1zdPWyrx7p6FXV5IW7PT4uDCA18NYp5TcAwcOt0gBnRelXgC EnbA== X-Gm-Message-State: AOAM532587VbiBKboyhVYU4JOjvPqajnVoZ/gO3aDFrvfS195BebZMcw mnfstzvwLxM+dmtvbF8OzlxvDuF570Ghn/B3E4X6aLKcOvHFV4c5eAbQTRJ+WbE9QckuEJIhORt UTadtfp2YTt9mIRhajTOjGtO4 X-Received: by 2002:a17:906:aac1:: with SMTP id kt1mr567768ejb.329.1606725840170; Mon, 30 Nov 2020 00:44:00 -0800 (PST) X-Received: by 2002:a17:906:aac1:: with SMTP id kt1mr567760ejb.329.1606725840030; Mon, 30 Nov 2020 00:44:00 -0800 (PST) Received: from x1.localdomain (2001-1c00-0c0c-fe00-d2ea-f29d-118b-24dc.cable.dynamic.v6.ziggo.nl. [2001:1c00:c0c:fe00:d2ea:f29d:118b:24dc]) by smtp.gmail.com with ESMTPSA id d10sm7897462ejc.39.2020.11.30.00.43.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2020 00:43:59 -0800 (PST) Subject: Re: 5.10 regression caused by: "uas: fix sdev->host->dma_dev": many XHCI swiotlb buffer is full / DMAR: Device bounce map failed errors on thunderbolt connected XHCI controller To: Christoph Hellwig Cc: Tom Yan , Mathias Nyman , Greg Kroah-Hartman , linux-usb , Linux Kernel Mailing List , linux-pci@vger.kernel.org, Lu Baolu References: <20201124102715.GA16983@lst.de> <8a52e868-0ca1-55b7-5ad2-ddb0cbb5e45d@redhat.com> <20201127161900.GA10986@lst.de> <20201128171500.GA3550@lst.de> From: Hans de Goede Message-ID: Date: Mon, 30 Nov 2020 09:43:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201128171500.GA3550@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/28/20 6:15 PM, Christoph Hellwig wrote: > Can you give this one-liner a spin? > > diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c > index c6622011d4938c..e889111b55c71d 100644 > --- a/drivers/iommu/intel/iommu.c > +++ b/drivers/iommu/intel/iommu.c > @@ -4007,6 +4007,7 @@ static const struct dma_map_ops bounce_dma_ops = { > .alloc_pages = dma_common_alloc_pages, > .free_pages = dma_common_free_pages, > .dma_supported = dma_direct_supported, > + .max_mapping_size = swiotlb_max_mapping_size, > }; > > static inline int iommu_domain_cache_init(void) > I'm afraid that this does not help. Also I still find it somewhat wrong that the use of scsi_add_host_with_dma() in uas.c, which then passed the XHCI controller as dma-dev is causing changes to the DMA settings of the XHCI controller, impacting *other* USB devices and these changes also are permanent, they stay around even after unbinding the uas driver. This just feels wrong on many levels. If some changes to the XHCI controllers DMA settings are necessary for better uas performance then these changes really should be made inside the XHCI driver, so that they always apply and not have this weirdness going on where binding one USB driver permanently changes the behavior of the entire USB bus (until rebooted). Querying the DMA settings of the XHCI controller in the uas driver is fine, but changing them seems like a big nono to me. Regards, Hans