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=-17.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 15BACC4708F for ; Tue, 1 Jun 2021 12:57:53 +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 E35C66136E for ; Tue, 1 Jun 2021 12:57:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E35C66136E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 6DC5F80F0E; Tue, 1 Jun 2021 14:57:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="l5uiiPm7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 267E281D0B; Tue, 1 Jun 2021 14:57:48 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3D9AF80F0E for ; Tue, 1 Jun 2021 14:57:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 3ECAC6139A; Tue, 1 Jun 2021 12:57:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622552258; bh=TwpusVRvEXuJsCRylmdPgDjkFXSKCADwUECtpJtZ05U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l5uiiPm7NuSQRLbvgqi+amUNHLxWikKVtZ+1YSzUq1eS8A1gqoGOtgz9YT8d5m9GP c6aaHfxKX2qsOprJihgZdXX/sZe0+gQWtlMgEOVUn8eMu4Kc1UpAwrb9SeGrY0CZCz hX7JKyXvbg7QTa12NiHHlPGR5vVTjJXzba48xtQQYl+ZkEJtjm8HuAPuhgMZmkSncT SImfBJ5ceWb5r/f/hYVZ8W9W+SIMmCfoIH15gPhtNOu0/ljdVzZVofUUczDlgyq3KW fjdfI0ym8ubNPhxmI4k14TgcQbBkeVhaNW1iuQ1jlYfIFe/7OyLK/1rpk+TPnlfpyu P9IIaum1oKMow== Received: by pali.im (Postfix) id B1CABBC7; Tue, 1 Jun 2021 14:57:35 +0200 (CEST) Date: Tue, 1 Jun 2021 14:57:35 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Stefan Roese Cc: Konstantin Porotchkin , Marek =?utf-8?B?QmVow7pu?= , u-boot@lists.denx.de Subject: Re: [PATCH v2 1/7] arm: a37xx: pci: Don't put link into LTSSM Recovery state during probe Message-ID: <20210601125735.3w5bd32qekmy7ocz@pali> References: <20210517063956.30905-1-pali@kernel.org> <20210526155940.26141-1-pali@kernel.org> <275d7fc8-bcc2-c1b4-e51e-7a137616059a@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <275d7fc8-bcc2-c1b4-e51e-7a137616059a@denx.de> User-Agent: NeoMutt/20180716 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 Thursday 27 May 2021 08:19:32 Stefan Roese wrote: > 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 Hello Stefan! Thank you for review. Would you be sending these A3720 patches to 2021.07 version? > > --- > > 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