/* * Copyright (c) 2014-2016, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. */ #include "test/nfit_test.h" #include #include #include long pmem_direct_access(struct block_device *bdev, sector_t sector, void **kaddr, pfn_t *pfn, long size) { struct pmem_device *pmem = bdev->bd_queue->queuedata; resource_size_t offset = sector * 512 + pmem->data_offset; if (unlikely(is_bad_pmem(&pmem->bb, sector, size))) return -EIO; /* * Limit dax to a single page at a time given vmalloc()-backed * in the nfit_test case. */ if (get_nfit_res(pmem->phys_addr + offset)) { struct page *page; *kaddr = pmem->virt_addr + offset; page = vmalloc_to_page(pmem->virt_addr + offset); *pfn = page_to_pfn_t(page); dev_dbg_ratelimited(disk_to_dev(bdev->bd_disk)->parent, "%s: sector: %#llx pfn: %#lx\n", __func__, (unsigned long long) sector, page_to_pfn(page)); return PAGE_SIZE; } *kaddr = pmem->virt_addr + offset; *pfn = phys_to_pfn_t(pmem->phys_addr + offset, pmem->pfn_flags); /* * If badblocks are present, limit known good range to the * requested range. */ if (unlikely(pmem->bb.count)) return size; return pmem->size - pmem->pfn_pad - offset; } href='/cgit.cgi/linux/net-next.git/refs/?h=nds-private-remove&id=6ea17ed15d9a343c2d17d76b99501fcad204f309'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-08 11:22:00 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-08 11:22:00 -0800
commit6ea17ed15d9a343c2d17d76b99501fcad204f309 (patch)
tree17a8ce6b61906d57a79e20639bc6330d0b805cc6 /include/uapi
parentea07b862ac8ef9b8c8358517d2e39f847dda6659 (diff)
parent01d0f715869161dc70e2bf66fcdf6533a6a782cd (diff)
Merge tag 'staging-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO fixes from Greg KH: "Here are some staging and IIO driver fixes for 4.10-rc3. Most of these are minor IIO fixes of reported issues, along with one network driver fix to resolve an issue. And a MAINTAINERS update with a new mailing list. All of these, except the MAINTAINERS file update, have been in linux-next with no reported issues (the MAINTAINERS patch happened on Friday...)" * tag 'staging-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: MAINTAINERS: add greybus subsystem mailing list staging: octeon: Call SET_NETDEV_DEV() iio: accel: st_accel: fix LIS3LV02 reading and scaling iio: common: st_sensors: fix channel data parsing iio: max44000: correct value in illuminance_integration_time_available iio: adc: TI_AM335X_ADC should depend on HAS_DMA iio: bmi160: Fix time needed to sleep after command execution iio: 104-quad-8: Fix active level mismatch for the preset enable option iio: 104-quad-8: Fix off-by-one errors when addressing IOR iio: 104-quad-8: Fix index control configuration
Diffstat (limited to 'include/uapi')