Re: [PATCH 1/2] dmaengine: idxd: Keep wqs dedicated without shared wq support
From: Andy Shevchenko
Date: Mon Nov 30 2026 - 11:30:28 EST
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