Return-path: Received: from mail-oi0-f50.google.com ([209.85.218.50]:48709 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbdJBEV6 (ORCPT ); Mon, 2 Oct 2017 00:21:58 -0400 Received: by mail-oi0-f50.google.com with SMTP id 125so7290782oie.5 for ; Sun, 01 Oct 2017 21:21:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1506408099-18488-1-git-send-email-acelan.kao@canonical.com> <1506408099-18488-2-git-send-email-acelan.kao@canonical.com> <20170926064456.GA28611@infradead.org> <20170926140413.GA19977@infradead.org> <878th14kde.fsf@kamboji.qca.qualcomm.com> From: Daniel Drake Date: Mon, 2 Oct 2017 12:21:57 +0800 Message-ID: (sfid-20171002_062036_885348_628B8FD7) Subject: Re: [PATCH 2/6] ath9k: add a quirk to set use_msi automatically To: AceLan Kao Cc: Kalle Valo , Christoph Hellwig , QCA ath9k Development , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, "Linux-Kernel@Vger. Kernel. Org" Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org List-ID: Hi AceLan, On Thu, Sep 28, 2017 at 4:28 PM, AceLan Kao wrote: > Hi Daniel, > > I've tried your patch, but it doesn't work for me. > Wifi can scan AP, but can't get connected. Can you please clarify which patch(es) you have tried? This is the base patch which adds the infrastructure to request specific MSI IRQ vectors: https://marc.info/?l=linux-wireless&m=150631274108016&w=2 This is the ath9k MSI patch which makes use of that: https://github.com/endlessm/linux/commit/739c7a924db8f4434a9617657 If you were already able to use ath9k MSI interrupts without specific consideration for which MSI vector numbers were used, these are the possible explanations that spring to mind: 1. You got lucky and it picked a vector number that is 4-aligned. You can check this in the "lspci -vvv" output. You'll see something like: Capabilities: [50] MSI: Enable+ Count=1/4 Maskable+ 64bit+ Address: 00000000fee0300c Data: 4142 The lower number is the vector number. In my example here 0x42 (66) is not 4-aligned so the failure condition will be hit. 2. You are using interrupt remapping, which I suspect may provide a high likelihood of MSI interrupt vectors being 4-aligned. See if /proc/interrupts shows the IRQ type as IR-PCI-MSI Unfortunately interrupt remapping is not available here, https://lists.linuxfoundation.org/pipermail/iommu/2017-August/023717.html 3. My assumption that all ath9k hardware corrupts the MSI vector number could wrong. However we've seen this on different wifi modules in laptops produced by different OEMs and ODMs, so it seems to be a somewhat widespread problem at least. 4. My assumption that ath9k hardware is corrupting the MSI vector number could be wrong; maybe another component is to blame, could it be a BIOS issue? Admittedly I don't really know how I can debug the layers inbetween seeing the MSI Message Data value disagree with the vector number being handled inside do_IRQ(). Daniel