Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp147071ybs; Tue, 26 May 2020 05:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk7A8OIXtnQ7IKrNw3ORT94l/+CCqnrqTOBnVBYPIMk3wl37reo/t2XT+xCE2xheKdTdwe X-Received: by 2002:aa7:cb53:: with SMTP id w19mr1938574edt.328.1590497894930; Tue, 26 May 2020 05:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590497894; cv=none; d=google.com; s=arc-20160816; b=q0EIN+56kRWyFv1uTAkoKvSp6kO/+YfYcP7Hbq7cuMPsvOngU6/xjmQSW14GbrPKmL lSona105HQWLfxGSU+bRbO0FdECv/oshwKjwHXCCmO39db29MCsjeHQIdIr15zS50lXt Afv5Md8Niy9Cu9OglSbDHAxO9SHtKV7kTcK2i86ugY8mZmyssvnYyTmsD10XPmU/edj0 OTL2kAgjjIOVbWpJkjbD/dBD+7D8t5krQgNyHiG+kj8KXU8mPEHEKK6ebZ+Ssv1k2I/A Q4GEesHkTlUdyDTBrZ/Jvdc54iAr/jm2NKNFHjNEffEfKeMBqvlYhsZLodcxuZ5y+9PK clBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=aQLHuck/H6hUhxdEpWbnpYG+y4hFu1KRyBN1f+7zkW8=; b=orQzptlq7KdjHyB6c7cNiRrgmN4ngGlryHPAswYjG5Ffr2hWwmS76lfjyCc4i9Q8Hx nUGpM8TS0uY1TQyiY/crI/gRj9RiiSpFEz2JXwCCuhRslhh3nlv96V+EJRmIEOPcCueZ a7934ngvBAN7k93QBHXLaRF7PZ/w3rwcGiM0Kgz1qwMdfKxoF/SwksZbU+ocYbbVn22e s6oKdvLTzslG5glT3AaCa82AkpaoVulm3v0zfjwMu4VcPTUv09M3YEF57lcIl4h//s8U ZbcYzk8h+u8rAHQnsta6xCSiRjZJYqCKyXO8lydmfUscpAaJNhf3ErbaYJwfp3wCWz2n XDQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XirmZKzM; 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 gf6si10624640ejb.338.2020.05.26.05.57.41; Tue, 26 May 2020 05:58:14 -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=XirmZKzM; 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 S1731988AbgEZLtt (ORCPT + 99 others); Tue, 26 May 2020 07:49:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731990AbgEZLtt (ORCPT ); Tue, 26 May 2020 07:49:49 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CE7C08C5C2 for ; Tue, 26 May 2020 04:49:48 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id x13so10060986pfn.11 for ; Tue, 26 May 2020 04:49:48 -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; bh=aQLHuck/H6hUhxdEpWbnpYG+y4hFu1KRyBN1f+7zkW8=; b=XirmZKzM+LLXAtNZtlVmQwpy7SRWcMC0TYlRFk6EZGxsqxO252W3y8Nbx4uWD13qJw t6QjUR70f+5VrzW+sLYKnb8N8Jp5p/D00A51Ue/rxj4SAEosbp4CeVDJsJSIvPSWRds6 /mk9A2jA56M7p0pSDTmMSNjOjPAWeCn/FACm5/I5azIw1lC3WMp2WR3XnbKbz9xqsl2/ ulTm4r8T6NUFIzbvPYU2rllFJGPgCXxuSK2bWEK8Oovu2ZNsAUny/uwETLINLVVqPbNh AC58/ztbWIjpzc0KrCChbcnxAr9RxwVmBX0Q6vVr6ifmh4olUxNMQiOLvWnSfEcQiZg/ 3Emw== 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; bh=aQLHuck/H6hUhxdEpWbnpYG+y4hFu1KRyBN1f+7zkW8=; b=eATUF05uXoP6fnEwRN2KaNSxsWftFLGi0N6wbIcmbWQNj1TV7rZXQclF5wY+mARhzv 2p7b4wYV7hj+QPmjNdEm1t+TCAYl53JZFrLzS79jKXQpRfk9kkmvjt361RL1L0fg4tL1 Njn3RomRq8Zc/pAeP+4LV4mD88hTxodnjy4Zfvsy07/8FUtlBNoQR5OFzSajc61D0oke bXCu8KjtMB+iOqoLNwjfzmOITwrZ8edj+Fs4zsyNPhzzYjzgBkOJ5m8sH5bA+t8FgJoe xMVr4obm04I6skNvNDia3Z1BdzeMEndAaUEnL6Od5m0IUXk95vg5QhZ6U/Ph8p8YiJ7I YPpQ== X-Gm-Message-State: AOAM5339wxktzvmTNxgQfomCSLoCMjPULZg5K+WfzgWic4gD72o7mOCD kBtOX6wwEWQDcVfaLx/V3ZeA1A== X-Received: by 2002:a63:33c6:: with SMTP id z189mr714101pgz.426.1590493787584; Tue, 26 May 2020 04:49:47 -0700 (PDT) Received: from localhost.localdomain ([45.135.186.9]) by smtp.gmail.com with ESMTPSA id c12sm15586567pjm.46.2020.05.26.04.49.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2020 04:49:46 -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 0/2] Introduce PCI_FIXUP_IOMMU Date: Tue, 26 May 2020 19:49:07 +0800 Message-Id: <1590493749-13823-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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. Here introducing PCI_FIXUP_IOMMU, which is called after iommu_fwnode is allocated, instead of reusing PCI_FIXUP_FINAL since it will slow down iommu probing as all devices in fixup final list will be reprocessed, suggested by Joerg, [1] For example: Hisilicon platform device need fixup in drivers/pci/quirks.c handling fwspec->can_stall, which is introduced in [2] +static void quirk_huawei_pcie_sva(struct pci_dev *pdev) +{ + struct iommu_fwspec *fwspec; + + pdev->eetlp_prefix_path = 1; + fwspec = dev_iommu_fwspec_get(&pdev->dev); + if (fwspec) + fwspec->can_stall = 1; +} + +DECLARE_PCI_FIXUP_IOMMU(PCI_VENDOR_ID_HUAWEI, 0xa250, quirk_huawei_pcie_sva); +DECLARE_PCI_iFIXUP_IOMMU(PCI_VENDOR_ID_HUAWEI, 0xa251, quirk_huawei_pcie_sva); [1] https://www.spinics.net/lists/iommu/msg44591.html [2] https://www.spinics.net/lists/linux-pci/msg94559.html Zhangfei Gao (2): PCI: Introduce PCI_FIXUP_IOMMU iommu: calling pci_fixup_iommu in iommu_fwspec_init drivers/iommu/iommu.c | 4 ++++ drivers/pci/quirks.c | 7 +++++++ include/asm-generic/vmlinux.lds.h | 3 +++ include/linux/pci.h | 8 ++++++++ 4 files changed, 22 insertions(+) -- 2.7.4