mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
scsi: vmw_pvscsi: return SUCCESS for successful command aborts
The vmw_pvscsi driver reports most successful aborts as FAILED to the scsi error handler. This is do to a misunderstanding of how completion_done() works and its interaction with a successful wait using wait_for_completion_timeout(). The vmw_pvscsi driver is expecting completion_done() to always return true if complete() has been called on the completion structure. But completion_done() returns true after complete() has been called only if no function like wait_for_completion_timeout() has seen the completion and cleared it as part of successfully waiting for the completion. Instead of using completion_done(), vmw_pvscsi should just use the return value from wait_for_completion_timeout() to know if the wait timed out or not. [mkp: bumped driver version per request] Signed-off-by: David Jeffery <djeffery@redhat.com> Reviewed-by: Laurence Oberman <loberman@redhat.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Acked-by: Jim Gill <jgill@vmware.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
6d3a56ed09
commit
aac173e961
2 changed files with 4 additions and 3 deletions
|
@ -793,6 +793,7 @@ static int pvscsi_abort(struct scsi_cmnd *cmd)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int result = SUCCESS;
|
int result = SUCCESS;
|
||||||
DECLARE_COMPLETION_ONSTACK(abort_cmp);
|
DECLARE_COMPLETION_ONSTACK(abort_cmp);
|
||||||
|
int done;
|
||||||
|
|
||||||
scmd_printk(KERN_DEBUG, cmd, "task abort on host %u, %p\n",
|
scmd_printk(KERN_DEBUG, cmd, "task abort on host %u, %p\n",
|
||||||
adapter->host->host_no, cmd);
|
adapter->host->host_no, cmd);
|
||||||
|
@ -824,10 +825,10 @@ static int pvscsi_abort(struct scsi_cmnd *cmd)
|
||||||
pvscsi_abort_cmd(adapter, ctx);
|
pvscsi_abort_cmd(adapter, ctx);
|
||||||
spin_unlock_irqrestore(&adapter->hw_lock, flags);
|
spin_unlock_irqrestore(&adapter->hw_lock, flags);
|
||||||
/* Wait for 2 secs for the completion. */
|
/* Wait for 2 secs for the completion. */
|
||||||
wait_for_completion_timeout(&abort_cmp, msecs_to_jiffies(2000));
|
done = wait_for_completion_timeout(&abort_cmp, msecs_to_jiffies(2000));
|
||||||
spin_lock_irqsave(&adapter->hw_lock, flags);
|
spin_lock_irqsave(&adapter->hw_lock, flags);
|
||||||
|
|
||||||
if (!completion_done(&abort_cmp)) {
|
if (!done) {
|
||||||
/*
|
/*
|
||||||
* Failed to abort the command, unmark the fact that it
|
* Failed to abort the command, unmark the fact that it
|
||||||
* was requested to be aborted.
|
* was requested to be aborted.
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#define PVSCSI_DRIVER_VERSION_STRING "1.0.6.0-k"
|
#define PVSCSI_DRIVER_VERSION_STRING "1.0.7.0-k"
|
||||||
|
|
||||||
#define PVSCSI_MAX_NUM_SG_ENTRIES_PER_SEGMENT 128
|
#define PVSCSI_MAX_NUM_SG_ENTRIES_PER_SEGMENT 128
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue