Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp147967ybs; Tue, 26 May 2020 06:00:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznjZN9EZEwFfHA9duYRFX5f2uPmJo/j810kwCvRVoHZM6PQowd7rOYFyEvzdzKSLUt02nD X-Received: by 2002:aa7:ce17:: with SMTP id d23mr20032217edv.387.1590498000427; Tue, 26 May 2020 06:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590498000; cv=none; d=google.com; s=arc-20160816; b=PN/TKUbYhtSdDrDM+RMzgwPOG0qOgrGWWHOr2+ELAtGa1Av9Qnk/F4cF7ysvjg8FTM ZdfkqdkCRztWClqJKKlkIhzGjvjVGevm6Kv9EAnkg9Rl9Q+hYz4BKlyyg6Ble1jVNoKV V3u/Atav148+NxrlyRzzsRK32wcH75YJE7qUARZu/e+NzBP/ne6FXLoYpWH/4/kqdWE7 9vyAMNwVXtr9yDVTlo6/VgiRyJtZSO/Pwhzr5ShvKzhV21F0TzX/tFL37sYh5kp03103 qm1hwiq5g2+5eBP3IRpi5jT3n7cCDdZToU2ojZItern98tGzLIs9CXN14UryGnmYWjMM hIxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=rzP5fzn/E340EPlW7gDpFBlyEkfSVaF1oJz6fYo76k8=; b=RRFWp18SzbGLAmfWe76VY9EkAT4aNmLGaeJnwJbzA3J25jYWNbN5MXa+0egukbkngl 2bhMWqiPKSLHWT9fpsVlRRNdXiK5eXAAvo/AjA4T8OTKbM9tBPcOOA3skKfgITJlXr3o KkHt05VSC+lS+83DV8yr1u//MUZO9Il2s9HMrnRktDHwIxCLoUJtQ2Tp5X1Ya4YOWdxp xGJyBHaN0Gd+n2DE2kUO83EgNUGo7A2OYq4RoSnakT66cICMqi1M6esz/2g/CrBzU729 di6P5kGkG8d6nHS9N0hxgAZBUgW1yC32vuu588/rlisEL5KMEmfovO4Ic6nWSp1jBlsL ED/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cSls9zjl; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si7432776edy.125.2020.05.26.05.59.37; Tue, 26 May 2020 06:00:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cSls9zjl; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732016AbgEZLuR (ORCPT + 99 others); Tue, 26 May 2020 07:50:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732013AbgEZLuQ (ORCPT ); Tue, 26 May 2020 07:50:16 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA1F5C03E96F for ; Tue, 26 May 2020 04:50:16 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id ci21so1335862pjb.3 for ; Tue, 26 May 2020 04:50:16 -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=rzP5fzn/E340EPlW7gDpFBlyEkfSVaF1oJz6fYo76k8=; b=cSls9zjl0whNH0eR/l2i02O95OOhgGrNGwM26ZGFvkQW9VtZxJfxlywizJRke/rmbm DjeTG2qfQRIUFCJCYqf3IQGjZY5BYNOiPnuTiljaUSiUooWYyRzwspOmUiqDqG0M0ZC0 NH/f8WAxs2sULx5ClU2rSJ/IVPF1eLlml+6rdIo1i25jIwEm+AfsqPAhvJRo8r0X4r3K IiHWdbIh+eGq5kqb6u0B/VzWcIY6fcWtE+dhbKonQdK7ew/58LBw5We1pNCxs/7oweP5 Jjm4EUWxVNg2+Xy8U6NcCfQFYKXK3ubEYUyGEqX5s/R/MQ0L946l4eUlakQO2SpHpvOw LfPw== 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=rzP5fzn/E340EPlW7gDpFBlyEkfSVaF1oJz6fYo76k8=; b=glrtjkF/q+C8+X9SNEPE0ZL4WPmQbHcZRK/vAOuCkbhB8uZThk8eHUTlwu6EUPUqxb v1zOlLmTEbXHPhSx04j8dT+jbC4+ssFaZh91qbsisquzL8yhoPp+Dvy1nXQs806iDIDw eCL5YICyyZGfTbiLcMnzMbvHKYeGs1fIzVr4j+guuLDeeveNNPpMKlYH/gSKmCXwgpRL ca9ozOzW5xoanAHlM2XDcarfhY4OIi1Nee2ZJ1nhJozB2At7lOViVUWV2I7XbszADnLW HBOORHA5l20LmlBV0lvIJzFMikliFs+sGtWA7g3wUVqOxP6Y9yFfD2zbCDkbzikO/nVP opJg== X-Gm-Message-State: AOAM532Oz63EreLtRYvMCbZNHQEOS+Wq8/BVBWA6IkpaUoPAcdQiKkx3 yox1SKzfVZXdAbQnKyhmNUAjf8Y1g/+6jA== X-Received: by 2002:a17:90a:4809:: with SMTP id a9mr26082742pjh.196.1590493816386; Tue, 26 May 2020 04:50:16 -0700 (PDT) Received: from localhost.localdomain ([45.135.186.9]) by smtp.gmail.com with ESMTPSA id c12sm15586567pjm.46.2020.05.26.04.50.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2020 04:50:16 -0700 (PDT) From: Zhangfei Gao To: Joerg Roedel , Bjorn Helgaas , Arnd Bergmann , 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, linux-pci@vger.kernel.org, Zhangfei Gao Subject: [PATCH 2/2] iommu: calling pci_fixup_iommu in iommu_fwspec_init Date: Tue, 26 May 2020 19:49:09 +0800 Message-Id: <1590493749-13823-3-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1590493749-13823-1-git-send-email-zhangfei.gao@linaro.org> References: <1590493749-13823-1-git-send-email-zhangfei.gao@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Calling pci_fixup_iommu in iommu_fwspec_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_iommu after iommu_fwnode is allocated. Signed-off-by: Zhangfei Gao --- drivers/iommu/iommu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 7b37542..fb84c42 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2418,6 +2418,10 @@ int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode, fwspec->iommu_fwnode = iommu_fwnode; fwspec->ops = ops; dev_iommu_fwspec_set(dev, fwspec); + + if (dev_is_pci(dev)) + pci_fixup_device(pci_fixup_iommu, to_pci_dev(dev)); + return 0; } EXPORT_SYMBOL_GPL(iommu_fwspec_init); -- 2.7.4