Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1583091pxu; Fri, 27 Nov 2020 10:16:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJztfeEd/86/G9hi367qLLlvSePyUnRCrvVE67fH65kgOhAdktd44KK8tjSopMMUymBiZA+4 X-Received: by 2002:adf:f88c:: with SMTP id u12mr12527517wrp.209.1606501014419; Fri, 27 Nov 2020 10:16:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606501014; cv=none; d=google.com; s=arc-20160816; b=CgWzYsSZ+pdWBbgMP/rvKD+HLUEss33Ek9zqNxkp8q3jt5FkG5zGJ8gdzAYfHyDQUO 5N9igpvuEM0oIh96N/ZUWLDt4xWiPPL10F7DD9MCj9zUis3vq5aynoLxf51kDuSR6W8M MGVCEv0cV5e/XMfmWDNZd8eUHUsGZzAwF9sKdVi9ASAkYj9P0nxTWkMYy6obd9atYQv5 FiriF6aISB+n8CIAB6sCYAKi7MsxrWDK3Ac9g8HJQUK6qWyT1ATfSfbp4stn9/BXQuI3 JGq3x8agQ3CnkK/l68jENcN5o7+AYRnuIiVcjbX6PejNke7KC0pThQrPwI+VnUAqf3rf GekA== 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=PvVVh2WZkbAnSX5t/B+zX/WRWvJt82nXnXEMvGPZevw=; b=szHohj7gcj2c9kFtWoY7xdQ1syLubeIWA7syG7FnAL+PD9mVlEcs3gwz6m70D0D4fX iR9U3YZjBLqKtf3yRXGrKwDvlQda1OJJ7vXW/d0x+AcuOMRehi1461YJDglER3TMOt4H V4upuyegBP6HKqL0+e2CdjnNGyPW18jr4S4ip3QcnP3pff46AeUvnnRFwqhamMRMXJQK /vBhQjoc+eaDLuZKuMxR5dOdaWmYhA6OcMD918RLNqxO/ZFAEWQdg3KW0rBj5AZuFH44 T+E1WP7/PBnNoxKeAta41FaNop28y2r5t3mqhfFXcZ5FpLxsv9QwjhgMW1oyoCP9pgfG X3CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ggsuuNci; 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 hb18si1102337ejb.10.2020.11.27.10.16.31; Fri, 27 Nov 2020 10:16:54 -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=ggsuuNci; 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 S1733062AbgK0SMV (ORCPT + 99 others); Fri, 27 Nov 2020 13:12:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57438 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732788AbgK0SMU (ORCPT ); Fri, 27 Nov 2020 13:12:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606500738; 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=PvVVh2WZkbAnSX5t/B+zX/WRWvJt82nXnXEMvGPZevw=; b=ggsuuNciBXcWl6cOu0VynewOhZ5UZSpOcLeBgAAc/AhwEg2kD40wJMwistswKpQhaGs6gl PfixS6RrCk7I67zaNcPqfGA6r1JKRzeZgkYDST49BwH8UhcszZRCnulQjOSJThVKWxVI0o TdWOWSQ8bjbq5S6vx3VKKNS60F1EPYg= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-ZTBgglJBMcqFEmYkPNMthw-1; Fri, 27 Nov 2020 13:12:16 -0500 X-MC-Unique: ZTBgglJBMcqFEmYkPNMthw-1 Received: by mail-ed1-f69.google.com with SMTP id l24so2700610edt.16 for ; Fri, 27 Nov 2020 10:12:16 -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=PvVVh2WZkbAnSX5t/B+zX/WRWvJt82nXnXEMvGPZevw=; b=j0KBBFRNE5J13PCvKfGU7ODtye0qEqZcoAAPp9Mo7XuNNgMEwMCeILVa0TrGn8iLQp c+q0bcWlDV/WUQvD1hFtDHdrE1+n/pXCTXF4jhQRoiqhJ2A2jbgn40XOvey3RE86nJCo 1XMWqyR9XV4j/iHnHtnjA4m+B6zE9zj5ajvzopkjz8XkiSmhYThszwiknePRdfoKBUH5 /urqZ599xv/IXc1BPrMEEjI30y3IWsW2oLiwoSkM0C749ipRps/EhoXvGD+ysTuw7BKj vy3ItwXzi41oGv8qdZfaRC43Ew9RhaBkmbTvpxn8Pr4054SXLwArwW2g0XH7XFg5O+5/ dDvg== X-Gm-Message-State: AOAM531qNn97b0SvNgX/bR+cmP5v8sqktxXg6WUXQhYPe3ZYbhdkFbQQ nXhBazn3FPRb4Hb7TlUJYUg4wu7F/Vs1wWtcMGA+Vhztlw7+9DS1IYNxz5gm6H4LI5eFqhxmZD7 SkoyN6a1/tw/qkd7su1RlUOt9 X-Received: by 2002:a17:906:8617:: with SMTP id o23mr4696781ejx.274.1606500735282; Fri, 27 Nov 2020 10:12:15 -0800 (PST) X-Received: by 2002:a17:906:8617:: with SMTP id o23mr4696763ejx.274.1606500735127; Fri, 27 Nov 2020 10:12:15 -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 lc18sm1454700ejb.77.2020.11.27.10.12.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Nov 2020 10:12:14 -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> From: Hans de Goede Message-ID: Date: Fri, 27 Nov 2020 19:12:13 +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: <20201127161900.GA10986@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/27/20 5:19 PM, Christoph Hellwig wrote: > 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. Ok, but that does not sound like a quick last minute fix for 5.10, so maybe for 5.10 we should just revert the uas and usb-storage changes which trigger this problem and then retry those for 5.11 ? Regards, Hans