* [PATCH 1/6] ipr: Fix missed EH wakeup
@ 2017-03-15 21:58 Brian King
2017-03-23 14:05 ` Martin K. Petersen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Brian King @ 2017-03-15 21:58 UTC (permalink / raw)
To: James.Bottomley; +Cc: martin.petersen, linux-scsi, wenxiong, brking
Following a command abort or device reset, ipr's EH handlers wait
for the commands getting aborted to get sent back from the adapter
prior to returning from the EH handler. This fixes up some cases
where the completion handler was not getting called, which would
have resulted in the EH thread waiting until it timed out, greatly
extending EH time.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
drivers/scsi/ipr.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff -puN drivers/scsi/ipr.c~ipr_fix_missed_eh_wakeup drivers/scsi/ipr.c
--- linux-2.6.git/drivers/scsi/ipr.c~ipr_fix_missed_eh_wakeup 2017-03-13 14:52:17.974545318 -0500
+++ linux-2.6.git-bjking1/drivers/scsi/ipr.c 2017-03-13 17:03:13.635568644 -0500
@@ -836,8 +836,10 @@ static void ipr_sata_eh_done(struct ipr_
qc->err_mask |= AC_ERR_OTHER;
sata_port->ioasa.status |= ATA_BUSY;
- list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
ata_qc_complete(qc);
+ if (ipr_cmd->eh_comp)
+ complete(ipr_cmd->eh_comp);
+ list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
}
/**
@@ -5947,8 +5949,10 @@ static void ipr_erp_done(struct ipr_cmnd
res->in_erp = 0;
}
scsi_dma_unmap(ipr_cmd->scsi_cmd);
- list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
scsi_cmd->scsi_done(scsi_cmd);
+ if (ipr_cmd->eh_comp)
+ complete(ipr_cmd->eh_comp);
+ list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
}
/**
@@ -6338,8 +6342,10 @@ static void ipr_erp_start(struct ipr_ioa
}
scsi_dma_unmap(ipr_cmd->scsi_cmd);
- list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
scsi_cmd->scsi_done(scsi_cmd);
+ if (ipr_cmd->eh_comp)
+ complete(ipr_cmd->eh_comp);
+ list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
}
/**
@@ -6365,8 +6371,10 @@ static void ipr_scsi_done(struct ipr_cmn
scsi_dma_unmap(scsi_cmd);
spin_lock_irqsave(ipr_cmd->hrrq->lock, lock_flags);
- list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
scsi_cmd->scsi_done(scsi_cmd);
+ if (ipr_cmd->eh_comp)
+ complete(ipr_cmd->eh_comp);
+ list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
spin_unlock_irqrestore(ipr_cmd->hrrq->lock, lock_flags);
} else {
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
_
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/6] ipr: Fix missed EH wakeup
2017-03-15 21:58 [PATCH 1/6] ipr: Fix missed EH wakeup Brian King
@ 2017-03-23 14:05 ` Martin K. Petersen
2017-03-23 15:54 ` wenxiong
2017-03-23 16:04 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2017-03-23 14:05 UTC (permalink / raw)
To: Brian King; +Cc: James.Bottomley, martin.petersen, linux-scsi, wenxiong
Brian King <brking@linux.vnet.ibm.com> writes:
> Following a command abort or device reset, ipr's EH handlers wait
> for the commands getting aborted to get sent back from the adapter
> prior to returning from the EH handler. This fixes up some cases
> where the completion handler was not getting called, which would
> have resulted in the EH thread waiting until it timed out, greatly
> extending EH time.
Somebody please review this series so I can get it queued up.
Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/6] ipr: Fix missed EH wakeup
2017-03-15 21:58 [PATCH 1/6] ipr: Fix missed EH wakeup Brian King
2017-03-23 14:05 ` Martin K. Petersen
@ 2017-03-23 15:54 ` wenxiong
2017-03-23 16:04 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: wenxiong @ 2017-03-23 15:54 UTC (permalink / raw)
To: Brian King; +Cc: James.Bottomley, martin.petersen, linux-scsi
On 2017-03-15 16:58, Brian King wrote:
I have reviewed this serial of patches and tested them on IBM systems
successfully
Thanks for your help!
Wendy
> Following a command abort or device reset, ipr's EH handlers wait
> for the commands getting aborted to get sent back from the adapter
> prior to returning from the EH handler. This fixes up some cases
> where the completion handler was not getting called, which would
> have resulted in the EH thread waiting until it timed out, greatly
> extending EH time.
>
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> ---
>
> drivers/scsi/ipr.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff -puN drivers/scsi/ipr.c~ipr_fix_missed_eh_wakeup
> drivers/scsi/ipr.c
> ---
> linux-2.6.git/drivers/scsi/ipr.c~ipr_fix_missed_eh_wakeup 2017-03-13
> 14:52:17.974545318 -0500
> +++ linux-2.6.git-bjking1/drivers/scsi/ipr.c 2017-03-13
> 17:03:13.635568644 -0500
> @@ -836,8 +836,10 @@ static void ipr_sata_eh_done(struct ipr_
>
> qc->err_mask |= AC_ERR_OTHER;
> sata_port->ioasa.status |= ATA_BUSY;
> - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> ata_qc_complete(qc);
> + if (ipr_cmd->eh_comp)
> + complete(ipr_cmd->eh_comp);
> + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> }
>
> /**
> @@ -5947,8 +5949,10 @@ static void ipr_erp_done(struct ipr_cmnd
> res->in_erp = 0;
> }
> scsi_dma_unmap(ipr_cmd->scsi_cmd);
> - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> scsi_cmd->scsi_done(scsi_cmd);
> + if (ipr_cmd->eh_comp)
> + complete(ipr_cmd->eh_comp);
> + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> }
>
> /**
> @@ -6338,8 +6342,10 @@ static void ipr_erp_start(struct ipr_ioa
> }
>
> scsi_dma_unmap(ipr_cmd->scsi_cmd);
> - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> scsi_cmd->scsi_done(scsi_cmd);
> + if (ipr_cmd->eh_comp)
> + complete(ipr_cmd->eh_comp);
> + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> }
>
> /**
> @@ -6365,8 +6371,10 @@ static void ipr_scsi_done(struct ipr_cmn
> scsi_dma_unmap(scsi_cmd);
>
> spin_lock_irqsave(ipr_cmd->hrrq->lock, lock_flags);
> - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> scsi_cmd->scsi_done(scsi_cmd);
> + if (ipr_cmd->eh_comp)
> + complete(ipr_cmd->eh_comp);
> + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> spin_unlock_irqrestore(ipr_cmd->hrrq->lock, lock_flags);
> } else {
> spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
> _
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/6] ipr: Fix missed EH wakeup
2017-03-15 21:58 [PATCH 1/6] ipr: Fix missed EH wakeup Brian King
2017-03-23 14:05 ` Martin K. Petersen
2017-03-23 15:54 ` wenxiong
@ 2017-03-23 16:04 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2017-03-23 16:04 UTC (permalink / raw)
To: Brian King; +Cc: James.Bottomley, martin.petersen, linux-scsi, wenxiong
Brian King <brking@linux.vnet.ibm.com> writes:
> Following a command abort or device reset, ipr's EH handlers wait
> for the commands getting aborted to get sent back from the adapter
> prior to returning from the EH handler. This fixes up some cases
> where the completion handler was not getting called, which would
> have resulted in the EH thread waiting until it timed out, greatly
> extending EH time.
Applied to 4.12/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-23 16:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 21:58 [PATCH 1/6] ipr: Fix missed EH wakeup Brian King
2017-03-23 14:05 ` Martin K. Petersen
2017-03-23 15:54 ` wenxiong
2017-03-23 16:04 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.