diff options
author | Dave Jiang <dave.jiang@intel.com> | 2020-02-18 17:51:58 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-02-19 10:18:46 +0100 |
commit | 2d0b1919457ad78036f24169968cadc6f55d37ec (patch) | |
tree | b151bc147a541025f702b18e27bd5f3c5861eb02 /drivers | |
parent | dmaengine: ti: k3-udma: Fix terminated transfer handling (diff) | |
download | linux-2d0b1919457ad78036f24169968cadc6f55d37ec.tar.xz linux-2d0b1919457ad78036f24169968cadc6f55d37ec.zip |
dmaengine: idxd: correct reserved token calculation
The calcuation for limit of reserved token did not take into account the
change the user wanted vs the current group reserved token. This causes
changing of the reserved token to be possible only after we set the value
of the reserved token back to 0. Fix calculation so we can set a value that
is non zero for reserved token.
Fixes: c52ca478233c ("dmaengine: idxd: add configuration component of driver")
Reported-by: Jerry Chen <jerry.t.chen@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/158204471889.37789.7749177228265869168.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/idxd/sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index 298855ca934f..edbfe83325eb 100644 --- a/drivers/dma/idxd/sysfs.c +++ b/drivers/dma/idxd/sysfs.c @@ -519,7 +519,7 @@ static ssize_t group_tokens_reserved_store(struct device *dev, if (val > idxd->max_tokens) return -EINVAL; - if (val > idxd->nr_tokens) + if (val > idxd->nr_tokens + group->tokens_reserved) return -EINVAL; group->tokens_reserved = val; |