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 54C8EC433E8 for ; Fri, 10 Jul 2020 20:08:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B15A2078B for ; Fri, 10 Jul 2020 20:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594411688; bh=qAHikyX4usyEt9YaUhLVPyfSr7erjUkLzDKfxsW/idw=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=L8HZ+VR1cXlqAKxjFr6BucrklacLeOhhSRZFQhSAvBExh5j9skHyyfhyRRDNVvw9c tOsINSP+6nvxknGgp5EEEiHDAtitJ0xWa7s93o87tgOJw3qRvErxu5preKS+bfDdSj wOpKIWt8IDDcVf11EHL2HHYq8DI3klyxfozrQFxI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728582AbgGJUIG (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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. 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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 41082C433E0 for ; Fri, 10 Jul 2020 20:09:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 030762076A for ; Fri, 10 Jul 2020 20:09:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a7aSgusa"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="F8UkNMPQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 030762076A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID:Subject:To:From: Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=hX2eX23CWHSqGjECQVJqFOvBXYG+owiEV9n++Rx8ym8=; b=a7aSgusap1J1roSuCOLCh51Jm xm1WWmPPO/ueJq7lUeHaQGz1/TT/pOe9je+MoMWgLp0uqFqps0by5Ls65oAcxxvQPgZRoiZAm6QKY Pc26uUIUlQ4akfckfjJaY49yxpqHJYZi0KVevjBrYNjg4vBaoXjk/nqV0n8BQ30YqRTt7fceFoxB/ cFrhvpFXS44XcR0JXrMhFLQSEENkY7PvwBVpbkgmA3Hpkhpi9BjWCZUFHQdnY/QySvyaod/Z1vUz0 MhrbTUc0rz0y28tWQj0gC/sTtOR2EhJpT7Y0FTB0dEBao90Dgbkp6zDq5P3OnP34EmjzUHSZVF1Z9 nd3QilmpA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtzJZ-0001U3-S6; Fri, 10 Jul 2020 20:08:09 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtzJX-0001TV-LI for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 20:08:08 +0000 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?= 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-Disposition: inline In-Reply-To: <20200710193003.2lt3i5ocy5kk3b3p@pali> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200710_160807_766506_FCB776F8 X-CRM114-Status: GOOD ( 22.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomasz Maciej Nowak , Lorenzo Pieralisi , linux-pci@vger.kernel.org, Xogium , linux-kernel@vger.kernel.org, Marek =?iso-8859-1?Q?Beh=FAn?= , Remi Pommarel , Thomas Petazzoni , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, Andrew Murray Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 10, 2020 at 09:30:03PM +0200, Pali Roh=E1r wrote: > On Friday 10 July 2020 11:08:28 Bjorn Helgaas wrote: > > On Fri, Jul 10, 2020 at 05:44:58PM +0200, Pali Roh=E1r wrote: > > > I can reproduce following issue: Connect Compex WLE900VX card, config= ure > > > 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel