Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4468318ioa; Wed, 27 Apr 2022 04:39:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2UynB3r/RK7Rl/m5n7eZcpyUoLdqym6yeUFggZjONT9LRZfIzgWZSW2U4F7Qw89x0j4yI X-Received: by 2002:a17:903:1105:b0:156:3e9d:bb7b with SMTP id n5-20020a170903110500b001563e9dbb7bmr27787137plh.136.1651059596806; Wed, 27 Apr 2022 04:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651059596; cv=none; d=google.com; s=arc-20160816; b=JtxB9XFqv6CKD1Of2pVD+xTi2bsQQ4ifpgxk+j5K+Sprjpcz7rx93ho/9r+xsVRiSs c5/emuUrqE+i0hEbscXxk0QhjzpU9rYK5J262DtP6D16oGpHY/hD9W93Kcgq7sdfiA+g 3RRP72jK/eDxyMAG0IGhr95qYSE/ZEvJzhkhpzuoEM818rpgnBauO3KvD6ACY2D7HU9v LSFIHSgo0TtCG0TNucVTEjuHv2f5+n/CF2o4AMpATExtWgngUDtp6gAxCzZRoz2+Q4z+ jBWdMx6p2/UldYUBmXSB+Qt89KzJuxB9b6Ha1aY3L91ivX3MXbANL2Gd5XcvFHYr1u9/ 9UxQ== 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=Qietey/wu6zboWyN5vB9oQbETmhVJYO+v4OwvBnTgX0=; b=duHJEA77doyFdVctEzgec0o74+IZ51RDLjh3gfdPJnQVxNaFgGnPr4/q7oG5oIl+Da TWy1Kd8REWgXobVh5D/IJzFrGiiv5QLzi8w0Cg8uNtWe5ugem6gMXAZhHLCY151MgXyk siyWAndat9rMGYGs3BJlXEKA9j1FRq6Qan9WfUDmSfZGTOYSu+vqoqnKZtMyEIEwTdFg 4K/NltZSdwNL0j3LaFp+4Ngg56FTD7dCUKqYLtW5O40BwJIf0+i+BEWDBl1OVzdVexdu P3u4DRIlMhr9JhBk8CLrXG3wtu8+FQRZCfF1Lx2gpjRvjeyb6ailIWFPkHlbVehZvPXU WkOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y8z+LpG0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id gw17-20020a17090b0a5100b001d931aa3f3fsi4709693pjb.184.2022.04.27.04.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:39:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y8z+LpG0; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 06A4A1DB06E; Wed, 27 Apr 2022 03:35:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346966AbiDZJJg (ORCPT + 99 others); Tue, 26 Apr 2022 05:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346485AbiDZIuG (ORCPT ); Tue, 26 Apr 2022 04:50:06 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD8D413C672; Tue, 26 Apr 2022 01:38:20 -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 sin.source.kernel.org (Postfix) with ESMTPS id 8CE1DCE1BB0; Tue, 26 Apr 2022 08:38:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70E90C385A4; Tue, 26 Apr 2022 08:38:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962296; bh=dI4Xk1fyAX6wbNw/beUqTsvwcMn0SxWUnzr0b0qBVtM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y8z+LpG0R84XoZqZ3oS40X7zCauD4FgqV+W77YpTXe8pigLPCWbqZyeANrkFJPKOK YvAnYOS92KmcnEaKKD/kll20eF3IJfIKiWZeOwgaSvlKd0SWnPDDdWNZjVztQPTCSz xipH3KIJTP/IN5vZozGraKFbjOEFVZqyk8GZxvVg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Zhu , Dave Jiang , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 050/124] dmaengine: idxd: skip clearing device context when device is read-only Date: Tue, 26 Apr 2022 10:20:51 +0200 Message-Id: <20220426081748.723423013@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@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.5 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 autolearn=unavailable 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 1cd8e751d96c43ece3f6842ac2244a37d9332c3a ] If the device shows up as read-only configuration, skip the clearing of the state as the context must be preserved for device re-enable after being disabled. Fixes: 0dcfe41e9a4c ("dmanegine: idxd: cleanup all device related bits after disabling device") Reported-by: Tony Zhu Tested-by: Tony Zhu Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164971479479.2200566.13980022473526292759.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/idxd/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c index a67bafc596b7..e622245c9380 100644 --- a/drivers/dma/idxd/device.c +++ b/drivers/dma/idxd/device.c @@ -730,6 +730,9 @@ static void idxd_device_wqs_clear_state(struct idxd_device *idxd) void idxd_device_clear_state(struct idxd_device *idxd) { + if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) + return; + idxd_groups_clear_state(idxd); idxd_engines_clear_state(idxd); idxd_device_wqs_clear_state(idxd); -- 2.35.1