device.c (8e527aac055557897d43a3d74d7970ef5cf6a8bb) device.c (de5819b994893197c71c86d21af10f85f50d6499)
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */
3#include <linux/init.h>
4#include <linux/kernel.h>
5#include <linux/module.h>
6#include <linux/pci.h>
7#include <linux/io-64-nonatomic-lo-hi.h>
8#include <linux/dmaengine.h>

--- 182 unchanged lines hidden (view full) ---

191
192 if (status != IDXD_CMDSTS_SUCCESS &&
193 status != IDXD_CMDSTS_ERR_WQ_ENABLED) {
194 dev_dbg(dev, "WQ enable failed: %#x\n", status);
195 return -ENXIO;
196 }
197
198 wq->state = IDXD_WQ_ENABLED;
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */
3#include <linux/init.h>
4#include <linux/kernel.h>
5#include <linux/module.h>
6#include <linux/pci.h>
7#include <linux/io-64-nonatomic-lo-hi.h>
8#include <linux/dmaengine.h>

--- 182 unchanged lines hidden (view full) ---

191
192 if (status != IDXD_CMDSTS_SUCCESS &&
193 status != IDXD_CMDSTS_ERR_WQ_ENABLED) {
194 dev_dbg(dev, "WQ enable failed: %#x\n", status);
195 return -ENXIO;
196 }
197
198 wq->state = IDXD_WQ_ENABLED;
199 set_bit(wq->id, idxd->wq_enable_map);
199 dev_dbg(dev, "WQ %d enabled\n", wq->id);
200 return 0;
201}
202
203int idxd_wq_disable(struct idxd_wq *wq, bool reset_config)
204{
205 struct idxd_device *idxd = wq->idxd;
206 struct device *dev = &idxd->pdev->dev;

--- 11 unchanged lines hidden (view full) ---

218
219 if (status != IDXD_CMDSTS_SUCCESS) {
220 dev_dbg(dev, "WQ disable failed: %#x\n", status);
221 return -ENXIO;
222 }
223
224 if (reset_config)
225 idxd_wq_disable_cleanup(wq);
200 dev_dbg(dev, "WQ %d enabled\n", wq->id);
201 return 0;
202}
203
204int idxd_wq_disable(struct idxd_wq *wq, bool reset_config)
205{
206 struct idxd_device *idxd = wq->idxd;
207 struct device *dev = &idxd->pdev->dev;

--- 11 unchanged lines hidden (view full) ---

219
220 if (status != IDXD_CMDSTS_SUCCESS) {
221 dev_dbg(dev, "WQ disable failed: %#x\n", status);
222 return -ENXIO;
223 }
224
225 if (reset_config)
226 idxd_wq_disable_cleanup(wq);
227 clear_bit(wq->id, idxd->wq_enable_map);
226 wq->state = IDXD_WQ_DISABLED;
227 dev_dbg(dev, "WQ %d disabled\n", wq->id);
228 return 0;
229}
230
231void idxd_wq_drain(struct idxd_wq *wq)
232{
233 struct idxd_device *idxd = wq->idxd;

--- 1235 unchanged lines hidden ---
228 wq->state = IDXD_WQ_DISABLED;
229 dev_dbg(dev, "WQ %d disabled\n", wq->id);
230 return 0;
231}
232
233void idxd_wq_drain(struct idxd_wq *wq)
234{
235 struct idxd_device *idxd = wq->idxd;

--- 1235 unchanged lines hidden ---