mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
dmaengine: idxd: Separate user and kernel pasid enabling
The idxd driver always gated the pasid enabling under a single knob and this assumption is incorrect. The pasid used for kernel operation can be independently toggled and has no dependency on the user pasid (and vice versa). Split the two so they are independent "enabled" flags. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/165231431746.986466.5666862038354800551.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
@@ -966,7 +966,7 @@ static int idxd_wqs_setup(struct idxd_device *idxd)
|
||||
if (!wq->group)
|
||||
continue;
|
||||
|
||||
if (wq_shared(wq) && !device_swq_supported(idxd)) {
|
||||
if (wq_shared(wq) && !wq_shared_supported(wq)) {
|
||||
idxd->cmd_status = IDXD_SCMD_WQ_NO_SWQ_SUPPORT;
|
||||
dev_warn(dev, "No shared wq support but configured.\n");
|
||||
return -EINVAL;
|
||||
@@ -1264,7 +1264,7 @@ int drv_enable_wq(struct idxd_wq *wq)
|
||||
|
||||
/* Shared WQ checks */
|
||||
if (wq_shared(wq)) {
|
||||
if (!device_swq_supported(idxd)) {
|
||||
if (!wq_shared_supported(wq)) {
|
||||
idxd->cmd_status = IDXD_SCMD_WQ_NO_SVM;
|
||||
dev_dbg(dev, "PASID not enabled and shared wq.\n");
|
||||
goto err;
|
||||
@@ -1294,7 +1294,7 @@ int drv_enable_wq(struct idxd_wq *wq)
|
||||
if (test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) {
|
||||
int priv = 0;
|
||||
|
||||
if (device_pasid_enabled(idxd)) {
|
||||
if (wq_pasid_enabled(wq)) {
|
||||
if (is_idxd_wq_kernel(wq) || wq_shared(wq)) {
|
||||
u32 pasid = wq_dedicated(wq) ? idxd->pasid : 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user