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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 26816C4707F for ; Thu, 27 May 2021 06:19:43 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70B2C613DA for ; Thu, 27 May 2021 06:19:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70B2C613DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 72BB982E64; Thu, 27 May 2021 08:19:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1622096380; bh=qKir7CCCVIiC7wg0msEiLDu0dZ3DiHrUz1eddi+Mm2Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qy/HrrPUjjb0KIb6QIomj6vlGR5YkHSpS8zbQQjroqAiPwBI8v2ZBfUnSXI9VUk1W owcYzdPQW3CiKiBApea6v0lcrMokZr5klJPVczc+yVkwh5J9INBTBsD0STuJEd4x4Y uaKfx4yfsC5dgeZ4LllPRKWh6P47NPpqN29zKO/DWO7cOzgjM8uruYm43Rg2lAIFJO B3pFwLFGfgh5TkUdzHxBsGbif0tL49imBJgJuzYST9M3tMntyuDjGpiOEMrOfToVrn 4v2FD0VQ+NlPtERhC8vGYPYXs9KZKRKJ8gVMnsgIQc/jhDfdtfLBXb4CRdh2dtXI08 FXBwZVuySahPA== Received: by phobos.denx.de (Postfix, from userid 109) id E9E6A82E7B; Thu, 27 May 2021 08:19:38 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:1::465:204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F19B82E64 for ; Thu, 27 May 2021 08:19:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4FrHj36bKPzQk36; Thu, 27 May 2021 08:19:35 +0200 (CEST) Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id zMlCeEyiPYNP; Thu, 27 May 2021 08:19:33 +0200 (CEST) Subject: Re: [PATCH v2 1/7] arm: a37xx: pci: Don't put link into LTSSM Recovery state during probe To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Konstantin Porotchkin Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de References: <20210517063956.30905-1-pali@kernel.org> <20210526155940.26141-1-pali@kernel.org> From: Stefan Roese Message-ID: <275d7fc8-bcc2-c1b4-e51e-7a137616059a@denx.de> Date: Thu, 27 May 2021 08:19:32 +0200 MIME-Version: 1.0 In-Reply-To: <20210526155940.26141-1-pali@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: X-Rspamd-Score: -6.68 / 15.00 / 15.00 X-Rspamd-Queue-Id: 0D46E1806 X-Rspamd-UID: 670e51 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean On 26.05.21 17:59, Pali Rohár wrote: > During our debugging of the Aardvark driver in Linux we have discovered > that the PCIE_CORE_LINK_CTRL_STAT_REG register in fact controls standard > PCIe Link Control Register for PCIe Root Bridge. This led us to discover > that the name of the PCIE_CORE_LINK_TRAINING macro and the corresponding > comment by this macro's usage is misleading; this bit in fact controls > Retrain Link, which, according to PCIe base spec is defined as: > > A write of 1b to this bit initiates Link retraining by directing the > Physical Layer LTSSM to the Recovery state. If the LTSSM is already in > Recovery or Configuration, re-entering Recovery is permitted but not > required. > > Entering Recovery state is normally done from LTSSM L0, L0s and L1 states. > But since the pci-aardvark.c driver enables Link Training just a few lines > above, the controller is not in L0 ready state yet. So setting aardvark bit > PCIE_CORE_LINK_TRAINING does not actually enter Recovery state at this > place. > > Moreover, trying to enter LTSSM Recovery state without other configuration > is causing issues for some cards (e.g. Atheros AR9xxx and QCA9xxx). Since > Recovery state is not entered, these issues are not triggered. > > Remove code which tries to enter LTSSM Recovery state completely. > > Signed-off-by: Pali Rohár > Reviewed-by: Marek Behún Reviewed-by: Stefan Roese Thanks, Stefan > --- > drivers/pci/pci-aardvark.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c > index c43d4f309b19..06c567e236f9 100644 > --- a/drivers/pci/pci-aardvark.c > +++ b/drivers/pci/pci-aardvark.c > @@ -613,11 +613,6 @@ static int pcie_advk_setup_hw(struct pcie_advk *pcie) > reg |= PIO_CTRL_ADDR_WIN_DISABLE; > advk_writel(pcie, reg, PIO_CTRL); > > - /* Start link training */ > - reg = advk_readl(pcie, PCIE_CORE_LINK_CTRL_STAT_REG); > - reg |= PCIE_CORE_LINK_TRAINING; > - advk_writel(pcie, reg, PCIE_CORE_LINK_CTRL_STAT_REG); > - > /* Wait for PCIe link up */ > if (pcie_advk_wait_for_link(pcie)) > return -ENXIO; > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de