forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/misc/cxl/vphb.c
....@@ -1,26 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * 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.
84 */
95
106 #include <linux/pci.h>
117 #include <misc/cxl.h>
128 #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
-}
249
2510 static int cxl_pci_probe_mode(struct pci_bus *bus)
2611 {
....@@ -54,8 +39,7 @@
5439 return false;
5540 }
5641
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;
5943
6044 /*
6145 * Allocate a context to do cxl things too. If we eventually do real
....@@ -166,7 +150,7 @@
166150
167151 out:
168152 cxl_afu_configured_put(afu);
169
- return rc ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
153
+ return rc ? PCIBIOS_DEVICE_NOT_FOUND : 0;
170154 }
171155
172156 static int cxl_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
....@@ -200,7 +184,7 @@
200184
201185 out:
202186 cxl_afu_configured_put(afu);
203
- return rc ? PCIBIOS_SET_FAILED : PCIBIOS_SUCCESSFUL;
187
+ return rc ? PCIBIOS_SET_FAILED : 0;
204188 }
205189
206190 static struct pci_ops cxl_pcie_pci_ops =
....@@ -220,7 +204,6 @@
220204 .reset_secondary_bus = cxl_pci_reset_secondary_bus,
221205 .setup_msi_irqs = cxl_setup_msi_irqs,
222206 .teardown_msi_irqs = cxl_teardown_msi_irqs,
223
- .dma_set_mask = cxl_dma_set_mask,
224207 };
225208
226209 int cxl_pci_vphb_add(struct cxl_afu *afu)