mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Fei Yu <fei.yu@intel.com>
Cc: Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org,
	Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Dave Jiang <dave.jiang@intel.com>, Frank Li <Frank.Li@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dmaengine: idxd: Keep wqs dedicated without shared wq support
Date: Mon, 30 Nov 2026 18:30:21 +0200	[thread overview]
Message-ID: <aw2knQ777kl3lsnN@ashevche-desk.local> (raw)
In-Reply-To: <20261130071338.3120264-2-fei.yu@intel.com>

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



  reply	other threads:[~2026-11-30 16:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  7:13 [PATCH 0/2] dmaengine: idxd: No shared wqs " Fei Yu
2026-11-30  7:13 ` [PATCH 1/2] dmaengine: idxd: Keep wqs dedicated " Fei Yu
2026-11-30 16:30   ` Andy Shevchenko [this message]
2026-11-30  7:13 ` [PATCH 2/2] dmaengine: idxd: Reject shared wq mode " Fei Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aw2knQ777kl3lsnN@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=Frank.Li@kernel.org \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fei.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinicius.gomes@intel.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®