hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/scsi/mesh.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * SCSI low-level driver for the MESH (Macintosh Enhanced SCSI Hardware)
34 * bus adaptor found on Power Macintosh computers.
....@@ -30,9 +31,9 @@
3031 #include <linux/reboot.h>
3132 #include <linux/spinlock.h>
3233 #include <linux/pci.h>
34
+#include <linux/pgtable.h>
3335 #include <asm/dbdma.h>
3436 #include <asm/io.h>
35
-#include <asm/pgtable.h>
3637 #include <asm/prom.h>
3738 #include <asm/irq.h>
3839 #include <asm/hydra.h>
....@@ -1456,7 +1457,7 @@
14561457 /* huh? we expected a phase mismatch */
14571458 ms->n_msgin = 0;
14581459 ms->msgphase = msg_in;
1459
- /* fall through */
1460
+ fallthrough;
14601461
14611462 case msg_in:
14621463 /* should have some message bytes in fifo */
....@@ -1844,7 +1845,7 @@
18441845 .this_id = 7,
18451846 .sg_tablesize = SG_ALL,
18461847 .cmd_per_lun = 2,
1847
- .use_clustering = DISABLE_CLUSTERING,
1848
+ .max_segment_size = 65535,
18481849 };
18491850
18501851 static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
....@@ -1921,8 +1922,9 @@
19211922 /* We use the PCI APIs for now until the generic one gets fixed
19221923 * enough or until we get some macio-specific versions
19231924 */
1924
- dma_cmd_space = pci_zalloc_consistent(macio_get_pci_dev(mdev),
1925
- ms->dma_cmd_size, &dma_cmd_bus);
1925
+ dma_cmd_space = dma_alloc_coherent(&macio_get_pci_dev(mdev)->dev,
1926
+ ms->dma_cmd_size, &dma_cmd_bus,
1927
+ GFP_KERNEL);
19261928 if (dma_cmd_space == NULL) {
19271929 printk(KERN_ERR "mesh: can't allocate DMA table\n");
19281930 goto out_unmap;
....@@ -1980,7 +1982,7 @@
19801982 */
19811983 mesh_shutdown(mdev);
19821984 set_mesh_power(ms, 0);
1983
- pci_free_consistent(macio_get_pci_dev(mdev), ms->dma_cmd_size,
1985
+ dma_free_coherent(&macio_get_pci_dev(mdev)->dev, ms->dma_cmd_size,
19841986 ms->dma_cmd_space, ms->dma_cmd_bus);
19851987 out_unmap:
19861988 iounmap(ms->dma);
....@@ -2013,7 +2015,7 @@
20132015 iounmap(ms->dma);
20142016
20152017 /* Free DMA commands memory */
2016
- pci_free_consistent(macio_get_pci_dev(mdev), ms->dma_cmd_size,
2018
+ dma_free_coherent(&macio_get_pci_dev(mdev)->dev, ms->dma_cmd_size,
20172019 ms->dma_cmd_space, ms->dma_cmd_bus);
20182020
20192021 /* Release memory resources */