From patchwork Mon Sep 10 19:27:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Kuehling X-Patchwork-Id: 10594729 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DFF4109C for ; Mon, 10 Sep 2018 19:28:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DDCB28C20 for ; Mon, 10 Sep 2018 19:28:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61D8728C42; Mon, 10 Sep 2018 19:28:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D88E028C20 for ; Mon, 10 Sep 2018 19:28:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727607AbeIKAXh (ORCPT ); Mon, 10 Sep 2018 20:23:37 -0400 Received: from mail-sn1nam01on0058.outbound.protection.outlook.com ([104.47.32.58]:30460 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728340AbeIKAXh (ORCPT ); Mon, 10 Sep 2018 20:23:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vz1hsqn6CIELVhoQyphDxup/AHoiAz0emQ8Q33RbRUk=; b=F0GtSHbuhKucLkax47c9R7syfDylVLa4/YYNByMif7VCAE/+BpodUdFheVDpxBGnXoF7HbIsNe7QJYOuzNdM7/63ITsY3203gZuJblhRKeLqFSkB5Lac5GRLYFwkA5KsRtzC8hVuW0VaveJLIOv3R87H3g8+qFxFCn+/bsbu1Rg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Felix.Kuehling@amd.com; Received: from Harpoon.amd.com (165.204.55.251) by DM5PR12MB1707.namprd12.prod.outlook.com (2603:10b6:3:10f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Mon, 10 Sep 2018 19:27:58 +0000 From: Felix Kuehling To: linux-pci@vger.kernel.org Cc: okaya@codeaurora.org, bhelgaas@google.com, Felix Kuehling Subject: [PATCH for-rc] PCI: Fix enabling of PASID on RC integrated endpoints Date: Mon, 10 Sep 2018 15:27:42 -0400 Message-Id: <1536607662-11690-1-git-send-email-Felix.Kuehling@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: YTOPR0101CA0044.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:14::21) To DM5PR12MB1707.namprd12.prod.outlook.com (2603:10b6:3:10f::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b83cb8ab-3cca-40a4-f981-08d617538407 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DM5PR12MB1707; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1707;3:SL1fZu7Z8rFXBvY7GRr214qsKb4Htgu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HTwab+tzoI6eW4dm96TnqABJY/6SON3Iez+WrScuovXkV9TJWz6pVkrqIAVLPR5bZ2hwIunFncEuvuZqGGaFTUW+9IxbkFJCsRxG6KUrgP4m3COtQZo3lxTluLTdofiqem4Cq/P5riKn/P2F9cYr/hkK8vbYE0/GLdRt1dPtJicGfYBzUjqhPybUg5bfj2oJGgAFEa2Cg0ch2Wfmg7XkgQk2pq4CXsL2zqF6NtjoobObRh7jOZoIfl64AhWvV2bX0DpNOqHRABDYbII4QamWAuI8Qnp0EN/JLtItVQJl3RVuWST6wO9jBrrh0GqBvdTJuWT5jhY;4:PWXEcQthciZ2BPjmS7c5AtgxEXpjvlV82w8MeiPiwMgYvVdBqr1S5eiMEEQA4QkAqVz07o1rAc4doOo1apxXVecdKNglhGMSSPrbKzhm+mQqgTSI5XGHktUaahTRmg3ReEIH8KUDFZfXLnXS3ooSCO+PaERVEws4Tf4ZzB2oXFXQAicwKMsyoI2wTmFUzp9SHh5jq+WZj5cv3D0f24f73o30n8t+xpwIz5qjpLnSfjnnY96xpRLcVxFOBjnjVyFwZ3tw4rja58mHghsqDAsDgM4ul5HARLA9Qc9KVnDkNNd+SjJKJ5VtQ+TavKGPjgC/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DM5PR12MB1707;BCL:0;PCL:0;RULEID:;SRVR:DM5PR12MB1707; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(136003)(346002)(366004)(396003)(199004)(189003)(2616005)(956004)(486006)(105586002)(2361001)(7736002)(81156014)(386003)(6486002)(305945005)(86362001)(2351001)(476003)(81166006)(8936002)(53416004)(47776003)(53936002)(2906002)(26005)(25786009)(4326008)(8676002)(6306002)(7696005)(51416003)(186003)(52116002)(3846002)(966005)(68736007)(16526019)(478600001)(66066001)(36756003)(72206003)(14444005)(50466002)(48376002)(6116002)(106356001)(6916009)(316002)(6666003)(16586007)(5660300001)(50226002)(97736004);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1707;H:Harpoon.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1707;23:4YF0ZVTPG9nQ7y/Ra9oIGryFjls4Fs2VSajh0EBL9cB4WQUodMLE0PZRD3T5c304h8D6jJsTymhm9QiEVtRFTm4IquRKWTROKRf0S9aCkV4JNe2lvv8Sk3g+18A07T56JCE2o+SBcQTTfNJS48VEPBqwrxy9SVrh1bBEz/zEfjvRUrsMYCjSUCnv7XRq3sKyx/97e2MahB2mfmC+8V+paNoKK5WsoBKrmbn0wlValEbJKbNANVYocIRPTmWoN0e7oWi9jroiabdxCAu0PQ0ZIgRsECXD2gkw0vY0ggEioWQ6o/mTabB4guBgBMs2/fIIhNuiqCZZyHDbmM+QMiUmAlibITF8vPq51/qiMmIZTW7pJTqugrBkBg1XhmisoJ0ZA1J12An0J9kuJ/9+NowwzGCCTm8Lm0tBrRGrqKefT2wHeWEoCmWvkc4YCkVFCeykFpNyyUBrLCehUZD47tF46dbo8NOGdRMcxex+th/BUM60ZM014INwzuER5wKY8GNHB7TqXvlqHI+amTD3lMkjiYP5y56jyZyir8TtnfBMh4jPn2hGf643iDhyuI039LjY6QqvodqD0SZ1KgQdvM8RDKuICMspsUFK3MUOPwYhUhCDPICjDjxzF0YqQJxS1Xf6n8926dHhYI/F/FX+ea3GJthVG8HBlJF9ELKlU/G9llj4T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BzYIal6pI+L+MtMMcrlSFi8P9BWy14YuIdqP72DBPdUgVAUTskW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 19:27:58.2421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b83cb8ab-3cca-40a4-f981-08d617538407 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1707 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set the eetlp_prefix_path on PCIE_EXP_TYPE_RC_END devices to allow PASID to be enabled on them. This fixes IOMMUv2 initialization on AMD Carrizo APUs. Fixes: 7ce3f912ae ("PCI: Enable PASID only if entire path supports End-End TLP prefixes") Link: https://bugzilla.kernel.org/show_bug.cgi?id=201079 Signed-off-by: Felix Kuehling --- drivers/pci/probe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ec78400..201f9e5 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2074,6 +2074,7 @@ static void pci_configure_eetlp_prefix(struct pci_dev *dev) { #ifdef CONFIG_PCI_PASID struct pci_dev *bridge; + int pcie_type; u32 cap; if (!pci_is_pcie(dev)) @@ -2083,7 +2084,9 @@ static void pci_configure_eetlp_prefix(struct pci_dev *dev) if (!(cap & PCI_EXP_DEVCAP2_EE_PREFIX)) return; - if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) + pcie_type = pci_pcie_type(dev); + if (pcie_type == PCI_EXP_TYPE_ROOT_PORT || + pcie_type == PCI_EXP_TYPE_RC_END) dev->eetlp_prefix_path = 1; else { bridge = pci_upstream_bridge(dev);