| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2014 IBM Corp. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or |
|---|
| 5 | | - * modify it under the terms of the GNU General Public License |
|---|
| 6 | | - * as published by the Free Software Foundation; either version |
|---|
| 7 | | - * 2 of the License, or (at your option) any later version. |
|---|
| 8 | 4 | */ |
|---|
| 9 | 5 | |
|---|
| 10 | 6 | #include <linux/pci.h> |
|---|
| 11 | 7 | #include <misc/cxl.h> |
|---|
| 12 | 8 | #include "cxl.h" |
|---|
| 13 | | - |
|---|
| 14 | | -static int cxl_dma_set_mask(struct pci_dev *pdev, u64 dma_mask) |
|---|
| 15 | | -{ |
|---|
| 16 | | - if (dma_mask < DMA_BIT_MASK(64)) { |
|---|
| 17 | | - pr_info("%s only 64bit DMA supported on CXL", __func__); |
|---|
| 18 | | - return -EIO; |
|---|
| 19 | | - } |
|---|
| 20 | | - |
|---|
| 21 | | - *(pdev->dev.dma_mask) = dma_mask; |
|---|
| 22 | | - return 0; |
|---|
| 23 | | -} |
|---|
| 24 | 9 | |
|---|
| 25 | 10 | static int cxl_pci_probe_mode(struct pci_bus *bus) |
|---|
| 26 | 11 | { |
|---|
| .. | .. |
|---|
| 54 | 39 | return false; |
|---|
| 55 | 40 | } |
|---|
| 56 | 41 | |
|---|
| 57 | | - set_dma_ops(&dev->dev, &dma_nommu_ops); |
|---|
| 58 | | - set_dma_offset(&dev->dev, PAGE_OFFSET); |
|---|
| 42 | + dev->dev.archdata.dma_offset = PAGE_OFFSET; |
|---|
| 59 | 43 | |
|---|
| 60 | 44 | /* |
|---|
| 61 | 45 | * Allocate a context to do cxl things too. If we eventually do real |
|---|
| .. | .. |
|---|
| 166 | 150 | |
|---|
| 167 | 151 | out: |
|---|
| 168 | 152 | cxl_afu_configured_put(afu); |
|---|
| 169 | | - return rc ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL; |
|---|
| 153 | + return rc ? PCIBIOS_DEVICE_NOT_FOUND : 0; |
|---|
| 170 | 154 | } |
|---|
| 171 | 155 | |
|---|
| 172 | 156 | static int cxl_pcie_write_config(struct pci_bus *bus, unsigned int devfn, |
|---|
| .. | .. |
|---|
| 200 | 184 | |
|---|
| 201 | 185 | out: |
|---|
| 202 | 186 | cxl_afu_configured_put(afu); |
|---|
| 203 | | - return rc ? PCIBIOS_SET_FAILED : PCIBIOS_SUCCESSFUL; |
|---|
| 187 | + return rc ? PCIBIOS_SET_FAILED : 0; |
|---|
| 204 | 188 | } |
|---|
| 205 | 189 | |
|---|
| 206 | 190 | static struct pci_ops cxl_pcie_pci_ops = |
|---|
| .. | .. |
|---|
| 220 | 204 | .reset_secondary_bus = cxl_pci_reset_secondary_bus, |
|---|
| 221 | 205 | .setup_msi_irqs = cxl_setup_msi_irqs, |
|---|
| 222 | 206 | .teardown_msi_irqs = cxl_teardown_msi_irqs, |
|---|
| 223 | | - .dma_set_mask = cxl_dma_set_mask, |
|---|
| 224 | 207 | }; |
|---|
| 225 | 208 | |
|---|
| 226 | 209 | int cxl_pci_vphb_add(struct cxl_afu *afu) |
|---|