Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4779360imm; Tue, 21 Aug 2018 00:27:05 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwlQhLGr8eXxI0wqU9Ux8XojrXVyWgOZO14OICPoZtpe0rzqKf71jyH6IrH0541kJgOzxYg X-Received: by 2002:a63:714a:: with SMTP id b10-v6mr45192761pgn.73.1534836425753; Tue, 21 Aug 2018 00:27:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534836425; cv=none; d=google.com; s=arc-20160816; b=CEDnFpIFE8JkVpIoivkZhUtu3sAnmnO30MBKMFtAXZADVEJ4L2pgdOsL+hNZeLkNZn G75dX8tlvsFQQtYLVrq/jEEHuHzPhbobhC0bPpFvIZ4rmEjUOKP9WGusuI+Fk1eJTFCX OYTXkYXQpJ32SjAXCVXzgvs28iRBoxpWjCau/ESto/m6Ui6m7REzFkIKq/j7Fa/BHeWj lKT/PSzGomky/kaV7RJaNodte0DNhE3hqE4L91+KLXjpOAiljbgJSwYFkGsA6YG51uDM QN4QYZsUQkkWPDad8c0tK9jYISlDIgsDqoJowKoi4BQdbKT4UNA2jp/cgxiSVZms9NGo gezg== 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:arc-authentication-results; bh=eJUgjZmSqF/v9jocTuN0v14l55phxSCx6wulzmkCdy0=; b=PTymZbG1L6Auy/uWuI9WaK/fCW7gRAWSbNEXIe2O9ZFxF4GKxzU0obHE1W2YIXtOgA 1+PxRyH8lMgvfTK/7XWKU3T7T5EzWapQnK6YjS1L7HlIJJ/u9bVEKt1fuQH2hPSq19kt APJ3wZj493yE6h11Z7q/8IGTbK8uVOjm3o+bn5cmxXjex8yr0bhNfHtTxKd5V51kSPiO NIljlfXC7mHKKRi1OavCRJLKWpZTGafdgPko6C78PAUtX+3kK+eeEG/xys7Ye88B2f24 q+DF10UPU8Pjso75/L9ukjdqwPSc+pQTbMt80wq7Pj59PdVGuQ/w6o3v/FMCf2TZ3eTN bxSw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l185-v6si12442021pfl.134.2018.08.21.00.26.49; Tue, 21 Aug 2018 00:27:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726627AbeHUKom (ORCPT + 99 others); Tue, 21 Aug 2018 06:44:42 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:41855 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726253AbeHUKom (ORCPT ); Tue, 21 Aug 2018 06:44:42 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 74F84300116EF; Tue, 21 Aug 2018 09:25:41 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 4E75E4A14; Tue, 21 Aug 2018 09:25:41 +0200 (CEST) Date: Tue, 21 Aug 2018 09:25:41 +0200 From: Lukas Wunner To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mmyangfl@gmail.com Subject: Re: Enumeration issue with QCA9005 AR9462 Message-ID: <20180821072541.tcdg5fkk4zrwxahj@wunner.de> References: <20180820230624.GB154536@bhelgaas-glaptop.roam.corp.google.com> <20180821054704.jlqk5zrlbbsjsd4g@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180821054704.jlqk5zrlbbsjsd4g@wunner.de> User-Agent: NeoMutt/20170113 (1.7.2) 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 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. Bjorn, please let me know which of these options you'd prefer. Thanks, Lukas