Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp551385rwb; Tue, 29 Nov 2022 02:10:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ovABy69CHqbOk4IHQ4i/anmpn76aPy8wZ1hUDKMYZCIpksGgXgC81ghq0gYe2gQNbsauf X-Received: by 2002:a17:906:3a41:b0:78d:9caa:31b7 with SMTP id a1-20020a1709063a4100b0078d9caa31b7mr33678719ejf.263.1669716601001; Tue, 29 Nov 2022 02:10:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669716600; cv=none; d=google.com; s=arc-20160816; b=AOYEKeK0EA+MePHPRC5zkukx8DZa2QYQE25rZHdACoS4mu9A+b+Yg5L4IBVkpdhqQs iNbM0R2yekm1IyeR6TH8xr9A0vPkOrp73TpctZ3LsHL1Up4LB0JH6mkSXHYBNJG9mijD uIicoGE4ZLdl2OWhggzTU3KY7frkybwU4jpUCQ37WnHP7krTX2OiCp+0KvuXjugQMdMg qUBzrbd0GLlHUq4w3DJq2WZeoVSkp2s/rqFeubKLMmZpNNa7MoZjTHTbQYmMqMjmkF2Z 6UIvaP6ys8EH/qCBzo461tW12vkxPtONa5LZFVLnB75eOnTyWgGdYX1mTsSipBv0KLxv n69w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=5/YEUSe8+cOzE0risVR15/xluSQsoJx+3TjJtROYLi8=; b=ULuRnn+k6sTyeA6hIkQ3gT6tWutitYoPdQd1fr1WkMu4rX1G5usRYgsov2fj5cOk2P EAGTknzMdWjmezNHZfhFcwM1LA/YgxV4AF8qemHvEha0sflDfBXn9o1ARNJwjy1KBwnA vicyDSdX5LTJoH/CiiwH6uUL4pcjebm2rgcjHcWi7hgrDkr9l3VD9efhwWr8WQFrdJ0V fMhJ8zkb/uvedK66VjjnN+9k/xOh1O70Fbzey2BMKYD5vz1Ftp85ZMrdUhngR8S3ilcu JcpprOao2TsqPRVrCBRrOo0cJ0/CcPDPQLQtWY0AcFaAukObDWxdhN6MMXzxt6wUlRKl h/ow== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di13-20020a170906730d00b00782e437a368si11103248ejc.160.2022.11.29.02.09.38; Tue, 29 Nov 2022 02:10:00 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232134AbiK2J6C (ORCPT + 83 others); Tue, 29 Nov 2022 04:58:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231963AbiK2J5z (ORCPT ); Tue, 29 Nov 2022 04:57:55 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A781D6437; Tue, 29 Nov 2022 01:57:52 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 0632E92009E; Tue, 29 Nov 2022 10:57:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id F32FD92009B; Tue, 29 Nov 2022 09:57:51 +0000 (GMT) Date: Tue, 29 Nov 2022 09:57:51 +0000 (GMT) From: "Maciej W. Rozycki" To: Alex Williamson cc: Bjorn Helgaas , =?UTF-8?Q?Pali_Roh=C3=A1r?= , Bjorn Helgaas , Stefan Roese , Jim Wilson , David Abdurachmanov , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 5/5] PCI: Work around PCIe link training failures In-Reply-To: <20221109131632.6a059bd9.alex.williamson@redhat.com> Message-ID: References: <20221109050418.GA529724@bhelgaas> <20221109131632.6a059bd9.alex.williamson@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 On Wed, 9 Nov 2022, Alex Williamson wrote: > > 05:00.0 supports the "bus" method, i.e., pci_reset_bus_function(), > > which tries pci_dev_reset_slot_function() followed by > > pci_parent_bus_reset(). Both of them return -ENOTTY if the device > > (05:00.0) has a secondary bus ("dev->subordinate"), so I think nothing > > happens here. > > Right, the pci-sysfs reset attribute is only meant for a reset scope > limited to the device, we'd need something to call pci_reset_bus() to > commit to the whole hierarchy, which is not something we typically do. > vfio-pci will only bind to endpoint devices, so it shouldn't provide an > interface to inject a bus reset here either. > > Based on the fact that there's a pericom switch in play here, I'll just > note that I think this is the same device with other link speed issues > as well: > > https://lore.kernel.org/all/20161026180140.23495.27388.stgit@gimli.home/ Thanks for the pointer. This has been superseded by commit acd61ffb2f16 ("PCI: Add ACS quirk for Pericom PI7C9X2G switches"), right? In which case it is a match ([12d8:2304]), though the quirk does not trigger here, i.e. no message is printed about store-forward mode activation: pcieport 0000:05:00.0: calling pci_fixup_pericom_acs_store_forward+0x0/0xba @ 1 pcieport 0000:05:00.0: pci_fixup_pericom_acs_store_forward+0x0/0xba took 0 usecs [...] pci 0000:05:00.0: calling pci_fixup_pericom_acs_store_forward+0x0/0xba @ 1 pci 0000:05:00.0: pci_fixup_pericom_acs_store_forward+0x0/0xba took 0 usecs [...] pcieport 0000:06:01.0: calling pci_fixup_pericom_acs_store_forward+0x0/0xba @ 1 pcieport 0000:06:01.0: pci_fixup_pericom_acs_store_forward+0x0/0xba took 3 usecs [...] pcieport 0000:06:02.0: calling pci_fixup_pericom_acs_store_forward+0x0/0xba @ 1 pcieport 0000:06:02.0: pci_fixup_pericom_acs_store_forward+0x0/0xba took 2 usecs NB I don't know why the quirk for the upstream port (05:00.0) is called twice, both via pcieport and via pci. > This fell off my plate some time ago, but as noted there, enabling ACS > when the upstream and downstream ports run at different link rates > exposes errata where packets are queued and not delivered within the > switch. > > Could enabling ACS on this device be contributing to the issue here, > for example triggering the Asmedia downstream port to get into this > link reseting issue? A test with > pci=disable_acs_redir=0000:06:01.0;0000:06:02.0 could be interesting > assuming this occurs on an platform that has an IOMMU, ie. calls > pci_request_acs(). Thanks, We have no IOMMU support for any RISC-V machine at the moment: config ARCH_RV64I [...] select SWIOTLB if MMU and: software IO TLB: area num 4. software IO TLB: mapped [mem 0x00000000fb732000-0x00000000ff732000] (64MB) so IIUC this issue does not apply. Thank you for your input. Maciej