From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.20 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796056226; b=g0+unj4PngmW89Cwwq2X/siVYf5ViDYqsPYVJRrl3ObEnkJHAbbsns2+0rbT1rnVqQfx fQYgmNM8MzdWHry6G4Y97ZmFk4yjFZOIIwsWL8P+JmS48506kWR+fnLgXLoa1CUupOap1 VEYdWc7OzufN849ecBNLczbvkz99cXnKbVGz7nyXYJF+g0HrXJnnYXRfDcTEArc+l8qk8 3tdY4NM65qRWHwVCG4VFfpEXjMW6cSLnVrPMfeMqzupifA4hURA6GD1ed5XwgmW3InaHt mrvo9Fz6yhC/j187DPDIFQf/5pABhts7Llf7P3aBeUgjZ+7QWgWH5bN8Fqo9kCq2s1w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796056226; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=OzkVfPtNNZkDJfvwneVtpzJ4+KpX7lHOfpaAbhyEkBs=; b=4s9yy8WDrv+HMQUpcnUFixThzvD3vtP8cDM4SNC8BGnaHsDIxz0knzHC9EgxLOBPUar8 pxrzqM92lk22iP7awbTesME6SukrKBj4YwEdu07i/PLyNo0fK83YAhbS7vroAqxWI7nYQ 7zzAO5BsM+HAXIbGj7temz9jU0ZOfklbV+cISxKybM5j1+zXfuGOf87707hneFap33Wo/ RfjPmRy/ei9S5QNolP7fEOpYfFqmzqhwpoVC9kmFoYxXzHaQznZsz46TSxm8/0xo+oZIm BzPjLGswW17ILQ9vH5Jf81BUm+RFrM85XcQO/5k83VPqPYDsXilVKiWUk+LddbezR7w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ISs7znRr; arc=none smtp.remote-ip=198.175.65.20 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8DEA606A31C; Mon, 30 Nov 2026 16:30:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C8DEA606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ISs7znRr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796056226; x=1827592226; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OzkVfPtNNZkDJfvwneVtpzJ4+KpX7lHOfpaAbhyEkBs=; b=ISs7znRrQYoNGeZAIplGxmXtIfo3Te07SdsgPCj/zaOdPqbU9wuL6Kkr Cll3910stQAoa/V4d+Oi7mjWAILG0GkkbT+4+n+RF53qjuM7el8VZ1Cud wwbfZ3maanuujmvgLZxJ1Hb7tbq+6pQKPwqwJJWW0GO7t2ZPV2TwH7OdG qqYs6UtXEbNUNGm4U7qXLsIcPvm3EQLMkZLqbfzIP2bFyFkCMQ1mH9dNp Ad44010FM2ywbMb+OFiZ9u7uX3gkL9VCgQ+pUrIarklOaaFkFxJRpti9+ /7sHGSy/DM8By/E9An/deqEc4gPn44Hb0PODky2A/ku3k0O6k4gyin53S Q==; X-CSE-ConnectionGUID: F0Qe+58cRz63bPCLMnZzNA== X-CSE-MsgGUID: bUrH1K77R9a2rgG97ZNRbA== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4943002" X-IronPort-AV: E=Sophos;i="6.27,243,1787036400"; d="scan'208";a="4943002" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 08:30:26 -0800 X-CSE-ConnectionGUID: JPxGA4N2TsaXKKGfUYAzvQ== X-CSE-MsgGUID: 2TODzg8pQwCuMi25OU6RDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,243,1787036400"; d="scan'208";a="13212193" Received: from abityuts-desk1.ger.corp.intel.com (HELO localhost) ([10.245.244.117]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 08:30:23 -0800 Date: Mon, 30 Nov 2026 18:30:21 +0200 From: Andy Shevchenko To: Fei Yu Cc: Vinod Koul , dmaengine@vger.kernel.org, Vinicius Costa Gomes , Dave Jiang , Frank Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dmaengine: idxd: Keep wqs dedicated without shared wq support Message-ID: References: <20261130071338.3120264-1-fei.yu@intel.com> <20261130071338.3120264-2-fei.yu@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130071338.3120264-2-fei.yu@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Mon, Nov 30, 2026 at 03:13:37PM +0800, Fei Yu wrote: > A wq is shared unless WQ_FLAG_DEDICATED is set, and wq->flags starts > out as 0, so every wq is shared by default. That is also the case on > devices without shared wq support (no ENQCMD, or PASID not enabled), > where a shared wq is not a valid configuration. > > Since commit 0f225705cf65 ("dmaengine: idxd: fix wq settings post wq > disable"), disabling a wq keeps its size and group, because they can > only change while the device is disabled, but idxd_wq_disable_cleanup() > still clears wq->flags. The wq thus turns into a shared wq that is > still part of the device configuration. On a device without shared wq > support, the next device configuration, e.g. the restore after an FLR, > is rejected by idxd_wqs_setup() and the device halts. On the Nova Lake > IAA, after iaa_crypto releases its wq: > > idxd 0000:00:0c.0: No shared wq support but configured. > idxd 0000:00:0c.0: HALT: iax0 config fails > > On such devices, make dedicated the mode of a wq when it is set up and > after it is disabled: it is the only mode the wq can have there. The > check is device wide, as the wq type, which tells whether kernel or > user PASID applies, is not known at these points. Devices with shared > wq support keep the current behavior. ... > + /* > + * The wq keeps its size and group (see idxd_wq_device_reset_cleanup()), > + * so it stays part of the device configuration. Without shared wq > + * support, keep it dedicated: a shared wq would make the configuration > + * invalid, and the device would fail to be configured again, e.g. after > + * an FLR. > + */ > + if (!device_shared_wq_supported(idxd)) > + set_bit(WQ_FLAG_DEDICATED, &wq->flags); it's the same code that's used below. Can it be in a helper function? -- With Best Regards, Andy Shevchenko