summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/queue.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2017-05-19 15:37:30 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2017-06-20 10:30:26 +0200
commit0493f6fe5bdee8ac101a1a0c449971c2d4665e99 (patch)
treef863aaf707e68d23263634ec9246cb609c8e8a50 /drivers/mmc/core/queue.h
parent5ec1239694c74e8feebe967bf467081445622004 (diff)
mmc: block: Move boot partition locking into a driver op
This moves the boot partition lock command (issued from sysfs) into a custom block layer request, just like the ioctl()s, getting rid of yet another instance of mmc_get_card(). Since we now have two operations issuing special DRV_OP's, we rename the result variable ->drv_op_result. Tested by locking the boot partition from userspace: > cd /sys/devices/platform/soc/80114000.sdi4_per2/mmc_host/mmc3/ mmc3:0001/block/mmcblk3/mmcblk3boot0 > echo 1 > ro_lock_until_next_power_on [ 178.645324] mmcblk3boot1: Locking boot partition ro until next power on [ 178.652221] mmcblk3boot0: Locking boot partition ro until next power on Also tested this with a huge dd job in the background: it is now possible to lock the boot partitions on the card even under heavy I/O. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/queue.h')
-rw-r--r--drivers/mmc/core/queue.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h
index 1e6062eb3e07..361b46408e0f 100644
--- a/drivers/mmc/core/queue.h
+++ b/drivers/mmc/core/queue.h
@@ -35,9 +35,11 @@ struct mmc_blk_request {
/**
* enum mmc_drv_op - enumerates the operations in the mmc_queue_req
* @MMC_DRV_OP_IOCTL: ioctl operation
+ * @MMC_DRV_OP_BOOT_WP: write protect boot partitions
*/
enum mmc_drv_op {
MMC_DRV_OP_IOCTL,
+ MMC_DRV_OP_BOOT_WP,
};
struct mmc_queue_req {
@@ -48,7 +50,7 @@ struct mmc_queue_req {
unsigned int bounce_sg_len;
struct mmc_async_req areq;
enum mmc_drv_op drv_op;
- int ioc_result;
+ int drv_op_result;
struct mmc_blk_ioc_data **idata;
unsigned int ioc_count;
};