Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5355770imm; Tue, 21 Aug 2018 10:17:10 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzwvTNz1ZiJL90iL0ZUxHALtBVLZVpv1gVpm/IVb/bd5cr6VLybutnmeRfzJfO8Ay9g0t2v X-Received: by 2002:a17:902:24e1:: with SMTP id l30-v6mr19343979plg.315.1534871830210; Tue, 21 Aug 2018 10:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871830; cv=none; d=google.com; s=arc-20160816; b=TV78H3haqd++NomQVUE0LVm2bLPzZLGXBR16NgybjVGSo7lR6JIuFFQ1j51uHafINm g3OdBnHbA10e43B+mqr/LGkv/2uhwLMNzYKLM6dMMYFI6l5VH2WNqhav6GlSunn6lPrb Mz0KwvWEmqAZp973KRpItsDaWF/S6dGKtMMetJ93plyQLSFfPTDmoJszLzozZdM8JCXC IHesCasK7ApwrA5JF630FvPpCm1h+J+Ln9M4r4mjHIjyq0msV8cJaBmODPvsa+oNyQlN Bwy0lePprNshPU3MdIrRKggrJbvAarOR1nJFp25ZkhScaqqW9Nx7d9vd4bX37a7aUaBW Y3rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=hbSPnHZ1+xpgOmlvwTr7URbdSp05MAiQfJIKC29blME=; b=VM3idOLklraL6GarGD0ZtJGEsLBJsIs8RKrPyESIx7nnWeMcbxB49noRMO2xxy9Y6U i2a34F6c09n3RkPCp4NFA8Nip0xj71kfcQ84L1C2l7a3CwWd5Vcg1nGXxi1Z+IYyY58d YypmDjPqp34EnZJnZx1bV6dP/Vf8Iwp/W8z9M3I487dUtzrwhNQB9w1RprmT++mg7vlg XyyD72KzjMl0PTURfp4Xrc2aRAFmCe5VhjfE0xUD27YFj1jjg0tPf67uLXQpwPePFyvz 4QHhmSLdh1IMLw4nTyJnPostVrlWOM7ECJlTGsypPJaNvvOe3OktSUEeJWv1Gn4NitFm EV2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ve0yTe5a; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13-v6si12705154pll.72.2018.08.21.10.16.54; Tue, 21 Aug 2018 10:17:10 -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=@kernel.org header.s=default header.b=Ve0yTe5a; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726765AbeHUULk (ORCPT + 99 others); Tue, 21 Aug 2018 16:11:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:34972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbeHUULk (ORCPT ); Tue, 21 Aug 2018 16:11:40 -0400 Received: from localhost (219.sub-174-234-132.myvzw.com [174.234.132.219]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F122216C4; Tue, 21 Aug 2018 16:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534870245; bh=DA0AwB6UwGRV0YpI0Rsa5gTrDvdVuGsRp66OiC11Sq8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ve0yTe5ao5bGmjFKKTW7yzoEb5Fp5ElXvjj4Y5NBzWeHHkWH6tn0ZlYz8nBPbQ98O CzTqidpgJPiwlLJaOIhdukkXjVYA/Y+mAjHXW2H9rXLtft2RYWSqb/Kw7LP3VQc6MP oRZVgukiyU84mNZGreA87jAAnlU3BhDsUAZHPqQ8= Date: Tue, 21 Aug 2018 11:50:42 -0500 From: Bjorn Helgaas To: Lukas Wunner Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mmyangfl@gmail.com, Ashok Raj , Rajat Jain Subject: Re: Enumeration issue with QCA9005 AR9462 Message-ID: <20180821165042.GC154536@bhelgaas-glaptop.roam.corp.google.com> References: <20180820230624.GB154536@bhelgaas-glaptop.roam.corp.google.com> <20180821054704.jlqk5zrlbbsjsd4g@wunner.de> <20180821072541.tcdg5fkk4zrwxahj@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180821072541.tcdg5fkk4zrwxahj@wunner.de> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+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: 385895fef6b5 ("PCI: pciehp: Prioritize data-link event over presence detect") e48f1b67f668 ("PCI: pciehp: Use link change notifications for hot-plug and removal") Bjorn