aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/libfc/fc_fcp.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-09-14 14:20:38 -0700
committerKevin Hilman <khilman@linaro.org>2015-09-14 14:20:38 -0700
commit705e0fe41b54f2dea954ebd692a870a36b04ce76 (patch)
treedc1c9e774d068ffac89fc9851c921c61cf44677d /drivers/scsi/libfc/fc_fcp.c
parent373cea9e2c9c6495a80efdae55cf2114f384a75b (diff)
parentc765e5c15e7d23d2b8b37fafdafc63c0ea75fabf (diff)
* linux-linaro-lsk-v3.14: (66 commits) Linux 3.14.52 arm64: KVM: Fix host crash when injecting a fault into a 32bit guest SCSI: Fix NULL pointer dereference in runtime PM arm64/mm: Remove hack in mmap randomize layout crypto: caam - fix memory corruption in ahash_final_ctx regmap: regcache-rbtree: Clean new present bits on present bitmap resize libfc: Fix fc_fcp_cleanup_each_cmd() libfc: Fix fc_exch_recv_req() error path drm/vmwgfx: Fix execbuf locking issues drm/radeon: add new OLAND pci id EDAC, ppc4xx: Access mci->csrows array elements properly localmodconfig: Use Kbuild files too dm thin metadata: delete btrees when releasing metadata snapshot perf: Fix PERF_EVENT_IOC_PERIOD migration race perf: Fix fasync handling on inherited events xen-blkfront: don't add indirect pages to list when !feature_persistent mm/hwpoison: fix page refcount of unknown non LRU page ipc/sem.c: update/correct memory barriers ipc,sem: fix use after free on IPC_RMID after a task using same semaphore set exits arm64: el0_dbg does not set link reg for return to user path, breaks debug ...
Diffstat (limited to 'drivers/scsi/libfc/fc_fcp.c')
-rw-r--r--drivers/scsi/libfc/fc_fcp.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 1d7e76e8b447..ae6fc1a94568 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1039,11 +1039,26 @@ restart:
fc_fcp_pkt_hold(fsp);
spin_unlock_irqrestore(&si->scsi_queue_lock, flags);
- if (!fc_fcp_lock_pkt(fsp)) {
+ spin_lock_bh(&fsp->scsi_pkt_lock);
+ if (!(fsp->state & FC_SRB_COMPL)) {
+ fsp->state |= FC_SRB_COMPL;
+ /*
+ * TODO: dropping scsi_pkt_lock and then reacquiring
+ * again around fc_fcp_cleanup_cmd() is required,
+ * since fc_fcp_cleanup_cmd() calls into
+ * fc_seq_set_resp() and that func preempts cpu using
+ * schedule. May be schedule and related code should be
+ * removed instead of unlocking here to avoid scheduling
+ * while atomic bug.
+ */
+ spin_unlock_bh(&fsp->scsi_pkt_lock);
+
fc_fcp_cleanup_cmd(fsp, error);
+
+ spin_lock_bh(&fsp->scsi_pkt_lock);
fc_io_compl(fsp);
- fc_fcp_unlock_pkt(fsp);
}
+ spin_unlock_bh(&fsp->scsi_pkt_lock);
fc_fcp_pkt_release(fsp);
spin_lock_irqsave(&si->scsi_queue_lock, flags);