aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/remote_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/isci/remote_device.c')
-rw-r--r--drivers/scsi/isci/remote_device.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index fbf9ce28c3f..b207cd3b15a 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -1438,88 +1438,3 @@ int isci_remote_device_found(struct domain_device *domain_dev)
1438 1438
1439 return status == SCI_SUCCESS ? 0 : -ENODEV; 1439 return status == SCI_SUCCESS ? 0 : -ENODEV;
1440} 1440}
1441/**
1442 * isci_device_is_reset_pending() - This function will check if there is any
1443 * pending reset condition on the device.
1444 * @request: This parameter is the isci_device object.
1445 *
1446 * true if there is a reset pending for the device.
1447 */
1448bool isci_device_is_reset_pending(
1449 struct isci_host *isci_host,
1450 struct isci_remote_device *isci_device)
1451{
1452 struct isci_request *isci_request;
1453 struct isci_request *tmp_req;
1454 bool reset_is_pending = false;
1455 unsigned long flags;
1456
1457 dev_dbg(&isci_host->pdev->dev,
1458 "%s: isci_device = %p\n", __func__, isci_device);
1459
1460 spin_lock_irqsave(&isci_host->scic_lock, flags);
1461
1462 /* Check for reset on all pending requests. */
1463 list_for_each_entry_safe(isci_request, tmp_req,
1464 &isci_device->reqs_in_process, dev_node) {
1465 dev_dbg(&isci_host->pdev->dev,
1466 "%s: isci_device = %p request = %p\n",
1467 __func__, isci_device, isci_request);
1468
1469 if (isci_request->ttype == io_task) {
1470 struct sas_task *task = isci_request_access_task(
1471 isci_request);
1472
1473 spin_lock(&task->task_state_lock);
1474 if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET)
1475 reset_is_pending = true;
1476 spin_unlock(&task->task_state_lock);
1477 }
1478 }
1479
1480 spin_unlock_irqrestore(&isci_host->scic_lock, flags);
1481
1482 dev_dbg(&isci_host->pdev->dev,
1483 "%s: isci_device = %p reset_is_pending = %d\n",
1484 __func__, isci_device, reset_is_pending);
1485
1486 return reset_is_pending;
1487}
1488
1489/**
1490 * isci_device_clear_reset_pending() - This function will clear if any pending
1491 * reset condition flags on the device.
1492 * @request: This parameter is the isci_device object.
1493 *
1494 * true if there is a reset pending for the device.
1495 */
1496void isci_device_clear_reset_pending(struct isci_host *ihost, struct isci_remote_device *idev)
1497{
1498 struct isci_request *isci_request;
1499 struct isci_request *tmp_req;
1500 unsigned long flags = 0;
1501
1502 dev_dbg(&ihost->pdev->dev, "%s: idev=%p, ihost=%p\n",
1503 __func__, idev, ihost);
1504
1505 spin_lock_irqsave(&ihost->scic_lock, flags);
1506
1507 /* Clear reset pending on all pending requests. */
1508 list_for_each_entry_safe(isci_request, tmp_req,
1509 &idev->reqs_in_process, dev_node) {
1510 dev_dbg(&ihost->pdev->dev, "%s: idev = %p request = %p\n",
1511 __func__, idev, isci_request);
1512
1513 if (isci_request->ttype == io_task) {
1514
1515 unsigned long flags2;
1516 struct sas_task *task = isci_request_access_task(
1517 isci_request);
1518
1519 spin_lock_irqsave(&task->task_state_lock, flags2);
1520 task->task_state_flags &= ~SAS_TASK_NEED_DEV_RESET;
1521 spin_unlock_irqrestore(&task->task_state_lock, flags2);
1522 }
1523 }
1524 spin_unlock_irqrestore(&ihost->scic_lock, flags);
1525}