From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 513CCC433DF for ; Fri, 10 Jul 2020 20:08:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 263782078B for ; Fri, 10 Jul 2020 20:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594411687; bh=qAHikyX4usyEt9YaUhLVPyfSr7erjUkLzDKfxsW/idw=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=CBUaTIwWiIUpr6KiZIwC0bND7I3mgnf6Ckiqr9LNYb8OKwApRjVfTcFmPbOq1oZm3 eFHd5WtFRCB3EdtlQNisZxqFPoFscn5BsFs7tokum+sSNweq9WA/vw2UP6oC0puvnd NV0ILdCKy3QoHhAj+qutnqPlDiq7b0CDp7nDmVCo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726828AbgGJUIG (ORCPT ); Fri, 10 Jul 2020 16:08:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:49092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727976AbgGJUIG (ORCPT ); Fri, 10 Jul 2020 16:08:06 -0400 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (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 4BA8F2076A; Fri, 10 Jul 2020 20:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594411685; bh=qAHikyX4usyEt9YaUhLVPyfSr7erjUkLzDKfxsW/idw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=F8UkNMPQ+9Y3843RBYkKHxced1/m2Ia4VnGs/51Qytls9UeYESnXzd8CoE8FrMxCQ VqRlwy7unDqDctZU/HTaPqQLerVDBq+PJA7hyP8KyMtR6zUSnAYQTYL6/X36V1Iygu bhxnKMeKNvSwi9Z/NXYMfnRcyLTBMW/3ybjH4L68= Date: Fri, 10 Jul 2020 15:08:03 -0500 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Lorenzo Pieralisi , Thomas Petazzoni , Andrew Murray , Bjorn Helgaas , Marek =?iso-8859-1?Q?Beh=FAn?= , Remi Pommarel , Tomasz Maciej Nowak , Xogium , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] PCI: aardvark: Don't touch PCIe registers if no card connected Message-ID: <20200710200803.GA75998@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200710193003.2lt3i5ocy5kk3b3p@pali> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Fri, Jul 10, 2020 at 09:30:03PM +0200, Pali Rohár wrote: > On Friday 10 July 2020 11:08:28 Bjorn Helgaas wrote: > > On Fri, Jul 10, 2020 at 05:44:58PM +0200, Pali Rohár wrote: > > > I can reproduce following issue: Connect Compex WLE900VX card, configure > > > aardvark to gen2 mode. And then card is detected only after the first > > > link training. If kernel tries to retrain link again (e.g. via ASPM > > > code) then card is not detected anymore. > > > > Somebody should go over the ASPM retrain link code and the PCIe spec > > with a fine-toothed comb. Maybe we're doing something wrong there. > > I think this is not ASPM related as card simply disappear just after > flipping PCI_EXP_LNKCTL_RL bit second time without changing ASPM bits. Right. The retrain code in aspm.c doesn't really have anything in particular to do with ASPM and it should probably be moved elsewhere. So I think the problem may be related to retrain and the delays after it in general, not to ASPM. > There is absolutely nothing regarding to timings in documentation which > I saw. In documentation are just instructions/steps how to init PCI > subsystem and it is basically advk_pcie_setup_hw() function. > > > > I read in kernel bugzilla that WLE600VX and WLE900VX cards are buggy and > > > more people have problems with them. But issues described in kernel > > > bugzilla (like card is reporting incorrect PCI device id) I'm not > > > observing. > > Hm... I cannot find right now pointer to bugzilla, but I have pointer to > ath9k-devel mailing list with that incorrect device id: > > https://www.mail-archive.com/ath9k-devel@lists.ath9k.org/msg07529.html > > > Is the incorrect device ID 0xffff? > > No, incorrect device ID in that case is 0xabcd and vendor ID is correct > (Qualcomm). >From a quick look at that thread, it sounds like the device isn't quite ready yet. In that case, it's supposed to respond with Config Request Retry Status, and Linux is supposed to wait longer and retry. But I don't think Linux does that quite correctly, so it could be either a hardware problem or Linux being broken. But I guess that's not the current problem so I don't want to go down that rathole right now.