.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * ps3vram - Use extra PS3 video ram as block device. |
---|
3 | 4 | * |
---|
.. | .. |
---|
88 | 89 | |
---|
89 | 90 | |
---|
90 | 91 | static int ps3vram_major; |
---|
91 | | - |
---|
92 | | - |
---|
93 | | -static const struct block_device_operations ps3vram_fops = { |
---|
94 | | - .owner = THIS_MODULE, |
---|
95 | | -}; |
---|
96 | | - |
---|
97 | 92 | |
---|
98 | 93 | #define DMA_NOTIFIER_HANDLE_BASE 0x66604200 /* first DMA notifier handle */ |
---|
99 | 94 | #define DMA_NOTIFIER_OFFSET_BASE 0x1000 /* first DMA notifier offset */ |
---|
.. | .. |
---|
584 | 579 | return next; |
---|
585 | 580 | } |
---|
586 | 581 | |
---|
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) |
---|
588 | 583 | { |
---|
589 | | - struct ps3_system_bus_device *dev = q->queuedata; |
---|
| 584 | + struct ps3_system_bus_device *dev = bio->bi_disk->private_data; |
---|
590 | 585 | struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); |
---|
591 | 586 | int busy; |
---|
592 | 587 | |
---|
593 | 588 | dev_dbg(&dev->core, "%s\n", __func__); |
---|
594 | 589 | |
---|
595 | | - blk_queue_split(q, &bio); |
---|
| 590 | + blk_queue_split(&bio); |
---|
596 | 591 | |
---|
597 | 592 | spin_lock_irq(&priv->lock); |
---|
598 | 593 | busy = !bio_list_empty(&priv->list); |
---|
.. | .. |
---|
608 | 603 | |
---|
609 | 604 | return BLK_QC_T_NONE; |
---|
610 | 605 | } |
---|
| 606 | + |
---|
| 607 | +static const struct block_device_operations ps3vram_fops = { |
---|
| 608 | + .owner = THIS_MODULE, |
---|
| 609 | + .submit_bio = ps3vram_submit_bio, |
---|
| 610 | +}; |
---|
611 | 611 | |
---|
612 | 612 | static int ps3vram_probe(struct ps3_system_bus_device *dev) |
---|
613 | 613 | { |
---|
.. | .. |
---|
736 | 736 | |
---|
737 | 737 | ps3vram_proc_init(dev); |
---|
738 | 738 | |
---|
739 | | - queue = blk_alloc_queue(GFP_KERNEL); |
---|
| 739 | + queue = blk_alloc_queue(NUMA_NO_NODE); |
---|
740 | 740 | if (!queue) { |
---|
741 | 741 | dev_err(&dev->core, "blk_alloc_queue failed\n"); |
---|
742 | 742 | error = -ENOMEM; |
---|
.. | .. |
---|
744 | 744 | } |
---|
745 | 745 | |
---|
746 | 746 | priv->queue = queue; |
---|
747 | | - queue->queuedata = dev; |
---|
748 | | - blk_queue_make_request(queue, ps3vram_make_request); |
---|
749 | 747 | blk_queue_max_segments(queue, BLK_MAX_SEGMENTS); |
---|
750 | 748 | blk_queue_max_segment_size(queue, BLK_MAX_SEGMENT_SIZE); |
---|
751 | 749 | blk_queue_max_hw_sectors(queue, BLK_SAFE_MAX_SECTORS); |
---|
.. | .. |
---|
766 | 764 | strlcpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name)); |
---|
767 | 765 | set_capacity(gendisk, priv->size >> 9); |
---|
768 | 766 | |
---|
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", |
---|
770 | 768 | gendisk->disk_name, get_capacity(gendisk) >> 11); |
---|
771 | 769 | |
---|
772 | | - device_add_disk(&dev->core, gendisk); |
---|
| 770 | + device_add_disk(&dev->core, gendisk, NULL); |
---|
773 | 771 | return 0; |
---|
774 | 772 | |
---|
775 | 773 | fail_cleanup_queue: |
---|