From patchwork Tue May 12 04:08:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 194204 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 35E57C54E4B for ; Tue, 12 May 2020 04:09:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1577420733 for ; Tue, 12 May 2020 04:09:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MbXe+HW+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725536AbgELEJ2 (ORCPT ); Tue, 12 May 2020 00:09:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725851AbgELEJZ (ORCPT ); Tue, 12 May 2020 00:09:25 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F82C061A0E for ; Mon, 11 May 2020 21:09:24 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id mq3so8855367pjb.1 for ; Mon, 11 May 2020 21:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7aGIDKJhsEoY1eFnx3GCg/ODucM/74uibRkoUrBNgnI=; b=MbXe+HW+y1nKNTeJX7Rkc7vQR92xitRyMqVJP0a6SsxnDbH6iUYomnq74hWzkTZ68f VsDEXcDNI+WiQL7KRKURgC+DnubpxvtlSqRn6orZ3t6ahJUtWU/jba1VmPfGbrAQFqe9 d0BOXtDZ+KmfLxAs01EAm+ZevUv5lCcWOdbmkxj/n/F+TajL6AyfojV7uQRSExlmsqBt LzIIpV/HCvUMd5y8iKO9j+SJ+YZ0MESDLDGKnwdAtg4g2nGjok30yTiubZY4Wdh/s4tp eZT6ISiSZ2ssxGHdJ8crKSCVmJ+01cXY+GFP12rW456eaMSvowo+kn4HrkR1btVPh/JZ jPwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7aGIDKJhsEoY1eFnx3GCg/ODucM/74uibRkoUrBNgnI=; b=WG2t8gaP645kczWTlvsVJwkn1DnOM0r1OgiSHlPpTTdWX/zuiqHDuoFFqVcAJ5/0K5 FI0ZgV5Zy357F8oEluTyhFrLo/xFT5eOFr+IRfcf3mGP9tQkX+4JpOjvCB0f4kc0sZ8B snLBDPMrZ2qctuCJhEN9Mfj/KsXP5lPNXmf2Z1go7+/JlIwkY0hkI/CmvbNwhpvz0ueF q+a0CRksQel9gIu7N7I8suGNFQp6UttvqQ8mAy9A0G2N1J2kutvrMaK2PaZx4Yy3X5tH A2Dur/+L3xnetJx9bCUu2hEFmWzzVQg0x8D8FEIRAi2SKKS0nRtxz8WY63JDLh+uXFDS QfPg== X-Gm-Message-State: AGi0PuaxIH8JoUAjL2Q6eRJZb0NleGRoDLgbvZFsn7FPJ66H5OVrEpPe lgMZA3HBhNOsFsJiqHWJVWarFw== X-Google-Smtp-Source: APiQypLaB23RJirP/v+StJWLJjQaMOF0325fVzznuPTbvKpEkcQWNB3eHs32G8ciUzq8DPIby5tNug== X-Received: by 2002:a17:902:c281:: with SMTP id i1mr18100582pld.85.1589256563703; Mon, 11 May 2020 21:09:23 -0700 (PDT) Received: from localhost.localdomain ([240e:362:443:6f00:91af:f25c:441c:7ba4]) by smtp.gmail.com with ESMTPSA id e4sm9471527pge.45.2020.05.11.21.09.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 21:09:23 -0700 (PDT) From: Zhangfei Gao To: Joerg Roedel , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , jean-philippe , Greg Kroah-Hartman , Herbert Xu , kenneth-lee-2012@foxmail.com, Wangzhou Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Zhangfei Gao Subject: [PATCH 1/2] iommu/of: Let pci_fixup_final access iommu_fwnode Date: Tue, 12 May 2020 12:08:30 +0800 Message-Id: <1589256511-12446-2-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589256511-12446-1-git-send-email-zhangfei.gao@linaro.org> References: <1589256511-12446-1-git-send-email-zhangfei.gao@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Calling pci_fixup_final after of_pci_iommu_init, which alloc iommu_fwnode. Some platform devices appear as PCI but are actually on the AMBA bus, and they need fixup in drivers/pci/quirks.c handling iommu_fwnode. So calling pci_fixup_final after iommu_fwnode is allocated. Signed-off-by: Zhangfei Gao --- drivers/iommu/of_iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 20738aac..c1b58c4 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -188,6 +188,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev, pci_request_acs(); err = pci_for_each_dma_alias(to_pci_dev(dev), of_pci_iommu_init, &info); + pci_fixup_device(pci_fixup_final, to_pci_dev(dev)); } else if (dev_is_fsl_mc(dev)) { err = of_fsl_mc_iommu_init(to_fsl_mc_device(dev), master_np); } else {