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.8 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 4AAF9C47083 for ; Fri, 4 Jun 2021 13:12:35 +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 01539613D8 for ; Fri, 4 Jun 2021 13:12:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01539613D8 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 BFF4880C94; Fri, 4 Jun 2021 15:12:31 +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=1622812352; bh=S3RrFHSKdDL3Ho9eT8M8+Fs3e2Kw3hzGyxmVYON+/Do=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tYSNmJhGGZc7bNHn2Dpf5hWER/+emC2VrzRsLQ5zUmLEO8qt6CyZp7fFVrRxKKBgG TkfFFLGrLQ/lkKPxqYAiDRIgMjnGA2WLhkehIKEolfvaGupBxZteIUISTbFbPKOcbi bc2OjVmZDZCaCNwnuf6hEHvu7XX7zkbY1aNcjkotDQSk9v1AqFtrd4tzf156NXTOl5 YxEsZH2mRx6XB5TBFE8jTpchdkz2svmadbMLyhYHF3rI0OoEyTp5eQHOAv/ojtgaMC 1wakpqMuS6m/ERMRn2+/5XH5fIVxZqtUXT6Mdr0222j0bsELow3ORgNKArL7dgS7+l MC6aLhe8PJVUw== Received: by phobos.denx.de (Postfix, from userid 109) id 6ED1382052; Fri, 4 Jun 2021 15:12:30 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (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 7C4AA80423 for ; Fri, 4 Jun 2021 15:12:25 +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 [80.241.60.241]) (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 4FxNTj2ZzyzQjp8; Fri, 4 Jun 2021 15:12:25 +0200 (CEST) Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id 2i0OzihdmlXh; Fri, 4 Jun 2021 15:12:22 +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: Date: Fri, 4 Jun 2021 15:12:21 +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.76 / 15.00 / 15.00 X-Rspamd-Queue-Id: 34505180D X-Rspamd-UID: 4cc31f 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 Complete series: Applied to u-boot-marvell/master 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