init.c (a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0) init.c (1b11b4ef6bd68591dcaf8423c7d05e794e6aec6f)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Intel I/OAT DMA Linux driver
4 * Copyright(c) 2004 - 2015 Intel Corporation.
5 */
6
7#include <linux/init.h>
8#include <linux/module.h>

--- 1336 unchanged lines hidden (view full) ---

1345 return d;
1346}
1347
1348static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1349{
1350 void __iomem * const *iomap;
1351 struct device *dev = &pdev->dev;
1352 struct ioatdma_device *device;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Intel I/OAT DMA Linux driver
4 * Copyright(c) 2004 - 2015 Intel Corporation.
5 */
6
7#include <linux/init.h>
8#include <linux/module.h>

--- 1336 unchanged lines hidden (view full) ---

1345 return d;
1346}
1347
1348static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1349{
1350 void __iomem * const *iomap;
1351 struct device *dev = &pdev->dev;
1352 struct ioatdma_device *device;
1353 u8 version;
1353 int err;
1354
1355 err = pcim_enable_device(pdev);
1356 if (err)
1357 return err;
1358
1359 err = pcim_iomap_regions(pdev, 1 << IOAT_MMIO_BAR, DRV_NAME);
1360 if (err)
1361 return err;
1362 iomap = pcim_iomap_table(pdev);
1363 if (!iomap)
1364 return -ENOMEM;
1365
1354 int err;
1355
1356 err = pcim_enable_device(pdev);
1357 if (err)
1358 return err;
1359
1360 err = pcim_iomap_regions(pdev, 1 << IOAT_MMIO_BAR, DRV_NAME);
1361 if (err)
1362 return err;
1363 iomap = pcim_iomap_table(pdev);
1364 if (!iomap)
1365 return -ENOMEM;
1366
1367 version = readb(iomap[IOAT_MMIO_BAR] + IOAT_VER_OFFSET);
1368 if (version < IOAT_VER_3_0)
1369 return -ENODEV;
1370
1366 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
1367 if (err)
1368 return err;
1369
1370 device = alloc_ioatdma(pdev, iomap[IOAT_MMIO_BAR]);
1371 if (!device)
1372 return -ENOMEM;
1373 pci_set_master(pdev);
1374 pci_set_drvdata(pdev, device);
1375
1371 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
1372 if (err)
1373 return err;
1374
1375 device = alloc_ioatdma(pdev, iomap[IOAT_MMIO_BAR]);
1376 if (!device)
1377 return -ENOMEM;
1378 pci_set_master(pdev);
1379 pci_set_drvdata(pdev, device);
1380
1376 device->version = readb(device->reg_base + IOAT_VER_OFFSET);
1381 device->version = version;
1377 if (device->version >= IOAT_VER_3_4)
1378 ioat_dca_enabled = 0;
1382 if (device->version >= IOAT_VER_3_4)
1383 ioat_dca_enabled = 0;
1379 if (device->version >= IOAT_VER_3_0) {
1380 if (is_skx_ioat(pdev))
1381 device->version = IOAT_VER_3_2;
1382 err = ioat3_dma_probe(device, ioat_dca_enabled);
1383 } else
1384 return -ENODEV;
1385
1384
1385 if (is_skx_ioat(pdev))
1386 device->version = IOAT_VER_3_2;
1387
1388 err = ioat3_dma_probe(device, ioat_dca_enabled);
1386 if (err) {
1387 dev_err(dev, "Intel(R) I/OAT DMA Engine init failed\n");
1388 return -ENODEV;
1389 }
1390
1391 return 0;
1392}
1393

--- 57 unchanged lines hidden ---
1389 if (err) {
1390 dev_err(dev, "Intel(R) I/OAT DMA Engine init failed\n");
1391 return -ENODEV;
1392 }
1393
1394 return 0;
1395}
1396

--- 57 unchanged lines hidden ---