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=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 67B9FC433B4 for ; Fri, 7 May 2021 12:50:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33ABF6143F for ; Fri, 7 May 2021 12:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237080AbhEGMvK (ORCPT ); Fri, 7 May 2021 08:51:10 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:17152 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237051AbhEGMvI (ORCPT ); Fri, 7 May 2021 08:51:08 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Fc9F52R6VzqTD8; Fri, 7 May 2021 20:46:49 +0800 (CST) Received: from huawei.com (10.174.185.226) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Fri, 7 May 2021 20:50:00 +0800 From: Wang Xingang To: , CC: , , , , , , Subject: [PATCH 0/1] iommu/of: Fix request and enable ACS for of_iommu_configure Date: Fri, 7 May 2021 12:49:52 +0000 Message-ID: <1620391793-18744-1-git-send-email-wangxingang5@huawei.com> X-Mailer: git-send-email 2.6.4.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.185.226] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Xingang Wang When request ACS in of_iommu_configure, the pci_acs_init procedure has already been called. The pci device probe procedure is like the following: pci_host_common_probe pci_device_add pci_acs_init of_iommu_configure pci_request_acs The pci_request_acs() does not work because the pci_acs_init and pci_enable_acs procedure has already finished, so the ACS is not enabled as expected. Besides, the ACS is enabled only if IOMMU is detected and the device is pci. So this fix 6bf6c24720d33 ("iommu/of: Request ACS from the PCI core when configuring IOMMU linkage"), add pci_enable_acs() and IOMMU check to make sure ACS is enabled for the pci_device. Xingang Wang (1): iommu/of: Fix request and enable ACS for of_iommu_configure drivers/iommu/of_iommu.c | 10 +++++++++- drivers/pci/pci.c | 2 +- include/linux/pci.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) -- 2.19.1