Lines Matching +full:suspend +full:- +full:to +full:- +full:disk
1 // SPDX-License-Identifier: GPL-2.0
3 * Xpram.c -- the S/390 expanded memory RAM-disk
14 * Interfaces to linux kernel
20 * "ad-hoc" partitioning:
26 * generic hard disk support to replace ad-hoc partitioning
42 #include <linux/suspend.h>
88 * -EIO: if pgin failed
89 * -ENXIO: if xpram has vanished
103 return -ENXIO; in xpram_page_in()
105 return -ENXIO; in xpram_page_in()
107 return -EIO; in xpram_page_in()
112 * Copy a 4kB page of main memory to an expanded memory page
118 * -EIO: if pgout failed
119 * -ENXIO: if xpram has vanished
133 return -ENXIO; in xpram_page_out()
135 return -ENXIO; in xpram_page_out()
137 return -EIO; in xpram_page_out()
151 return -ENOMEM; in xpram_present()
154 return rc ? -ENXIO : 0; in xpram_present()
170 add_bit = 1ULL << (sizeof(unsigned int)*8 - 1); in xpram_highest_page_index()
187 xpram_device_t *xdev = bio->bi_disk->private_data; in xpram_submit_bio()
196 if ((bio->bi_iter.bi_sector & 7) != 0 || in xpram_submit_bio()
197 (bio->bi_iter.bi_size & 4095) != 0) in xpram_submit_bio()
198 /* Request is not page-aligned. */ in xpram_submit_bio()
200 if ((bio->bi_iter.bi_size >> 12) > xdev->size) in xpram_submit_bio()
201 /* Request size is no page-aligned. */ in xpram_submit_bio()
203 if ((bio->bi_iter.bi_sector >> 3) > 0xffffffffU - xdev->offset) in xpram_submit_bio()
205 index = (bio->bi_iter.bi_sector >> 3) + xdev->offset; in xpram_submit_bio()
222 bytes -= 4096; in xpram_submit_bio()
238 * get geometry: we have to fake one... trim the size to a in xpram_getgeo()
243 geo->cylinders = size >> 6; in xpram_getgeo()
244 geo->heads = 4; in xpram_getgeo()
245 geo->sectors = 16; in xpram_getgeo()
246 geo->start = 4; in xpram_getgeo()
272 return -EINVAL; in xpram_setup_sizes()
277 * Copy sizes array to xpram_sizes and align partition in xpram_setup_sizes()
278 * sizes to page boundary. in xpram_setup_sizes()
294 xpram_sizes[i] = (size + 3) & -4UL; in xpram_setup_sizes()
308 pr_info(" size of partition %d to be set " in xpram_setup_sizes()
313 pr_info(" partitions to be sized automatically: %d\n", in xpram_setup_sizes()
318 return -EINVAL; in xpram_setup_sizes()
328 mem_auto = ((pages - mem_needed / 4) / mem_auto_no) * 4; in xpram_setup_sizes()
341 int i, rc = -ENOMEM; in xpram_setup_blkdev()
369 struct gendisk *disk = xpram_disks[i]; in xpram_setup_blkdev() local
374 disk->major = XPRAM_MAJOR; in xpram_setup_blkdev()
375 disk->first_minor = i; in xpram_setup_blkdev()
376 disk->fops = &xpram_devops; in xpram_setup_blkdev()
377 disk->private_data = &xpram_devices[i]; in xpram_setup_blkdev()
378 disk->queue = xpram_queues[i]; in xpram_setup_blkdev()
379 sprintf(disk->disk_name, "slram%d", i); in xpram_setup_blkdev()
380 set_capacity(disk, xpram_sizes[i] << 1); in xpram_setup_blkdev()
381 add_disk(disk); in xpram_setup_blkdev()
386 while (i--) { in xpram_setup_blkdev()
403 * Check if xpram setup changed between suspend and resume.
452 return -ENODEV; in xpram_init()
463 xpram_pdev = platform_device_register_simple(XPRAM_NAME, -1, NULL, 0); in xpram_init()