dmaengine: idxd: Enable Function Level Reset (FLR) for halt
authorFenghua Yu <fenghua.yu@intel.com>
Fri, 22 Nov 2024 23:30:28 +0000 (15:30 -0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 24 Dec 2024 10:38:05 +0000 (16:08 +0530)
commit98d187a989036096feaa2fef1ec3b2240ecdeacf
tree4d1b7d8dbe992f8c5ef15be0d05d1e11ba5f33be
parent3e114fa0fd1506c9e75aa0e2eb6a9050eb16b2f8
dmaengine: idxd: Enable Function Level Reset (FLR) for halt

When DSA/IAA device hits a fatal error, the device enters a halt state.
The driver can reset the device depending on Reset Type required by
hardware to recover the device.

Supported Reset Types are:
0: Reset Device command
1: Function Level Reset (FLR)
2: Warm reset
3: Cold reset

Currently, the driver only supports Reset Type 0.

This patch adds support for FLR recovery Type 1. Before issuing a PCIe
FLR command, IDXD device and WQ states are saved. After the FLR command
execution, the device is recovered to its previous states, allowing
the user can continue using the device.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20241122233028.2762809-6-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/init.c
drivers/dma/idxd/irq.c