Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp507072pxb; Tue, 3 Nov 2020 05:32:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpONaliwQe+0m8E0ICGftGzxHtVg+vZussFtlxtjlNuwUyiecTHWPaETD/279DjehpfBah X-Received: by 2002:a17:906:8398:: with SMTP id p24mr20642015ejx.401.1604410362136; Tue, 03 Nov 2020 05:32:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604410362; cv=none; d=google.com; s=arc-20160816; b=QYzB7iHX/LUdjObCWZ/55Y0kto/zEKYnF4Efjb8WdKML9ph58byE00CX+9hqQibI0v C4LLGmaQzwK1byVkcD46MacONGY4K8uV80KaBSYw9ZQIWwxwkYaiQhK/55d9MPiKzSDm YAwe3Wx3O6tQydAq6Io4c5X9OOhLKXgQTw6C/HpW55MtbIBoNTW1fs+lNyq8Vvm93Ef9 d4rcuMKGcdxPCSl/HouQdpbW5P42JgIrxeJanvjUPHIPlCaQ7TkQ1kaW8R4ZWT7r/XWz wRRLSenvC2mjK+avb5jjORTU5XJuDKMPOpqKNGZ/J2D48mH5RmTHVxO5rQJjaSogJMRn 46OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=KbJ7uf5ba26n7iQKy0xxLg+5Abs5t9kAoaQgbJ0imWA=; b=HjNu5d4x4uYUe/EGRztV6gnRf/r78BVlWSXEkYKrpsKaroW5vmol4E0+ddxlQwWmWI osXrKej3HNXP6+2e4bgndtHcoY+ThElTtclbXS4/HU/lxkHEUDG7CuZ0FDa+ncoR7hc2 Ig4YkbJMAqThOny9el/EqiLp4+cH77vUqqZ2BAlp3mCvBzKDw1ClM2VIvf/0DORn3+R+ 7R9tjadgU7JHVkeMcNhi9oI/Tmx5JFfxXou1HlvDXKnlMamksmREt67iwgesM5AVh8+3 J4hD1sMfGkQdHwmoFMneTLkUrJsbNkv5Xr/D8T2ulsKlbkYJmhTQEQo2NUTvNVBT5WKy daUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ZCfxvnc9; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 n7si2377274ejk.217.2020.11.03.05.32.08; Tue, 03 Nov 2020 05:32:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@mg.codeaurora.org header.s=smtp header.b=ZCfxvnc9; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729307AbgKCN3D (ORCPT + 99 others); Tue, 3 Nov 2020 08:29:03 -0500 Received: from z5.mailgun.us ([104.130.96.5]:30930 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729259AbgKCN2n (ORCPT ); Tue, 3 Nov 2020 08:28:43 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1604410123; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=KbJ7uf5ba26n7iQKy0xxLg+5Abs5t9kAoaQgbJ0imWA=; b=ZCfxvnc9vO5GZPETS2SAlJOeJLZ6GHX8U86vD6cX/UcM203nuP8kZHMtrgmsMoXTcGNr+UkQ 6BxBAVeQwC4hxDz8kq7JRdjLJ8SSVbHuxzkAVRupolktZhz2BD6VjFB8ZWufl1kB2kisrpwC /N28dtMhuuJwXHSB8kWD6SCcM5g= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-east-1.postgun.com with SMTP id 5fa15af775bebe827a00145c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 03 Nov 2020 13:28:23 GMT Sender: cjhuang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 18F86C4344A; Tue, 3 Nov 2020 03:01:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cjhuang) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6EEF9C433B1; Tue, 3 Nov 2020 03:01:56 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 03 Nov 2020 11:01:56 +0800 From: Carl Huang To: Bjorn Helgaas Cc: Kalle Valo , Govind Singh , linux-pci@vger.kernel.org, linux-wireless@vger.kernel.org, Devin Bayer , Thomas Krause , ath11k@lists.infradead.org Subject: Re: pci_alloc_irq_vectors fails ENOSPC for XPS 13 9310 In-Reply-To: <20201102205752.GA34153@bjorn-Precision-5520> References: <20201102205752.GA34153@bjorn-Precision-5520> Message-ID: X-Sender: cjhuang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-11-03 04:57, Bjorn Helgaas wrote: > [+cc Govind, author of 5697a564d369 ("ath11k: pci: add MSI config > initialisation")] > > On Mon, Nov 02, 2020 at 08:49:51PM +0200, Kalle Valo wrote: >> + linux-wireless, linux-pci, devin >> >> Thomas Krause writes: >> >> >> I had the same problem as well back in the days, for me enabling >> >> CONFIG_IRQ_REMAP helped. If it helps for you also I wonder if we should >> >> mention that in the ath11k warning above :) >> > >> > CONFIG_IRQ_REMAP did not do the trick. I noticed that the Wi-Fi card >> > is behind a PCI bridge which is also disabled, could this be a >> > problem? >> > >> > 00:1c.0 PCI bridge: Intel Corporation Device a0b8 (rev 20) (prog-if 00 >> > [Normal decode]) >> > Flags: bus master, fast devsel, latency 0, IRQ 123 >> > Bus: primary=00, secondary=56, subordinate=56, sec-latency=0 >> > I/O behind bridge: [disabled] >> > Memory behind bridge: 8c300000-8c3fffff [size=1M] >> > Prefetchable memory behind bridge: [disabled] >> > Capabilities: [40] Express Root Port (Slot+), MSI 00 >> > Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit- >> > Capabilities: [90] Subsystem: Dell Device 0991 >> > Capabilities: [a0] Power Management version 3 >> > Capabilities: [100] Advanced Error Reporting >> > Capabilities: [220] Access Control Services >> > Capabilities: [150] Precision Time Measurement >> > Capabilities: [200] L1 PM Substates >> > Capabilities: [a00] Downstream Port Containment >> > Kernel driver in use: pcieport >> >> I don't know enough about PCI to say if the bridge is a problem or >> not. > > I don't think the bridge is an issue here. AFAICT the bridge's I/O > and prefetchable memory windows are disabled, but the non-prefetchable > window *is* enabled and contains the space consumed by the ath11k > device: > > 00:1c.0 PCI bridge: Intel Corporation Device a0b8 (rev 20) > Bus: primary=00, secondary=56, subordinate=56, sec-latency=0 > Memory behind bridge: 8c300000-8c3fffff [size=1M] > 56:00.0 Network controller: Qualcomm Device 1101 (rev 01) > Region 0: Memory at 8c300000 (64-bit, non-prefetchable) [size=1M] > Have you enabled VT-d from BIOS? This is required at least on some old laptops. >> To summarise: Thomas is reporting[1] a problem with ath11k on QCA6390 >> PCI device where he is not having enough MSI vectors. ath11k needs 32 >> vectors but pci_alloc_irq_vectors() returns -ENOSPC. PCI support is >> new >> for ath11k and introduced in v5.10-rc1. The irq allocation code is in >> drivers/net/wireless/ath/ath11k/pci.c. [2] > > This code is needlessly complicated. If you absolutely need > msi_config.total_vectors and can't settle for any less, you can do > this: > > num_vectors = pci_alloc_irq_vectors(ab_pci->pdev, > msi_config.total_vectors, > msi_config.total_vectors, > PCI_IRQ_MSI); > > if (num_vectors < 0) { > ath11k_err(ab, "failed to get %d MSI vectors (%d)\n", > msi_config.total_vectors, num_vectors); > return num_vectors; > } > > But it seems a little greedy if the device can't operate at all unless > it gets 32 vectors. Are you sure that's a hard requirement? Most > devices can work with fewer vectors, even if it reduces performance. > >> I would first try with a full distro kernel config, just in case >> there's >> some another important kernel config missing. >> >> [1] >> http://lists.infradead.org/pipermail/ath11k/2020-October/000466.html > > Tangent: have you considered getting this list archived on > https://lore.kernel.org/lists.html? > >> [2] >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/ath/ath11k/pci.c#n633 >> >> -- >> https://patchwork.kernel.org/project/linux-wireless/list/ >> >> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches