Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1673308ybt; Thu, 2 Jul 2020 10:56:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCcvH9LvMED+ScHxiL2AWlUR92x79qxKz/zVz3RoEKQVnWP6+Vne28rBhNjZ53bBm3DeJp X-Received: by 2002:a17:906:d143:: with SMTP id br3mr27206213ejb.268.1593712586321; Thu, 02 Jul 2020 10:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593712586; cv=none; d=google.com; s=arc-20160816; b=X9vJNxkt+m5brmh/eP06b9MKfWsAEslfVmPdGblPj/TEuNit8btyrMSkMQox+TPhKl DMAckICHI9VqoZf4onKJBeNYURKuBDKhs3ZyvScKQCTb/+BXNl4GT80+vglzE1d9/wFY 7njJJvW8gK3ROXMvtBk4WJFK1D10cZ/qY+YGYlHQz/8ZArPLQl5KE2Lw6lfI8+05lTIi vnOafnkYlEB9Q+U78wbAekUo3klWIUxcDjrdgjC6s1JtAFx1MhPYDGPM7NIQb03ZQyR/ DqyKvQjgmwE8Prh78oaDuzT6e1ZmFGKqWQeXedomQzfDI+bjnIazu/jthpH1xRRlFBbh NSBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:to; bh=La8OEdfGzOl77DIc9euSzAnfSaVCRgjW1k8jiOV2Zfc=; b=A7cFRClEZXaOTKmyIObToaJi9KOt4WnHW2ynYXIntD2dE+kLWLxmPVSiuiy/36uUFU jQngJaoLn1dCsLNhY/SxI4r1OBnOsThPjRMwgObimZcY2257XStlLif/eSsAlyNX+xkg iiKSjwsIqok4ynpEKOWy6iXvMFCMaP2yRsJi5tR8z7PmLiu1RHDAe09EiFkuzx5UyhrE 1R0Krlcb0jKXvJ9Z5A1HjP1ftCQE8Jz68TQypN9ihohx1ml2hX4pwl/TU19HH6b/Mi/t gpB7NWzxDFPbbM7W8L65oaictXP1KSv5+KCLftqeAM3PnCf4vmVrNmYswavkWe1fc2zE UUnw== 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 u17si5963109edy.254.2020.07.02.10.56.03; Thu, 02 Jul 2020 10:56:26 -0700 (PDT) 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 S1728024AbgGBRzH (ORCPT + 99 others); Thu, 2 Jul 2020 13:55:07 -0400 Received: from foss.arm.com ([217.140.110.172]:48648 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727985AbgGBRzH (ORCPT ); Thu, 2 Jul 2020 13:55:07 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B4C1A1FB; Thu, 2 Jul 2020 10:55:06 -0700 (PDT) Received: from [192.168.122.166] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 653B23F71E; Thu, 2 Jul 2020 10:55:06 -0700 (PDT) To: "linux-arm-kernel@lists.infradead.org" , linux-mm@kvack.org, "linux-usb@vger.kernel.org" , rientjes@google.com, Christoph Hellwig , Nicolas Saenz Julienne , "linux-kernel@vger.kernel.org" From: Jeremy Linton Subject: [BUG] XHCI getting ZONE_DMA32 memory > than its bus_dma_limit Message-ID: <34619bdf-6527-ae82-7e4d-e2ea7c67ed56@arm.com> Date: Thu, 2 Jul 2020 12:49:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Using 5.8rc3: The rpi4 has a 3G dev->bus_dma_limit on its XHCI controller. With a usb3 hub, plus a few devices plugged in, randomly devices will fail operations. This appears to because xhci_alloc_container_ctx() is getting buffers > 3G via dma_pool_zalloc(). Tracking that down, it seems to be caused by dma_alloc_from_pool() using dev_to_pool()->dma_direct_optimal_gfp_mask() to "optimistically" select the atomic_pool_dma32 but then failing to verify that the allocations in the pool are less than the dev bus_dma_limit. Thanks,