We should return -EINVAL if cmd is not MMC_IOC_CMD or MMC_IOC_MULTI_CMD,
otherwise blkdev_roset will return -EPERM.
Android adb, make_block_device_writable ioctl BLKROSET will return error,
make adb remount with error:
remount of /system failed;
couldn't make block device writable: Operation not permitted
Change-Id: I7d0a5727110c0fd9ad301a377e5002eae23f8aed
Fixes: a5f5774c55a2 ("mmc: block: Add new ioctl to send multi commands")
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
static int mmc_blk_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
+#ifdef CONFIG_ARCH_ROCKCHIP
+ if (cmd != MMC_IOC_CMD && cmd != MMC_IOC_MULTI_CMD)
+ return -EINVAL;
+#endif
+
/*
* The caller must have CAP_SYS_RAWIO, and must be calling this on the
* whole block device, not on a partition. This prevents overspray