Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp934367pxb; Wed, 6 Apr 2022 04:44:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMBn7SjkfHllXCQ1mNhepaRrARW15sJnemu88Ygi+cEtX/tXndA7xpn1xN176onbxiyJPm X-Received: by 2002:a17:902:7296:b0:151:62b1:e2b0 with SMTP id d22-20020a170902729600b0015162b1e2b0mr8087802pll.165.1649245461395; Wed, 06 Apr 2022 04:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649245461; cv=none; d=google.com; s=arc-20160816; b=0SYdpg0jX0hnmC/BtqMc9YQ//vNUB9ini0OHXEo0XbtlDBhKMcNpi/cmnAs3wcAPTJ O1FbyBYZZSozrs6GYYsnQnN3xZJ4mtU7V0YmGslWo2L47Fo5klOQoa9XrB9xh+5rU5o+ VaUkuIJRYFSRo7SEvOvmjFU/vs19GVJ2Y1igVnO2I2J3nOmTqmy/fkA/4tktiFL5+I/K yTYXrYhS//kzHLdUwzXfZDEHRN0zRRG3GM7jc24QjDXilPQPBPick2pGGp3N59Kl9Ru9 BPqMZ7J2rNwWl13NnNnrYdSA0ZKOH19GAAtvANA4n6kvL3vXBsd8WbPsU6QDIcFpOa38 iusg== 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=3HlhhsoXcgI6PPLKo5BGl9JfkQIfAb1f7dii8VY1G/8=; b=u8LugJxoLKSA10C/zfAfVWL4zTOQzGqWGZ60H6cE/UpRopTXJbsbeZwGGr9Ir6P3M8 oCjTua0Z3KXbGLxgDziyFFEi7ly09r0+foeiKDVnQmwaWQRS0H1PeWyLejKbmkOUhroZ HbzAz7SzGBtdRz6TxPLSe0EsgmHShFL5iO8kI/0LFtLk+dNfquQGgfn6Uq/HQTVhVvYA Vh+67L80VXYIIt6exJdVe7g0OSn953SGnlzf8EOJ1mvIn3H+U1QKPeO4XmQeyFyxoB68 A/nkNRcuHZuSjjRQ2OjG5FAd8MiD2ZVl3hnnxMGdJjoWH3ojuF8F5/OE2iZw32gzM7Jq qPRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nSh0bQ6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pf7-20020a17090b1d8700b001c6cf2d1b0csi4697521pjb.126.2022.04.06.04.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nSh0bQ6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CF8AC399CAE; Wed, 6 Apr 2022 03:01:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242783AbiDEWmU (ORCPT + 99 others); Tue, 5 Apr 2022 18:42:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349420AbiDEJtu (ORCPT ); Tue, 5 Apr 2022 05:49:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F1581EAE0; Tue, 5 Apr 2022 02:45:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3CB6861368; Tue, 5 Apr 2022 09:45:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49882C385A2; Tue, 5 Apr 2022 09:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151917; bh=qSaTGiySKFFr1e9/bvAwdPYGh0SluH4gytxj95+oIgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nSh0bQ6NThfBZKRfitK4wpGPJeRtfe4vkmjCaftcYM2y/KL7is/AoP2QhnEGgRb9R EQBvE+yKi3yIu8A4nxeCnflA8kRcJX6N1wz0rh/QKAJPfMWQbCKUx36gmaEDefC9rl NYpRca7tG7yIY32TGa+eZca0CKn9zpxzDac0+srk= 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.15 589/913] dmaengine: idxd: check GENCAP config support for gencfg register Date: Tue, 5 Apr 2022 09:27:31 +0200 Message-Id: <20220405070357.499184808@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Jiang [ Upstream commit 79c4c3db7d86b9bec94562275efc82e58f3d0132 ] DSA spec 1.2 has moved the GENCFG register under the GENCAP configuration support with respect to writability. Add check in driver before writing to GENCFG register. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163406171896.1303830.11217958011385656998.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/idxd/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c index b468ca36d3a0..3cda1c5faf3c 100644 --- a/drivers/dma/idxd/device.c +++ b/drivers/dma/idxd/device.c @@ -801,7 +801,7 @@ static int idxd_groups_config_write(struct idxd_device *idxd) struct device *dev = &idxd->pdev->dev; /* Setup bandwidth token limit */ - if (idxd->token_limit) { + if (idxd->hw.gen_cap.config_en && idxd->token_limit) { reg.bits = ioread32(idxd->reg_base + IDXD_GENCFG_OFFSET); reg.token_limit = idxd->token_limit; iowrite32(reg.bits, idxd->reg_base + IDXD_GENCFG_OFFSET); -- 2.34.1