Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1071433ybj; Thu, 7 May 2020 14:12:22 -0700 (PDT) X-Google-Smtp-Source: APiQypK73celX45kW82VFrti71HwroDrxCDud5hNdmZ7/igRep5+0C4zIkmHJ4pSJQU/BeC70ZoS X-Received: by 2002:a05:6402:22cd:: with SMTP id dm13mr14347780edb.56.1588885942483; Thu, 07 May 2020 14:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588885942; cv=none; d=google.com; s=arc-20160816; b=LgIsdjg0z4KTjYHxMFTPw80v5G3qRRxw+pjV6LtsdqnXiDS6L1x/PUH3GwIA6QXdM/ UtGbDreof2RwVXNgX32/ClQLsFhPz6tvErXjuQdehAyBxLZ+Y/cd8OihmH/9Xp5R3kss oarL4Gl+bf8M4grHs9PQ5MsCf2x6TVheEHkchdk4xVtQGzZm/IjC69tpZ0thN3JHGPb8 /pWRThobXSAU6VwFyLXpnkjgmkaHHuWE2VhrYg2CFOrzKmpA5qm2QXSYFMPYqpX0MGec EGQEtpdJiW4vLaQW79bxkeNWFILTxJToo0CZXq0838MFWr8ZoAQElNJSRuYHZX2g5uH1 KiyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=vOJAT5al1D5jfLK3KCZe+EiKaiKoKpmEc2pvPJsPSMI=; b=RG6jQVyLpVIqdTZPwiZXrcv3dZzOjJ6Zg603XEaqhZr+jrbtjnQqJy1NsPS+wnqbU5 yApsYOq0k436ZRFWNf8f5yF+fAM7oYHPGznWnLsuikO73dUAMmrj/daw/zgofpvtKSAW fNFLTErlCtNrZbjhEhJgxEniX56YcoL2H2noV2Ej/WQYeipZmDMCifAemFr7DlMhtFFI qWzRYjNomw9ZioBLk1VJSMDMo9KtBblxwSEaZT0vEhTQLmM5V6hYq9zCvmE/h9DClL9T cX+RwC2Z0eRLu1wnJ4qtXe9cHPR5V7stGzickMCqr5se6swXmnuWVqJ/wcv8/XTqyU7r y3gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si3825813edv.549.2020.05.07.14.11.59; Thu, 07 May 2020 14:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbgEGVKU (ORCPT + 99 others); Thu, 7 May 2020 17:10:20 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:38001 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbgEGVKU (ORCPT ); Thu, 7 May 2020 17:10:20 -0400 Received: by mail-oi1-f195.google.com with SMTP id r66so6525706oie.5; Thu, 07 May 2020 14:10:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=vOJAT5al1D5jfLK3KCZe+EiKaiKoKpmEc2pvPJsPSMI=; b=Z2hHdYFTCOCunFIh8PZ1MiclTsSpNzzJeSfr2gnLT/Nwumc+K0vDpSJYVVhTbG44tL x0weV1osoeDSUDY/Szfmyj5cFBUuP5P6N+aoFlz9YxgA1LSdnbxm+SGnLfCrQh2A8tsf PVrbMHUXWfWtj8QypCcvVH/Cq2rzhBkG6kUolLuJLo7jf0U/xjsOcgrBHTlQRzf65pQK RFLtCsf+WvHy9oTX1BzVgUu1KAMpbcApbppSFTaANNwgzjCvkba++DRbtRBsO0SzTaZ0 awaOzkvqU+BpHGQMvelEGgHNatPielw7hLZ6XKUhqva2HwDkVrNxLlEkOGmDUu4B24y5 NSTA== X-Gm-Message-State: AGi0PuaKrUh+K1bFcEP5xhGoMM2Azvo84C3BuzESmQf0S8TEIbmkDc6k MOwOXSiTYawkAs9wXEuxSDKfUrU= X-Received: by 2002:aca:f454:: with SMTP id s81mr7657610oih.138.1588885817620; Thu, 07 May 2020 14:10:17 -0700 (PDT) Received: from rob-hp-laptop (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id p13sm1735241oom.34.2020.05.07.14.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 14:10:17 -0700 (PDT) Received: (nullmailer pid 32069 invoked by uid 1000); Thu, 07 May 2020 21:10:15 -0000 Date: Thu, 7 May 2020 16:10:15 -0500 From: Rob Herring To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Petazzoni , Lorenzo Pieralisi , Andrew Murray , Bjorn Helgaas , Remi Pommarel , Marek =?iso-8859-1?Q?Beh=FAn?= , Tomasz Maciej Nowak , Xogium , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH v4 04/12] PCI: aardvark: Improve link training Message-ID: <20200507211015.GA31477@bogus> References: <20200430080625.26070-1-pali@kernel.org> <20200430080625.26070-5-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200430080625.26070-5-pali@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Apr 2020 10:06:17 +0200, =?UTF-8?q?Pali=20Roh=C3=A1r?= wrote: > From: Marek Beh?n > > Currently the aardvark driver trains link in PCIe gen2 mode. This may > cause some buggy gen1 cards (such as Compex WLE900VX) to be unstable or > even not detected. Moreover when ASPM code tries to retrain link second > time, these cards may stop responding and link goes down. If gen1 is > used this does not happen. > > Unconditionally forcing gen1 is not a good solution since it may have > performance impact on gen2 cards. > > To overcome this, read 'max-link-speed' property (as defined in PCI > device tree bindings) and use this as max gen mode. Then iteratively try > link training at this mode or lower until successful. After successful > link training choose final controller gen based on Negotiated Link Speed > from Link Status register, which should match card speed. > > Signed-off-by: Pali Roh?r > Signed-off-by: Marek Beh?n > --- > drivers/pci/controller/pci-aardvark.c | 114 ++++++++++++++++++++------ > 1 file changed, 89 insertions(+), 25 deletions(-) > Reviewed-by: Rob Herring