linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Slawomir Pawlowski <slawomir.pawlowski@intel.com>,
	Przemek Kitszel <przemyslawx.kitszel@intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.4 081/110] PCI: Add DMA alias quirk for Intel VCA NTB
Date: Thu, 30 Jan 2020 19:38:57 +0100	[thread overview]
Message-ID: <20200130183623.811457664@linuxfoundation.org> (raw)
In-Reply-To: <20200130183613.810054545@linuxfoundation.org>

From: Slawomir Pawlowski <slawomir.pawlowski@intel.com>

[ Upstream commit 56b4cd4b7da9ee95778eb5c8abea49f641ebfd91 ]

Intel Visual Compute Accelerator (VCA) is a family of PCIe add-in devices
exposing computational units via Non Transparent Bridges (NTB, PEX 87xx).

Similarly to MIC x200, we need to add DMA aliases to allow buffer access
when IOMMU is enabled.

Add aliases to allow computational unit access to host memory.  These
aliases mark the whole VCA device as one IOMMU group.

All possible slot numbers (0x20) are used, since we are unable to tell what
slot is used on other side.  This quirk is intended for both host and
computational unit sides.  The VCA devices have up to five functions: four
for DMA channels and one additional.

Link: https://lore.kernel.org/r/5683A335CC8BE1438C3C30C49DCC38DF637CED8E@IRSMSX102.ger.corp.intel.com
Signed-off-by: Slawomir Pawlowski <slawomir.pawlowski@intel.com>
Signed-off-by: Przemek Kitszel <przemyslawx.kitszel@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pci/quirks.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 1593b8494ebbc..2f88b1ff7ada4 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4080,6 +4080,40 @@ static void quirk_mic_x200_dma_alias(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2260, quirk_mic_x200_dma_alias);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2264, quirk_mic_x200_dma_alias);
 
+/*
+ * Intel Visual Compute Accelerator (VCA) is a family of PCIe add-in devices
+ * exposing computational units via Non Transparent Bridges (NTB, PEX 87xx).
+ *
+ * Similarly to MIC x200, we need to add DMA aliases to allow buffer access
+ * when IOMMU is enabled.  These aliases allow computational unit access to
+ * host memory.  These aliases mark the whole VCA device as one IOMMU
+ * group.
+ *
+ * All possible slot numbers (0x20) are used, since we are unable to tell
+ * what slot is used on other side.  This quirk is intended for both host
+ * and computational unit sides.  The VCA devices have up to five functions
+ * (four for DMA channels and one additional).
+ */
+static void quirk_pex_vca_alias(struct pci_dev *pdev)
+{
+	const unsigned int num_pci_slots = 0x20;
+	unsigned int slot;
+
+	for (slot = 0; slot < num_pci_slots; slot++) {
+		pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x0));
+		pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x1));
+		pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x2));
+		pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x3));
+		pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x4));
+	}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2954, quirk_pex_vca_alias);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2955, quirk_pex_vca_alias);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2956, quirk_pex_vca_alias);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2958, quirk_pex_vca_alias);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2959, quirk_pex_vca_alias);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x295A, quirk_pex_vca_alias);
+
 /*
  * The IOMMU and interrupt controller on Broadcom Vulcan/Cavium ThunderX2 are
  * associated not at the root bus, but at a bridge below. This quirk avoids
-- 
2.20.1




  parent reply	other threads:[~2020-01-30 18:45 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 18:37 [PATCH 5.4 000/110] 5.4.17-stable review Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 001/110] Bluetooth: btusb: fix non-atomic allocation in completion handler Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 002/110] orinoco_usb: fix interface sanity check Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 003/110] rsi_91x_usb: " Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 004/110] usb: dwc3: pci: add ID for the Intel Comet Lake -V variant Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 005/110] usb: host: xhci-tegra: set MODULE_FIRMWARE for tegra186 Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 006/110] USB: serial: ir-usb: add missing endpoint sanity check Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 007/110] USB: serial: ir-usb: fix link-speed handling Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 008/110] USB: serial: ir-usb: fix IrLAP framing Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 009/110] usb: dwc3: turn off VBUS when leaving host mode Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 010/110] usb: typec: wcove: fix "op-sink-microwatt" default that was in mW Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 011/110] usb: typec: fusb302: " Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 012/110] staging: most: net: fix buffer overflow Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 013/110] staging: wlan-ng: ensure error return is actually returned Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 014/110] staging: vt6656: correct packet types for CTS protect, mode Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 015/110] staging: vt6656: use NULLFUCTION stack on mac80211 Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 016/110] staging: vt6656: Fix false Tx excessive retries reporting Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 017/110] serial: 8250_bcm2835aux: Fix line mismatch on driver unbind Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 018/110] serial: imx: fix a race condition in receive path Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 019/110] debugfs: Return -EPERM when locked down Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 020/110] component: do not dereference opaque pointer in debugfs Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 021/110] binder: fix log spam for existing debugfs file creation Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 022/110] mei: hdcp: bind only with i915 on the same PCH Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 023/110] mei: me: add comet point (lake) H device ids Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 024/110] iio: adc: stm32-dfsdm: fix single conversion Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 025/110] iio: st_gyro: Correct data for LSM9DS0 gyro Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 026/110] driver core: Fix test_async_driver_probe if NUMA is disabled Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 027/110] crypto: chelsio - fix writing tfm flags to wrong place Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 028/110] CIFS: Fix task struct use-after-free on reconnect Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 029/110] cifs: set correct max-buffer-size for smb2_ioctl_init() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 030/110] cifs: Fix memory allocation in __smb2_handle_cancelled_cmd() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 031/110] ath9k: fix storage endpoint lookup Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 032/110] brcmfmac: fix interface sanity check Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 033/110] rtl8xxxu: " Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 034/110] zd1211rw: fix storage endpoint lookup Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 035/110] net_sched: ematch: reject invalid TCF_EM_SIMPLE Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 036/110] net_sched: fix ops->bind_class() implementations Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 037/110] net_sched: walk through all child classes in tc_bind_tclass() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 038/110] net: socionext: fix possible user-after-free in netsec_process_rx Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 039/110] net: socionext: fix xdp_result initialization " Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 040/110] udp: segment looped gso packets correctly Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 041/110] mlxsw: minimal: Fix an error handling path in mlxsw_m_port_create() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 042/110] net: include struct nhmsg size in nh nlmsg size Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 043/110] rxrpc: Fix use-after-free in rxrpc_receive_data() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 044/110] HID: multitouch: Add LG MELF0410 I2C touchscreen support Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 045/110] arc: eznps: fix allmodconfig kconfig warning Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 046/110] HID: Add quirk for Xin-Mo Dual Controller Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 047/110] HID: ite: Add USB id match for Acer SW5-012 keyboard dock Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 048/110] HID: asus: Ignore Asus vendor-page usage-code 0xff events Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 049/110] HID: Add quirk for incorrect input length on Lenovo Y720 Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 050/110] HID: intel-ish-hid: ipc: add CMP device id Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 051/110] HID: wacom: Recognize new MobileStudio Pro PID Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 052/110] ASoC: SOF: fix fault at driver unload after failed probe Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 053/110] ASoC: SOF: Intel: hda: hda-dai: fix oops on hda_link .hw_free Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 054/110] drivers/hid/hid-multitouch.c: fix a possible null pointer access Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 055/110] phy: qcom-qmp: Increase PHY ready timeout Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 056/110] ASoC: fsl_audmix: add missed pm_runtime_disable Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 057/110] ASoC: topology: Prevent use-after-free in snd_soc_get_pcm_runtime() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 058/110] phy: cpcap-usb: Prevent USB line glitches from waking up modem Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 059/110] HID: intel-ish-hid: ipc: Add Tiger Lake PCI device ID Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 060/110] watchdog: max77620_wdt: fix potential build errors Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 061/110] watchdog: rn5t618_wdt: fix module aliases Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 062/110] watchdog: orion: fix platform_get_irq() complaints Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 063/110] usb: musb: jz4740: Silence error if code is -EPROBE_DEFER Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 064/110] can: tcan4x5x: tcan4x5x_parse_config(): reset device before register access Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 065/110] spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 066/110] net: Google gve: Remove dma_wmb() before ringing doorbell Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 067/110] drivers/net/b44: Change to non-atomic bit operations on pwol_mask Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 068/110] net: wan: sdla: Fix cast from pointer to integer of different size Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 069/110] gpio: max77620: Add missing dependency on GPIOLIB_IRQCHIP Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 070/110] iommu/dma: fix variable cookie set but not used Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 071/110] drm/amd/display: Reduce HDMI pixel encoding if max clock is exceeded Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 072/110] stmmac: debugfs entry name is not be changed when udev rename device name Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 073/110] atm: eni: fix uninitialized variable warning Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 074/110] HID: steam: Fix input device disappearing Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 075/110] extcon-intel-cht-wc: Dont reset USB data connection at probe Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 076/110] ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0 Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 077/110] drm/amdgpu/SRIOV: add navi12 pci id for SRIOV (v2) Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 078/110] libbpf: Fix BTF-defined maps __type macro handling of arrays Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 079/110] staging: mt7621-pci: add quirks for E2 revision using soc_device_attribute Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 080/110] platform/x86: dell-laptop: disable kbd backlight on Inspiron 10xx Greg Kroah-Hartman
2020-01-30 18:38 ` Greg Kroah-Hartman [this message]
2020-01-30 18:38 ` [PATCH 5.4 082/110] media: dvbsky: add support for eyeTV Geniatech T2 lite Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 083/110] bus: ti-sysc: Handle mstandby quirk and use it for musb Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 084/110] bus: ti-sysc: Use swsup quirks also for am335x musb Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 085/110] spi: pxa2xx: Add support for Intel Comet Lake-H Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 086/110] iommu/amd: Support multiple PCI DMA aliases in device table Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 087/110] iommu/amd: Support multiple PCI DMA aliases in IRQ Remapping Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 088/110] perf/imx_ddr: Add enhanced AXI ID filter support Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 089/110] mfd: intel-lpss: Add Intel Comet Lake PCH-H PCI IDs Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 090/110] ARM: config: aspeed-g5: Enable 8250_DW quirks Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 091/110] ARM: OMAP2+: SmartReflex: add omap_sr_pdata definition Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 092/110] mmc: sdhci-pci: Quirk for AMD SDHC Device 0x7906 Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 093/110] mmc: sdhci-pci: Add support for Intel JSL Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 094/110] bus: ti-sysc: Add module enable quirk for audio AESS Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 095/110] usb-storage: Disable UAS on JMicron SATA enclosure Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 096/110] ALSA: hda/realtek - Move some alc236 pintbls to fallback table Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 097/110] Bluetooth: Allow combination of BDADDR_PROPERTY and INVALID_BDADDR quirks Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 098/110] Bluetooth: btbcm: Use the BDADDR_PROPERTY quirk Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 099/110] bus: ti-sysc: Fix missing force mstandby quirk handling Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 100/110] rsi: fix use-after-free on failed probe and unbind Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 101/110] rsi: fix use-after-free on probe errors Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 102/110] rsi: fix memory leak on failed URB submission Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 103/110] rsi: fix non-atomic allocation in completion handler Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 104/110] crypto: af_alg - Use bh_lock_sock in sk_destruct Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 105/110] crypto: vmx - reject xts inputs that are too short Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 106/110] crypto: caam - do not reset pointer size from MCFGR register Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 107/110] crypto: pcrypt - Fix user-after-free on module unload Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 108/110] KVM: arm64: Write arch.mdcr_el2 changes since last vcpu_load on VHE Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 109/110] Revert "um: Enable CONFIG_CONSTRUCTORS" Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 110/110] power/supply: ingenic-battery: Dont change scale if theres only one Greg Kroah-Hartman
2020-01-31  4:39 ` [PATCH 5.4 000/110] 5.4.17-stable review shuah
2020-01-31 11:03 ` Jon Hunter
2020-01-31 14:42 ` Naresh Kamboju
2020-01-31 17:32 ` Guenter Roeck
2020-01-31 19:44 ` Jeffrin Jose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200130183623.811457664@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=przemyslawx.kitszel@intel.com \
    --cc=sashal@kernel.org \
    --cc=slawomir.pawlowski@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).