diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-05-18 11:29:34 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-06-20 10:30:18 +0200 |
commit | 614f0388f580c436d2cf6dc0855de91d13ddc23d (patch) | |
tree | a801cd76ab48b157727a47c0401158b7a39c03d7 /drivers/infiniband | |
parent | 829043c48e5d7169d45a04027a787b55133f4cf6 (diff) | |
download | linux-stable-614f0388f580c436d2cf6dc0855de91d13ddc23d.tar.gz linux-stable-614f0388f580c436d2cf6dc0855de91d13ddc23d.tar.bz2 linux-stable-614f0388f580c436d2cf6dc0855de91d13ddc23d.zip |
mmc: block: move single ioctl() commands to block requests
This wraps single ioctl() commands into block requests using
the custom block layer request types REQ_OP_DRV_IN and
REQ_OP_DRV_OUT.
By doing this we are loosening the grip on the big host lock,
since two calls to mmc_get_card()/mmc_put_card() are removed.
We are storing the ioctl() in/out argument as a pointer in
the per-request struct mmc_blk_request container. Since we
now let the block layer allocate this data, blk_get_request()
will allocate it for us and we can immediately dereference
it and use it to pass the argument into the block layer.
We refactor the if/else/if/else ladder in mmc_blk_issue_rq()
as part of the job, keeping some extra attention to the
case when a NULL req is passed into this function and
making that pipeline flush more explicit.
Tested on the ux500 with the userspace:
mmc extcsd read /dev/mmcblk3
resulting in a successful EXTCSD info dump back to the
console.
This commit fixes a starvation issue in the MMC/SD stack
that can be easily provoked in the following way by
issueing the following commands in sequence:
> dd if=/dev/mmcblk3 of=/dev/null bs=1M &
> mmc extcs read /dev/mmcblk3
Before this patch, the extcsd read command would hang
(starve) while waiting for the dd command to finish since
the block layer was holding the card/host lock.
After this patch, the extcsd ioctl() command is nicely
interpersed with the rest of the block commands and we
can issue a bunch of ioctl()s from userspace while there
is some busy block IO going on without any problems.
Conversely userspace ioctl()s can no longer starve
the block layer by holding the card/host lock.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Avri Altman <Avri.Altman@sandisk.com>
Diffstat (limited to 'drivers/infiniband')
0 files changed, 0 insertions, 0 deletions