Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3492489pxj; Tue, 11 May 2021 05:52:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB/906Y9k3jq4wwQI0pYRah4am0dINwknMMmTJTrgULWtToGqKIt/71uart2Np0vrfAEvg X-Received: by 2002:a02:cc61:: with SMTP id j1mr27108139jaq.136.1620737562609; Tue, 11 May 2021 05:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620737562; cv=none; d=google.com; s=arc-20160816; b=f9701BGcuW1f4m7wqFtear2TsgjvoXafYKHfNKJndtJzBfs+p05r/zQlcWrv0v/JVq wdZdOlNyxVEMeA0mMKa8FnkE5pRb0pqRgu6EN5pZKNAH9oMerjTgTL5Byi7mnv9iceJT IN4PtLbngNqoGa4hMHaqMveofH/sNFNR5vm/GvnbIhz5NI5TT+xK9Pf7y0gh0RvuHQ3h f80gbRaWILGBN0X1NCAaEnjQsHoghoA2kVmrz2mGkpmxjLMgSL2z6vQFzdWg+gsOR63V Mob5kFlIVmA4a7e3d7zWnW/uoaqCXWyvpqZEnhMBeuViuSiEsN7PRuBIdZJPCWDdjJXg Ix5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AtlaChiKHJEoOrKhQo7KFd2i26uZ7qyixOAMRudY7ag=; b=HMnsuLS6Cy8X1aP/11VCH6M/Ey8Sy49em40zIqDzHFSOfd825U0H6CWC3WllOutevw C5aCgaNRF7WLpeuNUHrRjqv0nW6pyrdFS8+A2dccsZAIJWmKLmGLxcePi8D/cXyc5x3T 0TqO/2RmJol+qIKNiEBV4sfKE4TyHKSMgh40/wfDMBpnrCAov+9maL9qpSYOlYCZIG/x /sFLnoCgw0KdL25bimh4VIeXjG8WzugWdKrlX11JlVXHLxClrKcIHWaDg955tMc/WssE hpq3MUFJwz0DCOj3Ug60SbVT60m7H6rqBuVeK2VzxmxNO+/jSrCT25l7CemR6aX1YB83 cQfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rs3Xr67x; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e194si19488651iof.53.2021.05.11.05.52.29; Tue, 11 May 2021 05:52:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Rs3Xr67x; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbhEKMw1 (ORCPT + 99 others); Tue, 11 May 2021 08:52:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231270AbhEKMw0 (ORCPT ); Tue, 11 May 2021 08:52:26 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2FE5C061574; Tue, 11 May 2021 05:51:19 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id bf4so22717150edb.11; Tue, 11 May 2021 05:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AtlaChiKHJEoOrKhQo7KFd2i26uZ7qyixOAMRudY7ag=; b=Rs3Xr67xM8FhKJF6nPdbMkrlJZiS+flW87rJoRFam+4Epnv9yUgySyERAeK3GzVf2P PkkX4e5Ah5ULA3CHlyuHB8AUkDN8TLSfm80iJ9DoUPRqyfChSPjevr2vtxm5bZfpDJQ/ I9hZruacfWYcOzLR842+hp/1ev3/Gv0QBSFwgn1aQxNK2fyBQPC07XQvRbOWAWZoQENJ +LEk9L3N+Hv+ThxbAueClbIetRg9k365CoYN5A1WNOOIoU5xIgB4Ds7VWA8vt2Y3maqL gGxGZQEMs6UMbQLCm/swslmyn+UgsxW3JBqJrF5ht0bjDVd5OWnzHqQVMtyCtQAzSW5E FAHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AtlaChiKHJEoOrKhQo7KFd2i26uZ7qyixOAMRudY7ag=; b=ZdT5jRyvsXMOlksisvIYG9XAPd89+vdJFWEEChhjjtVDXeIXPiCChef2d7WRcfdTX6 /08UjRqbl6YxqQSNs0Qm/79iCE/lAfSn8v4mqAJIsic7MC82sUC1Z6TjF75htxqK/hoI AaGWaaAiSNfSCCjvqD4ZTtaoyqL9w+kIWcyVV+YMjS7p4tpscKClwqkDl3Sc0P1EVTHr 7LOTsn3MEoT77uown0CO8Wlp0gVQu/5J525WZX4BC9CmRAWtioAr6sgr+yRGc2DImL8W VAsaxFpPjbi49pWzhJPNi0Cb18NUBKoru6e82es5uW0OL0PKxnGUCpcRk9+b/1w0zDr+ SeAw== X-Gm-Message-State: AOAM533Ug9WPEGLjl2AIq2+CqoUw58zruDYUasEZdwcTFVtaEcTYAQE1 q1XbDAT8HstP7HyracCIMWc= X-Received: by 2002:aa7:cc98:: with SMTP id p24mr11102230edt.353.1620737478235; Tue, 11 May 2021 05:51:18 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.gmail.com with ESMTPSA id r16sm14607820edq.87.2021.05.11.05.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 05:51:17 -0700 (PDT) Date: Tue, 11 May 2021 14:51:15 +0200 From: Ansuel Smith To: Ard Biesheuvel Cc: Matthew Wilcox , Russell King , Jonathan Corbet , Linus Walleij , Florian Fainelli , Abbott Liu , Luis Chamberlain , Palmer Dabbelt , Linux Doc Mailing List , Linux Kernel Mailing List , Linux ARM Subject: Re: [PATCH] arm: Enlarge IO_SPACE_LIMIT needed for some SoC Message-ID: References: <20210511021656.17719-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 02:46:49PM +0200, Ard Biesheuvel wrote: > On Tue, 11 May 2021 at 14:37, Ansuel Smith wrote: > > > > On Tue, May 11, 2021 at 02:30:36PM +0200, Ard Biesheuvel wrote: > > > On Tue, 11 May 2021 at 14:15, Ansuel Smith wrote: > > > > > > > > On Tue, May 11, 2021 at 06:26:28AM +0200, Ard Biesheuvel wrote: > > > > > On Tue, 11 May 2021 at 04:32, Ansuel Smith wrote: > > > > > > > > > > > > On Tue, May 11, 2021 at 03:24:29AM +0100, Matthew Wilcox wrote: > > > > > > > On Tue, May 11, 2021 at 04:16:54AM +0200, Ansuel Smith wrote: > > > > > > > > Ipq8064 SoC requires larger IO_SPACE_LIMIT on second and third pci port. > > > > > > > > > > > > > > Do you really? I mean, yes, theoretically, I understand it, the > > > > > > > hardware supports 64kB of I/O port space per root port. But I/O > > > > > > > port space is rather deprecated these days. My laptop has precisely > > > > > > > two devices with I/O ports, one with 64 bytes and the other with 32 > > > > > > > bytes. Would you really suffer by allocating 16kB of I/O port > > > > > > > space to each root port? > > > > > > > > > > > > We were talking about this in the other wrong patch. I also think this > > > > > > much space looks wrong. The current ipq806x dts have this space so it's > > > > > > actually broken from a long time. The only reason pci worked before was > > > > > > because the pci driver didn't actually check if the settings were right. > > > > > > New kernel introduced more checks and this problem showed up. (to be > > > > > > more precise, the pci port are commonly used by the ath10k wifi and the > > > > > > second ath10k wifi fails to init because of this problem) > > > > > > If you can give me any hint on how to check if the space can be reduced > > > > > > I would be very happy to investigate it. > > > > > > In the driver I notice that the max buffer is set to 2k, could be this a > > > > > > hint? > > > > > > > > > > > > > > > > Could you share the output of lspci -vv from such a system? > > > > > > > > > > I agree with Matthew that fiddling with the size of the I/O space > > > > > range probably papers over another problem, and with the odd > > > > > exception, no PCIe card used on ARM systems actually uses their I/O > > > > > BARs, even when they have them. (I used to carry a PCIe serial port > > > > > card to UEFI plugfests because that was the only thing that would stop > > > > > working if a system configured its I/O resource window incorrectly) > > > > > > > > Here is the output of lspci -vv > > > > > > > > 0000:00:00.0 PCI bridge: Qualcomm Device 0101 (prog-if 00 [Normal decode]) > > > > Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0 > > > > I/O behind bridge: [disabled] > > > > Memory behind bridge: 08000000-081fffff [size=2M] > > > > Prefetchable memory behind bridge: [disabled] > > > > > > So this a MMIO window to the endpoint > > > > > > ... > > > > > > > > > > > 0000:01:00.0 Network controller: Qualcomm Atheros QCA9984 802.11ac Wave 2 Wireless Network Adapter > > > > Region 0: Memory at 08000000 (64-bit, non-prefetchable) [size=2M] > > > > > > ... and the endpoint has a single *MMIO* BAR of size 2 MiB. > > > > > > This has *nothing* to do with port I/O, which is what you are > > > modifying with your patch. > > > > > > Did you check that the problem exists without the patch, and that the > > > patch makes it go away? > > > > > > > > > > Yes without the change to IO_SPACE_LIMIT, the ath10k driver fails to > > init as it can't access the reg. Only the first pci wifi works but the > > second one fails to init. By increasing the limit all comes back to > > normal. What I really can't understand is if the big IO space set in the > > ipq8064 dtsi was wrong from the start and the ath10k fails to init just > > because is missconfigured. Any idea how to find the appropriate max IO space > > for the pci? > > > > OK, so the entire second host bridge fails to probe, because there is > no virtual address space left for the I/O window. > > Just change the 'downstream I/O' window size in the DT to 64k > (0x10000) - I assume the current size (0x100000) is a typo anyway. Ok, so my fear were right... someone just typo the IO when the dtsi was pushed and was wrong from all that times. Much easier and cleaner solution.