device.c (5fc8e85ff12ce0530ac658686902a0ee64600f56) device.c (7c5dd23e57c14cf7177b8a5e0fd08916e0c60005)
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>

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

515
516void idxd_device_wqs_clear_state(struct idxd_device *idxd)
517{
518 int i;
519
520 lockdep_assert_held(&idxd->dev_lock);
521
522 for (i = 0; i < idxd->max_wqs; i++) {
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>

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

515
516void idxd_device_wqs_clear_state(struct idxd_device *idxd)
517{
518 int i;
519
520 lockdep_assert_held(&idxd->dev_lock);
521
522 for (i = 0; i < idxd->max_wqs; i++) {
523 struct idxd_wq *wq = &idxd->wqs[i];
523 struct idxd_wq *wq = idxd->wqs[i];
524
525 if (wq->state == IDXD_WQ_ENABLED) {
526 idxd_wq_disable_cleanup(wq);
527 wq->state = IDXD_WQ_DISABLED;
528 }
529 }
530}
531

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

733 return 0;
734}
735
736static int idxd_wqs_config_write(struct idxd_device *idxd)
737{
738 int i, rc;
739
740 for (i = 0; i < idxd->max_wqs; i++) {
524
525 if (wq->state == IDXD_WQ_ENABLED) {
526 idxd_wq_disable_cleanup(wq);
527 wq->state = IDXD_WQ_DISABLED;
528 }
529 }
530}
531

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

733 return 0;
734}
735
736static int idxd_wqs_config_write(struct idxd_device *idxd)
737{
738 int i, rc;
739
740 for (i = 0; i < idxd->max_wqs; i++) {
741 struct idxd_wq *wq = &idxd->wqs[i];
741 struct idxd_wq *wq = idxd->wqs[i];
742
743 rc = idxd_wq_config_write(wq);
744 if (rc < 0)
745 return rc;
746 }
747
748 return 0;
749}

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

811
812 for (i = 0; i < idxd->max_groups; i++) {
813 group = &idxd->groups[i];
814 for (j = 0; j < 4; j++)
815 group->grpcfg.wqs[j] = 0;
816 }
817
818 for (i = 0; i < idxd->max_wqs; i++) {
742
743 rc = idxd_wq_config_write(wq);
744 if (rc < 0)
745 return rc;
746 }
747
748 return 0;
749}

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

811
812 for (i = 0; i < idxd->max_groups; i++) {
813 group = &idxd->groups[i];
814 for (j = 0; j < 4; j++)
815 group->grpcfg.wqs[j] = 0;
816 }
817
818 for (i = 0; i < idxd->max_wqs; i++) {
819 wq = &idxd->wqs[i];
819 wq = idxd->wqs[i];
820 group = wq->group;
821
822 if (!wq->group)
823 continue;
824 if (!wq->size)
825 continue;
826
827 if (wq_shared(wq) && !device_swq_supported(idxd)) {

--- 39 unchanged lines hidden ---
820 group = wq->group;
821
822 if (!wq->group)
823 continue;
824 if (!wq->size)
825 continue;
826
827 if (wq_shared(wq) && !device_swq_supported(idxd)) {

--- 39 unchanged lines hidden ---