Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp48846imm; Tue, 21 Aug 2018 14:20:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzHPbBJdUxSGd0hy7iqveG+JCIQHN+8VEm2Co5hJxe0fCU4pWTGaL3IK0zgisK7z6NxVngw X-Received: by 2002:a63:6604:: with SMTP id a4-v6mr47993955pgc.404.1534886446560; Tue, 21 Aug 2018 14:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534886446; cv=none; d=google.com; s=arc-20160816; b=L6tOX+qd1+OsnWpZEcH+n9KoqNe7TIdX94C8sOqW6KbM1Yhv+rV54zUA7qaXm4CErN eJNmQq5LJUhT4f0Rwac1kq/fT8Vt00hWB7ixuGYolOg/5XV73/eCvYzbSfpB0QqVSGc4 kqGFvifSJem5LlvOLstkIEbgirZS1p6lRTWemOWN+d2++JgnL5U8yf1e0aGxyzAsORMR cFip423M+9uTZqq9s8W246Zc7fn00l8SaYEPgtZJNu22dfcB7lY4fOHWARgdW1TjdcZR 1/tg0xIFX3cWOqArDbvWFu9aNEDMK4WUB87Ra0suGgag2CaR4a2GUMoSqtUiQ3ozuUNo +XlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=tBR0uGqbt2FyRWWJNPBkwyEEjZQxjdqPUp/OeJ5cwxE=; b=oXhe6wG4WNesux/9qqtt/0ZaGYFBc/iK8ZS2tWjhgNmyZbnTtfEd7dR97fWNucDAY1 tCRvmo/Db+f7inPCqrnGqKHkuwBQ6/pSxrrKGP8YGSbdp2itUtSZ4eLk5q+Dpib1wgMi m006HoOH2arWUVmO7u5zEAF35D8MIrDw+77uq32P4wAS5gZ5JgVEaiy+82KzCljyEFCS 0KyHldihqOf3NXhHwRSWe00+2SIyTe3pBQQLYMovCUPjiFEzYP9lPfomuVpndnrHm4fL U1652JTtcxnBuW3xTqpSVy6oAqHgRwco/8/lywXAT+3oIgWh2D3r6fLAvNR4OyZbf4TC 15PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=grDVUf+w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j64-v6si7037041pgd.199.2018.08.21.14.20.08; Tue, 21 Aug 2018 14:20:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=grDVUf+w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727707AbeHUXqh (ORCPT + 99 others); Tue, 21 Aug 2018 19:46:37 -0400 Received: from mail-yb0-f196.google.com ([209.85.213.196]:44303 "EHLO mail-yb0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbeHUXqh (ORCPT ); Tue, 21 Aug 2018 19:46:37 -0400 Received: by mail-yb0-f196.google.com with SMTP id l16-v6so6469063ybk.11 for ; Tue, 21 Aug 2018 13:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tBR0uGqbt2FyRWWJNPBkwyEEjZQxjdqPUp/OeJ5cwxE=; b=grDVUf+weT/k1MnT75YVAcNLfJpMkI1GBRpe6ZriNJuBM9JqEMfQF0DpI3OTwDJjeN M8atRociX+NsmzHshw1BQHpxCQr+rKd8HGBW9gQVVikUR5PPieV9eztTiUkMQPgCWk1f iMny8pud3smmLL5NtM3NmNpPlJ98IMTbtoGdicbsKDirWU6RKiXuUFZORhOUAMW642zl D3Jhq/Oiv1Q3xRaoiy2jmQTVvyTUXVfTI8IOBMWxNWRO9GRSTpeTyAyUn4QNURbJXRSj +BWLiCCSxunsLQMqyxueJynIjsThTyijyjTgt+BOVD9zeNM7lyAE1gLATdSXy0Le43PS sF3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tBR0uGqbt2FyRWWJNPBkwyEEjZQxjdqPUp/OeJ5cwxE=; b=gWl6eXPtF+6wjveaNoNuRKQRmbbJsB6ilQnE9M0+XGsOFqtoSwrSNibQRwYVRKNfLe q9YV0VxmoemEZ5o+6RfkOJVshRz6bNvcR9WL3V4XetMe0RWZOZP4jShIzJOv2WnsPIFY GvVER5TZYl+Cdz/wFUIrtitTrIDlnXEZl41iO8x26UyRXl5uHsBFGT6nsZcRAX+l+VLb ex1XfdS9hwcT7uo0Jv2kheS8cU6zNUd3d1jPFy0CLtRc6p/jTguasPy8O5O3xJtT+U7l qFPQ9LmoWP+pm+vGuIBxqk8r6LRDD/H8dkOpikfEkQoue0Q5PB23M5+za5mkRc6hNoS2 KQgQ== X-Gm-Message-State: AOUpUlH/KOyUWHbDeI3kL0kW3BEjBBRfj4Qbj5INaI/XZd3ofDeKA/OA iMz59cshqzIMjfnMuEZ0vQzlOa7dElQjmrZQjQiIXg== X-Received: by 2002:a25:d493:: with SMTP id m141-v6mr26618425ybf.224.1534883098665; Tue, 21 Aug 2018 13:24:58 -0700 (PDT) MIME-Version: 1.0 References: <20180820230624.GB154536@bhelgaas-glaptop.roam.corp.google.com> <20180821054704.jlqk5zrlbbsjsd4g@wunner.de> <20180821072541.tcdg5fkk4zrwxahj@wunner.de> <20180821165042.GC154536@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20180821165042.GC154536@bhelgaas-glaptop.roam.corp.google.com> From: Rajat Jain Date: Tue, 21 Aug 2018 13:24:22 -0700 Message-ID: Subject: Re: Enumeration issue with QCA9005 AR9462 To: Bjorn Helgaas Cc: Lukas Wunner , linux-pci , Linux Kernel Mailing List , mmyangfl@gmail.com, ashok.raj@intel.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 21, 2018 at 9:50 AM Bjorn Helgaas wrote: > > [+cc Rajat, Ashok] > > On Tue, Aug 21, 2018 at 09:25:41AM +0200, Lukas Wunner wrote: > > On Tue, Aug 21, 2018 at 07:47:04AM +0200, Lukas Wunner wrote: > > > On Mon, Aug 20, 2018 at 06:06:24PM -0500, Bjorn Helgaas wrote: > > > > mmyangfl@gmail.com reported a problem [1]: on v4.17, a QCA9005 AR9462 > > > > wifi device was present at boot, but disappeared after suspend/resume. > > > > > > > > He also tested a recent kernel (5c60a7389d79, from Thu Aug 16), > > > > where the suspend/resume problem doesn't seem to happen, but the wifi > > > > device isn't enumerated correctly at boot-time. > > > > > > > > [ 0.928714] pciehp 0000:04:00.0:pcie204: Slot #0 AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+ Interlock- NoCompl- LLActRep+ > > > > [ 0.928752] pciehp 0000:04:00.0:pcie204: Slot(0-1): Card not present > > > > [ 0.928811] pciehp 0000:04:00.0:pcie204: Slot(0-1): Link Up > > > > [ 0.928815] pciehp 0000:04:00.0:pcie204: Slot(0-1): No adapter > > > > > > > > [1] https://bugzilla.kernel.org/show_bug.cgi?id=200839 > > > > [2] https://bugzilla.kernel.org/attachment.cgi?id=277923 > > > > > > The hardware appears to be broken in that the Presence Detect State bit > > > in the Slot Status register is 0 (Slot Empty) even though the slot is > > > occupied. > > [...] > > > Possible solutions: > > > > > > (a) Be lenient towards broken hardware and accept DLActive+ as a proxy > > > for PresDet+. > > > > > > (b) Add a blacklist to pciehp such that it doesn't bind to [1ae9:0200]. > > > The bug reporter writes that "it's a single Half Mini PCIe card, > > > with two chipsets (Wil6110? + AR9462) combined by a PCIe hub". > > > This sounds like it's not really hotpluggable. > > > (Is Mini PCIe hotplug capable at all?) > > > > > > Let me go through the driver and see if (a) is feasible and how intrusive > > > it would be. > > > > So (a) would seem to be feasible, we could add a quirk for devices like > > this to call pciehp_check_link_active() in pciehp_get_adapter_status(). > > > > Alternatively, we could generally add a call to pciehp_check_link_active() > > in get_adapter_status(), pciehp_check_presence() and pcie_init() and thus > > avoid a quirk for this specific device. > > The existing call in __pciehp_enable_slot() could actually be removed, > > this code path is only entered if either PDS or DLLLA is set. > > > > And the third option would be to add a quirk like quirk_hotplug_bridge() > > which sets is_hotplug_bridge = 0 on this broken device such that pciehp > > doesn't bind to it in the first place. > > It sounds like with (a), you could make this work without having a > Wil6110-specific quirk, i.e., if the Link Status says the link is > active, we assume a device is present. That seems reasonable to me > and it sort of fits with these previous changes: I also like idea (a) and think it makes sense. One thing to note is that we may pass the same confusion ("how is my wifi detected when no card is not present on the slot") to userspace in case anyone looks in /sysfs (but I don't think anyone looks that deeply). Thanks, Rajat > > > 385895fef6b5 ("PCI: pciehp: Prioritize data-link event over presence detect") > e48f1b67f668 ("PCI: pciehp: Use link change notifications for hot-plug and removal") > > Bjorn