Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1490607pxu; Fri, 27 Nov 2020 08:22:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRKuLG9WstnsdFof597mOZszqOvngQ+tUC3efNft8czUf/0HQteIfKlCinF+e3Bckoltc3 X-Received: by 2002:a50:eb96:: with SMTP id y22mr3004359edr.91.1606494138093; Fri, 27 Nov 2020 08:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606494138; cv=none; d=google.com; s=arc-20160816; b=vh0i0RanWi6racryFEwAHl57QZ7d3YsmyfqntnDVFrbHPFwugn1W0PcBvkjSfGGcEY wQXos0EPzc3mgcNtU7y553HrbM66zdx11hJ0sDuHEgcBB/B88KLeMe2wULKy2EFogint OHbg708YHUmPMwNV92QcU3TCIrExQnKUf/SrYAa8GyOzZ3JHsKxqOIasbWHbaC4NF8Ll TMmvYNMgzphfZbE9a28abCPSNExTdDdEoFgUwb+qaiaMDja8WrSPzyogqVxWvgWXBH6t CeYJyvdRxYc/gpLMuCeJtPyFRUlUwnLz9Ty7w4UiTsMi6YMBNUQYkyRRYzK04Qk3YP7c RGKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=+6coOvYGBwup49bYQuV1PNQQq+epO4Mgses+soWDNbM=; b=095/tK82X0w+2rObq9s4YXo/vNwg0HGuRvYH3Xi+a1pA8WFqXR+PuYS0ujJ9VdJ53q 8D0+pdgwdLAMeCBXM8klKR11AIVTP6sJ9Q+PRISxOEe39vJ8kxjavq+r8LCcOwmS+rmM 1LznPk8BhmsT8DCAh2RYJf8zls4aR8KOsbc10Ds7/eg3reUOH5hgO5saZqgwC4kyfcMU wsxK26WHL8fZOStW8UxODYIUEC8em3psPjnqt4RtXlzWs6GNA9SWiT5RPD+Ouw67g2u2 C0befrH0F0v/Jr+51ZxtFnM6yRXs+pFvogfjYXsEQfqA/HNA6FLc/FRm1TJDjl9TkG1c 5kkA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si5480620ejf.629.2020.11.27.08.21.54; Fri, 27 Nov 2020 08:22:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731451AbgK0QTF (ORCPT + 99 others); Fri, 27 Nov 2020 11:19:05 -0500 Received: from verein.lst.de ([213.95.11.211]:38050 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731437AbgK0QTE (ORCPT ); Fri, 27 Nov 2020 11:19:04 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 3D1E668B05; Fri, 27 Nov 2020 17:19:00 +0100 (CET) Date: Fri, 27 Nov 2020 17:19:00 +0100 From: Christoph Hellwig To: Hans de Goede Cc: Christoph Hellwig , Tom Yan , Mathias Nyman , Greg Kroah-Hartman , linux-usb , Linux Kernel Mailing List , linux-pci@vger.kernel.org, Lu Baolu 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 Message-ID: <20201127161900.GA10986@lst.de> References: <20201124102715.GA16983@lst.de> <8a52e868-0ca1-55b7-5ad2-ddb0cbb5e45d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a52e868-0ca1-55b7-5ad2-ddb0cbb5e45d@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 27, 2020 at 01:32:16PM +0100, Hans de Goede wrote: > I ran some more tests, I can confirm that reverting: > > 5df7ef7d32fe "uas: bump hw_max_sectors to 2048 blocks for SS or faster drives" > 558033c2828f "uas: fix sdev->host->dma_dev" > > Makes the problem go away while running a 5.10 kernel. I also tried doubling > the swiotlb size by adding: swiotlb=65536 to the kernel commandline but that > does not help. > > Some more observations: > > 1. The usb-storage driver does not cause this issue, even though it has a > very similar change. > > 2. The problem does not happen until I plug an UAS decvice into the dock. > > 3. The problem continues to happen even after I unplug the UAS device and > rmmod the uas module > > 3. made me take a bit closer look to the troublesome commit, it passes: > udev->bus->sysdev, which I assume is the XHCI controller itself as device > to scsi_add_host_with_dma, which in turn seems to cause permanent changes > to the dma settings for the XHCI controller. I'm not all that familiar with > the DMA APIs but I'm getting the feeling that passing the actual XHCI-controller's > device as dma-device to scsi_add_host_with_dma is simply the wrong thing to > do; and that the intended effects (honor XHCI dma limits, but do not cause > any changes the XHCI dma settings) should be achieved differently. > > Note that if this is indeed wrong, the matching usb-storage change should > likely also be dropped. One problem in this area is that the clamping of the DMA size through dma_max_mapping_size mentioned in the commit log doesn't work when swiotlb is called from intel-iommu. I think we need to wire up those calls there as well.