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=-12.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 3685CC432BE for ; Thu, 2 Sep 2021 13:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 136486108B for ; Thu, 2 Sep 2021 13:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344917AbhIBNIV (ORCPT ); Thu, 2 Sep 2021 09:08:21 -0400 Received: from foss.arm.com ([217.140.110.172]:49222 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234054AbhIBNIS (ORCPT ); Thu, 2 Sep 2021 09:08:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FBE51FB; Thu, 2 Sep 2021 06:07:19 -0700 (PDT) Received: from [10.57.15.112] (unknown [10.57.15.112]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 41B0D3F5A1; Thu, 2 Sep 2021 06:07:17 -0700 (PDT) Subject: Re: [PATCH v4] iommu/of: Fix pci_request_acs() before enumerating PCI devices To: Anders Roxell Cc: Marek Szyprowski , Wang Xingang , Rob Herring , Will Deacon , joro@8bytes.org, helgaas@kernel.org, Rob Herring , Greg Kroah-Hartman , iommu@lists.linux-foundation.org, Linux Kernel Mailing List , linux-pci@vger.kernel.org, xieyingtai@huawei.com, "linux-arm-kernel@lists.infradead.org" , Linux-Next Mailing List References: <1621566204-37456-1-git-send-email-wangxingang5@huawei.com> <01314d70-41e6-70f9-e496-84091948701a@samsung.com> From: Robin Murphy Message-ID: <25b0b214-b9b4-4066-3912-a5bcb054dc0d@arm.com> Date: Thu, 2 Sep 2021 14:07:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-09-02 13:51, Anders Roxell wrote: > On Wed, 1 Sept 2021 at 11:58, Robin Murphy wrote: >> >> On 2021-09-01 09:59, Marek Szyprowski wrote: >>> On 21.05.2021 05:03, Wang Xingang wrote: >>>> From: Xingang Wang >>>> >>>> When booting with devicetree, the pci_request_acs() is called after the >>>> enumeration and initialization of PCI devices, thus the ACS is not >>>> enabled. And ACS should be enabled when IOMMU is detected for the >>>> PCI host bridge, so add check for IOMMU before probe of PCI host and call >>>> pci_request_acs() to make sure ACS will be enabled when enumerating PCI >>>> devices. >>>> >>>> Fixes: 6bf6c24720d33 ("iommu/of: Request ACS from the PCI core when >>>> configuring IOMMU linkage") >>>> Signed-off-by: Xingang Wang >>> >>> This patch landed in linux-next as commit 57a4ab1584e6 ("iommu/of: Fix >>> pci_request_acs() before enumerating PCI devices"). Sadly it breaks PCI >>> operation on ARM Juno R1 board (arch/arm64/boot/dts/arm/juno-r1.dts). It > > We've seen this on ARM Juno R2 boards too in the Linaro testfarm. > > The problem is that the device can't get the "SATA link up" while booting. > > see https://lkft.validation.linaro.org/scheduler/job/3416767#L577 Hmm, what's odd there is that you don't seem to be even detecting any of the endpoints there. Notably, the switch (which both the slots and the on-board endpoints are behind) *does* support ACS even though the Root Complex doesn't, so I wonder if it's getting enabled there and causing it to forward TLPs with ACS bits set which the RC doesn't like? I'm far from a PCI expert, but I might try running this patch on my board to see if anything else stands out. Robin. > When reverting this patch we are able to see the "SATA link up". > > Cheers, > Anders > 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=-12.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,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 E605BC432BE for ; Thu, 2 Sep 2021 13:07:30 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F3196108B for ; Thu, 2 Sep 2021 13:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8F3196108B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 633794256B; Thu, 2 Sep 2021 13:07:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KvKUEBYmYrQx; Thu, 2 Sep 2021 13:07:26 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id E404142559; Thu, 2 Sep 2021 13:07:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id CAB5BC001A; Thu, 2 Sep 2021 13:07:25 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 519D2C000E for ; Thu, 2 Sep 2021 13:07:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 41300614CF for ; Thu, 2 Sep 2021 13:07:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I6as68RCUz2g for ; Thu, 2 Sep 2021 13:07:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp3.osuosl.org (Postfix) with ESMTP id 4004A606E6 for ; Thu, 2 Sep 2021 13:07:20 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FBE51FB; Thu, 2 Sep 2021 06:07:19 -0700 (PDT) Received: from [10.57.15.112] (unknown [10.57.15.112]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 41B0D3F5A1; Thu, 2 Sep 2021 06:07:17 -0700 (PDT) Subject: Re: [PATCH v4] iommu/of: Fix pci_request_acs() before enumerating PCI devices To: Anders Roxell References: <1621566204-37456-1-git-send-email-wangxingang5@huawei.com> <01314d70-41e6-70f9-e496-84091948701a@samsung.com> From: Robin Murphy Message-ID: <25b0b214-b9b4-4066-3912-a5bcb054dc0d@arm.com> Date: Thu, 2 Sep 2021 14:07:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB Cc: xieyingtai@huawei.com, Rob Herring , Wang Xingang , Greg Kroah-Hartman , Linux Kernel Mailing List , iommu@lists.linux-foundation.org, Rob Herring , helgaas@kernel.org, Linux-Next Mailing List , linux-pci@vger.kernel.org, Will Deacon , "linux-arm-kernel@lists.infradead.org" X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 2021-09-02 13:51, Anders Roxell wrote: > On Wed, 1 Sept 2021 at 11:58, Robin Murphy wrote: >> >> On 2021-09-01 09:59, Marek Szyprowski wrote: >>> On 21.05.2021 05:03, Wang Xingang wrote: >>>> From: Xingang Wang >>>> >>>> When booting with devicetree, the pci_request_acs() is called after the >>>> enumeration and initialization of PCI devices, thus the ACS is not >>>> enabled. And ACS should be enabled when IOMMU is detected for the >>>> PCI host bridge, so add check for IOMMU before probe of PCI host and call >>>> pci_request_acs() to make sure ACS will be enabled when enumerating PCI >>>> devices. >>>> >>>> Fixes: 6bf6c24720d33 ("iommu/of: Request ACS from the PCI core when >>>> configuring IOMMU linkage") >>>> Signed-off-by: Xingang Wang >>> >>> This patch landed in linux-next as commit 57a4ab1584e6 ("iommu/of: Fix >>> pci_request_acs() before enumerating PCI devices"). Sadly it breaks PCI >>> operation on ARM Juno R1 board (arch/arm64/boot/dts/arm/juno-r1.dts). It > > We've seen this on ARM Juno R2 boards too in the Linaro testfarm. > > The problem is that the device can't get the "SATA link up" while booting. > > see https://lkft.validation.linaro.org/scheduler/job/3416767#L577 Hmm, what's odd there is that you don't seem to be even detecting any of the endpoints there. Notably, the switch (which both the slots and the on-board endpoints are behind) *does* support ACS even though the Root Complex doesn't, so I wonder if it's getting enabled there and causing it to forward TLPs with ACS bits set which the RC doesn't like? I'm far from a PCI expert, but I might try running this patch on my board to see if anything else stands out. Robin. > When reverting this patch we are able to see the "SATA link up". > > Cheers, > Anders > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-12.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,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 1D2A1C432BE for ; Thu, 2 Sep 2021 13:10:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3795610D0 for ; Thu, 2 Sep 2021 13:10:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D3795610D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mGuiP0VLuaSRmHUMvNjfBrTVCmimqdg/HSR3OHYJX8U=; b=2DjggtED/bYQHNVOAqEs1bgru/ l9v/GRkJbzFJEXsfPMdFrzAfqxT6dCttOZVvrLAihJ6SaBIzw0Zb5978frLj99BZ5Hb+jkdcTseUP taai3Qopea1h3vyAQcNLf3rKVjl/+rd9jjPMmyF3k4v5+GOgD5ybXBhjsGXbSrL3D28EiuombSYEc GQ+VKlQcMsfRkpqiex78J0WdCVITSgwxgRZSkGBXNM+Orcmmd7TU/WRl9Z7cZ4hA4q+/+c9A1K/vh RH7T+T2XuDGFjExK/ZqaQ2Jiat2gGu4vkiZVRphpJ2UvMyPQRpGXvWZgz1R2wt6JiMoDfZ43TuWMq yVMhQZpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLmRK-009ejE-80; Thu, 02 Sep 2021 13:07:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLmRC-009efH-4E for linux-arm-kernel@lists.infradead.org; Thu, 02 Sep 2021 13:07:30 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FBE51FB; Thu, 2 Sep 2021 06:07:19 -0700 (PDT) Received: from [10.57.15.112] (unknown [10.57.15.112]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 41B0D3F5A1; Thu, 2 Sep 2021 06:07:17 -0700 (PDT) Subject: Re: [PATCH v4] iommu/of: Fix pci_request_acs() before enumerating PCI devices To: Anders Roxell Cc: Marek Szyprowski , Wang Xingang , Rob Herring , Will Deacon , joro@8bytes.org, helgaas@kernel.org, Rob Herring , Greg Kroah-Hartman , iommu@lists.linux-foundation.org, Linux Kernel Mailing List , linux-pci@vger.kernel.org, xieyingtai@huawei.com, "linux-arm-kernel@lists.infradead.org" , Linux-Next Mailing List References: <1621566204-37456-1-git-send-email-wangxingang5@huawei.com> <01314d70-41e6-70f9-e496-84091948701a@samsung.com> From: Robin Murphy Message-ID: <25b0b214-b9b4-4066-3912-a5bcb054dc0d@arm.com> Date: Thu, 2 Sep 2021 14:07:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210902_060726_270446_29D0A7C7 X-CRM114-Status: GOOD ( 19.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-09-02 13:51, Anders Roxell wrote: > On Wed, 1 Sept 2021 at 11:58, Robin Murphy wrote: >> >> On 2021-09-01 09:59, Marek Szyprowski wrote: >>> On 21.05.2021 05:03, Wang Xingang wrote: >>>> From: Xingang Wang >>>> >>>> When booting with devicetree, the pci_request_acs() is called after the >>>> enumeration and initialization of PCI devices, thus the ACS is not >>>> enabled. And ACS should be enabled when IOMMU is detected for the >>>> PCI host bridge, so add check for IOMMU before probe of PCI host and call >>>> pci_request_acs() to make sure ACS will be enabled when enumerating PCI >>>> devices. >>>> >>>> Fixes: 6bf6c24720d33 ("iommu/of: Request ACS from the PCI core when >>>> configuring IOMMU linkage") >>>> Signed-off-by: Xingang Wang >>> >>> This patch landed in linux-next as commit 57a4ab1584e6 ("iommu/of: Fix >>> pci_request_acs() before enumerating PCI devices"). Sadly it breaks PCI >>> operation on ARM Juno R1 board (arch/arm64/boot/dts/arm/juno-r1.dts). It > > We've seen this on ARM Juno R2 boards too in the Linaro testfarm. > > The problem is that the device can't get the "SATA link up" while booting. > > see https://lkft.validation.linaro.org/scheduler/job/3416767#L577 Hmm, what's odd there is that you don't seem to be even detecting any of the endpoints there. Notably, the switch (which both the slots and the on-board endpoints are behind) *does* support ACS even though the Root Complex doesn't, so I wonder if it's getting enabled there and causing it to forward TLPs with ACS bits set which the RC doesn't like? I'm far from a PCI expert, but I might try running this patch on my board to see if anything else stands out. Robin. > When reverting this patch we are able to see the "SATA link up". > > Cheers, > Anders > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel