Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3589778rwb; Sun, 9 Oct 2022 07:40:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YxG3IHAEz/NB5nn6kIP7GuinJQUDf2cGSn0Uqa0y7MBz461+RtIvrSwUQPNMPGuZ32CGE X-Received: by 2002:a17:907:7fa0:b0:782:9713:1e with SMTP id qk32-20020a1709077fa000b007829713001emr11586986ejc.394.1665326453936; Sun, 09 Oct 2022 07:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665326453; cv=none; d=google.com; s=arc-20160816; b=Yqqz2ctY9Rx/gH1VBaSyJarY0xUoP9O2miFULEGJxFGGLiRdrCxxO9KxA9FsilvLta TsF++D8DxtQslW7vdHffxWWcWJledJGU7SmSgozp1UPwzWd1/PN/AiY1BmCE5aZJodzV dDmBlBscz0gsOqjxNwQN+yHM8LWk+7dxTbuLJMYgTJXN7WFtgh1noLane+piLmh1uHec wmzQ4Tff8hHwNvP0N39+nmDL3FnPctftPeThPbAZS/bYGUne/whvHIg0fBTugvmVpVeq AXmux5n3mtogHt6UBYfSQ1yqlxQaLXmkfLbD9KMaHQGfrhpFZiIujZkth0rrB3x5ELST sPcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HdkZGmNyUgLgOxoOks4azq7aeeDrSt7iBVVb6wS84Kw=; b=lQCN+8TJMW1g+bMfOd7GKzKXnYJt9dtCrOx2jBifc4l+LCbDb/i8wYByll4Nij2LkM fgFcNANPngDBaIgRWpFkNxzxT70f15pmLvCj3K+WbodQku7rediEWHHtG9yp9dPg3oaR X4P0HGQQ9fllkvRIxKWSLR4+2aHexA5MzN77gIMjctTLW/8VyGbnodp7rCVT3AMYqnpJ jsIVb2e/RCfhOwMtuBTnEWOjN6p85tKfkVIkZ1LHRLBb/RvbpvCqKw59tN/qtQAgzCpf bZp2x8MOIrjXa2nDOXGy1D4K8S9Sr6aINcu/ripUIKYwKF38vJdy4VwIqUBqIgbeJ/eV NUmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S3basKIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056402278900b0045c1fefee4esi166204ede.309.2022.10.09.07.40.28; Sun, 09 Oct 2022 07:40:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S3basKIA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229570AbiJIOOm (ORCPT + 99 others); Sun, 9 Oct 2022 10:14:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbiJIOOl (ORCPT ); Sun, 9 Oct 2022 10:14:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6702810AE; Sun, 9 Oct 2022 07:14:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 18C40B80C90; Sun, 9 Oct 2022 14:14:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EDC2C433D6; Sun, 9 Oct 2022 14:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665324877; bh=X378QBRR8uUAznBT9JVX5MswNKa0iT9BSFp/VnH8/dA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S3basKIALIDNa79aZVYQ6yXrCAkbuKz2cJzJUushtKiYyaOKQ8yFc8QMdUYChbnPc AvOcwU0Qm1AX9DvPk3Mu/HL/SKAEDZ+kN4eaoebHd7Yn74sg7e1q3v63AVPkUN9Ndv r+NZOy1qKMyPys1N/J1pNbzYRYTaI306N3s1NSxY4tLjOPVkhZtMdsmW03th4mx9nJ bYEb/+AbYjN+ZCx9GzrrcSAbDVGJ7fZUVmOGqF4LrqsrFDqGtRGqTjSmLXcdLIt0Zf Tm4kp0/qne4BOut0LSdTUFYez5oWLPh9EFc43t0hZa6lrNjwqKz79m4WoCCY/a0KrW o+1FssHt7zf5g== Received: by pali.im (Postfix) id C3FEC7C1; Sun, 9 Oct 2022 16:14:34 +0200 (CEST) Date: Sun, 9 Oct 2022 16:14:34 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Cc: "Maciej W. Rozycki" , Stefan Roese , Jim Wilson , David Abdurachmanov , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 0/5] pci: Work around ASMedia ASM2824 PCIe link training failures Message-ID: <20221009141434.ddijf6w76cz5ch2v@pali> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bjorn, Krzysztof: could you please look at this patch series and say what do you think about it? It is quite strange issue for which is defined PCI_ANY_ID quirk... And is needs to be somehow workarounded. On Saturday 17 September 2022 13:03:05 Maciej W. Rozycki wrote: > Hi, > > This is v5 of the change to work around a PCIe link training phenomenon > where a pair of devices both capable of operating at a link speed above > 2.5GT/s seems unable to negotiate the link speed and continues training > indefinitely with the Link Training bit switching on and off repeatedly > and the data link layer never reaching the active state. > > This was originally observed in a configuration featuring a downstream > port of the ASMedia ASM2824 Gen 3 switch wired to the upstream port of the > Pericom PI7C9X2G304 Gen 2 switch. However in the course of review I have > come to the conclusion that similarly to the earlier similar change to > U-Boot it is indeed expected to be safe to apply this workaround to any > downstream port that has failed link negotiation provided that: > > 1. the port is capable of reporting the data link layer link active > status (because unlike U-Boot we cannot busy-loop continuously polling > the link training bit), > > and: > > 2. we don't attempt to lift the 2.5GT/s speed restriction, imposed as the > basis of the workaround, for devices not explicitly known to continue > working in that case. > > It is expected to be safe because the workaround is applied to a failed > link, that is one that does not (at the time this code is executed) work > anyway, so trying to bring it up cannot make the situation worse. So this > version of the workaround is attempted for all PCIe devices discovered, > and only the lifting of the 2.5GT/s speed restriction is qualified by the > vendor:device ID, currently one of the ASMedia ASM2824 device only. > > Broadening the scope of the quirk has in turn made it necessary to make > some adjustments to code elsewhere and consequently what was originally a > single patch has now become a small series instead. > > This has been verified with a SiFive HiFive unmatched board, booting with > or without the workaround activated in U-Boot, which covered both the link > retraining part of the quirk and the lifting of speed restriction already > imposed by U-Boot. > > Please see individual change descriptions for further details. > > Questions or comments? Otherwise please apply. > > Maciej