device.c (0cda4f6986a3824cac500f66326ff267bf37110f) | device.c (448c3de8ac8353fc4447738ae3c56c4eb6c2131d) |
---|---|
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> --- 1187 unchanged lines hidden (view full) --- 1196 1197 rc = idxd_wq_map_portal(wq); 1198 if (rc < 0) { 1199 dev_dbg(dev, "wq %d portal mapping failed: %d\n", wq->id, rc); 1200 goto err_map_portal; 1201 } 1202 1203 wq->client_count = 0; | 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> --- 1187 unchanged lines hidden (view full) --- 1196 1197 rc = idxd_wq_map_portal(wq); 1198 if (rc < 0) { 1199 dev_dbg(dev, "wq %d portal mapping failed: %d\n", wq->id, rc); 1200 goto err_map_portal; 1201 } 1202 1203 wq->client_count = 0; |
1204 1205 if (is_idxd_wq_cdev(wq)) { 1206 rc = idxd_wq_add_cdev(wq); 1207 if (rc < 0) { 1208 dev_dbg(dev, "wq %d cdev creation failed\n", wq->id); 1209 goto err_client; 1210 } 1211 } 1212 | |
1213 return 0; 1214 | 1204 return 0; 1205 |
1215err_client: 1216 idxd_wq_unmap_portal(wq); | |
1217err_map_portal: 1218 rc = idxd_wq_disable(wq, false); 1219 if (rc < 0) 1220 dev_dbg(dev, "wq %s disable failed\n", dev_name(wq_confdev(wq))); 1221err: 1222 return rc; 1223} 1224 --- 9 unchanged lines hidden (view full) --- 1234 1235void __drv_disable_wq(struct idxd_wq *wq) 1236{ 1237 struct idxd_device *idxd = wq->idxd; 1238 struct device *dev = &idxd->pdev->dev; 1239 1240 lockdep_assert_held(&wq->wq_lock); 1241 | 1206err_map_portal: 1207 rc = idxd_wq_disable(wq, false); 1208 if (rc < 0) 1209 dev_dbg(dev, "wq %s disable failed\n", dev_name(wq_confdev(wq))); 1210err: 1211 return rc; 1212} 1213 --- 9 unchanged lines hidden (view full) --- 1223 1224void __drv_disable_wq(struct idxd_wq *wq) 1225{ 1226 struct idxd_device *idxd = wq->idxd; 1227 struct device *dev = &idxd->pdev->dev; 1228 1229 lockdep_assert_held(&wq->wq_lock); 1230 |
1242 if (is_idxd_wq_cdev(wq)) 1243 idxd_wq_del_cdev(wq); 1244 | |
1245 if (idxd_wq_refcount(wq)) 1246 dev_warn(dev, "Clients has claim on wq %d: %d\n", 1247 wq->id, idxd_wq_refcount(wq)); 1248 1249 idxd_wq_unmap_portal(wq); 1250 1251 idxd_wq_drain(wq); 1252 idxd_wq_reset(wq); --- 82 unchanged lines hidden --- | 1231 if (idxd_wq_refcount(wq)) 1232 dev_warn(dev, "Clients has claim on wq %d: %d\n", 1233 wq->id, idxd_wq_refcount(wq)); 1234 1235 idxd_wq_unmap_portal(wq); 1236 1237 idxd_wq_drain(wq); 1238 idxd_wq_reset(wq); --- 82 unchanged lines hidden --- |