hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/block/ps3vram.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ps3vram - Use extra PS3 video ram as block device.
34 *
....@@ -88,12 +89,6 @@
8889
8990
9091 static int ps3vram_major;
91
-
92
-
93
-static const struct block_device_operations ps3vram_fops = {
94
- .owner = THIS_MODULE,
95
-};
96
-
9792
9893 #define DMA_NOTIFIER_HANDLE_BASE 0x66604200 /* first DMA notifier handle */
9994 #define DMA_NOTIFIER_OFFSET_BASE 0x1000 /* first DMA notifier offset */
....@@ -584,15 +579,15 @@
584579 return next;
585580 }
586581
587
-static blk_qc_t ps3vram_make_request(struct request_queue *q, struct bio *bio)
582
+static blk_qc_t ps3vram_submit_bio(struct bio *bio)
588583 {
589
- struct ps3_system_bus_device *dev = q->queuedata;
584
+ struct ps3_system_bus_device *dev = bio->bi_disk->private_data;
590585 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
591586 int busy;
592587
593588 dev_dbg(&dev->core, "%s\n", __func__);
594589
595
- blk_queue_split(q, &bio);
590
+ blk_queue_split(&bio);
596591
597592 spin_lock_irq(&priv->lock);
598593 busy = !bio_list_empty(&priv->list);
....@@ -608,6 +603,11 @@
608603
609604 return BLK_QC_T_NONE;
610605 }
606
+
607
+static const struct block_device_operations ps3vram_fops = {
608
+ .owner = THIS_MODULE,
609
+ .submit_bio = ps3vram_submit_bio,
610
+};
611611
612612 static int ps3vram_probe(struct ps3_system_bus_device *dev)
613613 {
....@@ -736,7 +736,7 @@
736736
737737 ps3vram_proc_init(dev);
738738
739
- queue = blk_alloc_queue(GFP_KERNEL);
739
+ queue = blk_alloc_queue(NUMA_NO_NODE);
740740 if (!queue) {
741741 dev_err(&dev->core, "blk_alloc_queue failed\n");
742742 error = -ENOMEM;
....@@ -744,8 +744,6 @@
744744 }
745745
746746 priv->queue = queue;
747
- queue->queuedata = dev;
748
- blk_queue_make_request(queue, ps3vram_make_request);
749747 blk_queue_max_segments(queue, BLK_MAX_SEGMENTS);
750748 blk_queue_max_segment_size(queue, BLK_MAX_SEGMENT_SIZE);
751749 blk_queue_max_hw_sectors(queue, BLK_SAFE_MAX_SECTORS);
....@@ -766,10 +764,10 @@
766764 strlcpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name));
767765 set_capacity(gendisk, priv->size >> 9);
768766
769
- dev_info(&dev->core, "%s: Using %lu MiB of GPU memory\n",
767
+ dev_info(&dev->core, "%s: Using %llu MiB of GPU memory\n",
770768 gendisk->disk_name, get_capacity(gendisk) >> 11);
771769
772
- device_add_disk(&dev->core, gendisk);
770
+ device_add_disk(&dev->core, gendisk, NULL);
773771 return 0;
774772
775773 fail_cleanup_queue: