Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2468721pxb; Mon, 19 Apr 2021 06:30:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOaI/ed4HAWulH4XsWNwrwYdhWOh/Lj/z8bj/Co5ByOTa3hjhCqLUhwebJClusZxNVBxYm X-Received: by 2002:aa7:de8b:: with SMTP id j11mr25836419edv.363.1618839057003; Mon, 19 Apr 2021 06:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618839056; cv=none; d=google.com; s=arc-20160816; b=miZzBxnj2G43flYJJydURQoktSUDZQAZddKZCKBz/xPrbBB0kY9Gctg7UV0YQ4iffd t/PSF9XCYYBfbylTveCPqUOCYDEnU9lAmflZxSjC6Kot9lduLfareuuqGStXQnKKt3Xf e+0vsDsSsY6sgD/9TncQSg65Uc3CyLCTxDt4TPI1N9xUWFF6CMsR+wBWfBTNN5xeZ/qR j5z0F1DcJ8emtoizs1AiUZIJ9qq9uTKd4/8zEStwhSgQ19T7FTZ72rp34SjYsFHRFXM4 rW2FyCNpvV31UmnpgRIQGQ/pxkGRBWQ8EqxJvF8V+Wb5Gy8Ulu8NiGTH9VW/buthkUFA zW5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ccuIYlkzO98D5F3bppJ+8JzzhZgBkY/slLRKyWmIZbE=; b=FXRvNmU1cXrRq+9JsRzu+qfpTBr5EdwYrsnnRZW77isvixeohoJshsCxc0ySr8umHi 9Pts6/fCEoEJgPpicNib5ulZ2prCaCf69u+bGRQpyJhUenftp4iZjyQTww0M2lvulcsC /LhVrxnghjURwlbIeLih8f6I+BaJdzx9hsjXr15HIKUWaZK8c7gneQt5L+FlKtRNpNJ7 c8TTADkVIc4mGJZgAWcQKLfqM9wzdkqaaPspY3N3Up+U4SsEaL9F6h+3X1ty6NgLSKGg QVypdo58Wf5CcN4BbGZ+ZiuZHpPBU83KH2Yg+rD55TwTQ6rp7z5G/5fdCa9qacXUZsnU OmyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CHqlqsag; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si12510742ejc.571.2021.04.19.06.30.32; Mon, 19 Apr 2021 06:30:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CHqlqsag; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241010AbhDSNZT (ORCPT + 99 others); Mon, 19 Apr 2021 09:25:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:55076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240064AbhDSNSw (ORCPT ); Mon, 19 Apr 2021 09:18:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DB306613DA; Mon, 19 Apr 2021 13:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838102; bh=sSGAmc6Zvs7js8q5Cf3tMvFCnq1syBouk8yfFuKKSpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CHqlqsagogYNX0gn1LjbI+sbtagF6MZOV3xaoUooSmKj7MyGe9aJnWf9KKZeE9H+O fQZL1qKsLKWKFa9wNfgMTs2+aHYwYqAsX0Mx3UvuaomZXEI8DTxBKTvYP2cAXSkHf3 /nKr6cH94SGasuxqS7ooZdHBi+TkU4/qKyFmVZgQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Jiang , Vinod Koul , Sasha Levin Subject: [PATCH 5.10 008/103] dmaengine: idxd: fix wq size store permission state Date: Mon, 19 Apr 2021 15:05:19 +0200 Message-Id: <20210419130528.081098620@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Jiang [ Upstream commit 0fff71c5a311e1264988179f7dcc217fda15fadd ] WQ size can only be changed when the device is disabled. Current code allows change when device is enabled but wq is disabled. Change the check to detect device state. Fixes: c52ca478233c ("dmaengine: idxd: add configuration component of driver") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/161782558755.107710.18138252584838406025.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/idxd/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index b3ab86ced355..ad46b3c648af 100644 --- a/drivers/dma/idxd/sysfs.c +++ b/drivers/dma/idxd/sysfs.c @@ -923,7 +923,7 @@ static ssize_t wq_size_store(struct device *dev, if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) return -EPERM; - if (wq->state != IDXD_WQ_DISABLED) + if (idxd->state == IDXD_DEV_ENABLED) return -EPERM; if (size + total_claimed_wq_size(idxd) - wq->size > idxd->max_wq_size) -- 2.30.2