Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302572
b: refs/heads/master
c: 621120c
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Skirvin authored and Dan Williams committed May 17, 2012
1 parent d0b633d commit ec1ccef
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 033d19d298b4245da2d3d6c795ea97e419f9ac61
refs/heads/master: 621120ca56850249554996c94efe75f8200a2cc0
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/isci/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,8 @@ void isci_host_completion_routine(unsigned long data)
if (test_and_clear_bit(IREQ_ABORT_PATH_ACTIVE, &request->flags))
wake_up_all(&ihost->eventq);

isci_free_tag(ihost, request->io_tag);
if (!test_bit(IREQ_NO_AUTO_FREE_TAG, &request->flags))
isci_free_tag(ihost, request->io_tag);
}
spin_unlock_irq(&ihost->scic_lock);

Expand Down
11 changes: 7 additions & 4 deletions trunk/drivers/scsi/isci/remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ static enum sci_status sci_remote_device_terminate_req(
int check_abort,
struct isci_request *ireq)
{
dev_dbg(&ihost->pdev->dev,
"%s: idev=%p; flags=%lx; req=%p; req target=%p\n",
__func__, idev, idev->flags, ireq, ireq->target_device);

if (!test_bit(IREQ_ACTIVE, &ireq->flags) ||
(ireq->target_device != idev) ||
(check_abort && !test_bit(IREQ_PENDING_ABORT, &ireq->flags)))
return SCI_SUCCESS;

dev_dbg(&ihost->pdev->dev,
"%s: idev=%p; flags=%lx; req=%p; req target=%p\n",
__func__, idev, idev->flags, ireq, ireq->target_device);

set_bit(IREQ_ABORT_PATH_ACTIVE, &ireq->flags);

return sci_controller_terminate_request(ihost, idev, ireq);
Expand Down Expand Up @@ -209,11 +209,14 @@ enum sci_status isci_remote_device_terminate_requests(
rnc_suspend_count, idev->rnc.suspend_count);
if (ireq) {
/* Terminate a specific TC. */
set_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags);
sci_remote_device_terminate_req(ihost, idev, 0, ireq);
spin_unlock_irqrestore(&ihost->scic_lock, flags);
wait_event(ihost->eventq,
isci_check_reqterm(ihost, idev, ireq,
rnc_suspend_count));
clear_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags);
isci_free_tag(ihost, ireq->io_tag);
} else {
/* Terminate all TCs. */
sci_remote_device_terminate_requests(idev);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/isci/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ struct isci_request {
#define IREQ_PENDING_ABORT 4 /* Set == device was not suspended yet */
#define IREQ_TC_ABORT_POSTED 5
#define IREQ_ABORT_PATH_ACTIVE 6
#define IREQ_NO_AUTO_FREE_TAG 7 /* Set when being explicitly managed */
unsigned long flags;
/* XXX kill ttype and ttype_ptr, allocate full sas_task */
union ttype_ptr_union {
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/isci/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ isci_task_request_complete(struct isci_host *ihost,
*/
set_bit(IREQ_TERMINATED, &ireq->flags);

isci_free_tag(ihost, ireq->io_tag);
if (!test_bit(IREQ_NO_AUTO_FREE_TAG, &ireq->flags))
isci_free_tag(ihost, ireq->io_tag);

/* The task management part completes last. */
if (tmf_complete)
Expand Down

0 comments on commit ec1ccef

Please sign in to comment.