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=-5.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham 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 BE14DC432C2 for ; Wed, 25 Sep 2019 12:32:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8CD8B20673 for ; Wed, 25 Sep 2019 12:32:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j9qnvvly" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CD8B20673 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=Bdfs90oXikBzRiBaKbzvW810SvDpoXAFt+U0nlIq6D4=; b=j9qnvvlyFkDCPH 7afgdfj3bKsMAAOOVedVhgjv2+2QcBp9TXPEqWSxqNW4OotYGZMmQqTB6otDpaMwpEVqFJrqnXGSt SB5DSynAL8We97nJuxeWG9IysYBpst+E7ySwLjDHutD4coxnMCEeEdcQMFFtxeszQ+2hyE/5pHfe3 0IYdf0+fdKGQ06p3jlCfr8bHJzbGI44oA25ll7UyJNyEu+3ZqNPfy4o8RAYdOnxehXyvkTosE5ZqP lh+8LIJsQZTmQECkxOKwFQjleHRKKtsUxK5PAn6P8Nk2vH9J4+BDfWyrRtfpqiiZTUvye7L/m+t4n tyXbn0kJyhXPse5o8x/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iD6T2-0007Wo-DG; Wed, 25 Sep 2019 12:32:24 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iD6So-0007Vn-Su for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2019 12:32:18 +0000 X-Originating-IP: 86.250.200.211 Received: from windsurf (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 971A7FF80C; Wed, 25 Sep 2019 12:32:01 +0000 (UTC) Date: Wed, 25 Sep 2019 14:32:00 +0200 From: Thomas Petazzoni To: Remi Pommarel Subject: Re: [PATCH v3] PCI: aardvark: Use LTSSM state to build link training flag Message-ID: <20190925143200.696af4cf@windsurf> In-Reply-To: <20190522213351.21366-3-repk@triplefau.lt> References: <20190522213351.21366-3-repk@triplefau.lt> Organization: Bootlin X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190925_053212_726335_4D5B4B8D X-CRM114-Status: GOOD ( 12.07 ) 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: Ellie Reeves , Lorenzo Pieralisi , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Remi, On Wed, 22 May 2019 23:33:51 +0200 Remi Pommarel wrote: > Aardvark's PCI_EXP_LNKSTA_LT flag in its link status register is not > implemented and does not reflect the actual link training state (the > flag is always set to 0). In order to support link re-training feature > this flag has to be emulated. The Link Training and Status State > Machine (LTSSM) flag in Aardvark LMI config register could be used as > a link training indicator. Indeed if the LTSSM is in L0 or upper state > then link training has completed (see [1]). > > Unfortunately because after asking a link retraining it takes a while > for the LTSSM state to become less than 0x10 (due to L0s to recovery > state transition delays), LTSSM can still be in L0 while link training > has not finished yet. So this waits for link to be in recovery or lesser > state before returning after asking for a link retrain. > > [1] "PCI Express Base Specification", REV. 4.0 > PCI Express, February 19 2014, Table 4-14 > > Signed-off-by: Remi Pommarel Here as well, sorry for the very long delay, and many thanks for the great research work, including the arm-trusted-firmware fix. I reviewed the implementation, and tested on my Armada 3720 DB board with a E1000E NIC, and it all looks good to me. Acked-by: Thomas Petazzoni Thanks! Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel