aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash
diff options
context:
space:
mode:
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>2015-10-21 16:12:00 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-10-30 04:03:00 -0400
commit439e85c1e89bd1ed8c99f8b46f87f495a675d95e (patch)
tree9748cd10f5097e27c7f5f2ad94895926fc10d10c /drivers/scsi/cxlflash
parent0a27ae514740b4d64b586043d6b837ad5d0c40f8 (diff)
cxlflash: Correct naming of limbo state and waitq
Limbo is not an accurate representation of this state and is also not consistent with the terminology that other drivers use to represent this concept. Rename the state and and its associated waitq to 'reset'. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com> Reviewed-by: Brian King <brking@linux.vnet.ibm.com> Reviewed-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/cxlflash')
-rw-r--r--drivers/scsi/cxlflash/common.h4
-rw-r--r--drivers/scsi/cxlflash/main.c26
-rw-r--r--drivers/scsi/cxlflash/superpipe.c14
3 files changed, 22 insertions, 22 deletions
diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h
index 1abe4e0e7a49..11318dea6ebe 100644
--- a/drivers/scsi/cxlflash/common.h
+++ b/drivers/scsi/cxlflash/common.h
@@ -79,7 +79,7 @@ enum cxlflash_init_state {
79 79
80enum cxlflash_state { 80enum cxlflash_state {
81 STATE_NORMAL, /* Normal running state, everything good */ 81 STATE_NORMAL, /* Normal running state, everything good */
82 STATE_LIMBO, /* Limbo running state, trying to reset/recover */ 82 STATE_RESET, /* Reset state, trying to reset/recover */
83 STATE_FAILTERM /* Failed/terminating state, error out users/threads */ 83 STATE_FAILTERM /* Failed/terminating state, error out users/threads */
84}; 84};
85 85
@@ -125,7 +125,7 @@ struct cxlflash_cfg {
125 125
126 wait_queue_head_t tmf_waitq; 126 wait_queue_head_t tmf_waitq;
127 bool tmf_active; 127 bool tmf_active;
128 wait_queue_head_t limbo_waitq; 128 wait_queue_head_t reset_waitq;
129 enum cxlflash_state state; 129 enum cxlflash_state state;
130}; 130};
131 131
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 6e85c77a19ed..89403367229a 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -382,8 +382,8 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
382 spin_unlock_irqrestore(&cfg->tmf_waitq.lock, lock_flags); 382 spin_unlock_irqrestore(&cfg->tmf_waitq.lock, lock_flags);
383 383
384 switch (cfg->state) { 384 switch (cfg->state) {
385 case STATE_LIMBO: 385 case STATE_RESET:
386 dev_dbg_ratelimited(&cfg->dev->dev, "%s: device in limbo!\n", 386 dev_dbg_ratelimited(&cfg->dev->dev, "%s: device is in reset!\n",
387 __func__); 387 __func__);
388 rc = SCSI_MLQUEUE_HOST_BUSY; 388 rc = SCSI_MLQUEUE_HOST_BUSY;
389 goto out; 389 goto out;
@@ -479,8 +479,8 @@ static int cxlflash_eh_device_reset_handler(struct scsi_cmnd *scp)
479 if (unlikely(rcr)) 479 if (unlikely(rcr))
480 rc = FAILED; 480 rc = FAILED;
481 break; 481 break;
482 case STATE_LIMBO: 482 case STATE_RESET:
483 wait_event(cfg->limbo_waitq, cfg->state != STATE_LIMBO); 483 wait_event(cfg->reset_waitq, cfg->state != STATE_RESET);
484 if (cfg->state == STATE_NORMAL) 484 if (cfg->state == STATE_NORMAL)
485 break; 485 break;
486 /* fall through */ 486 /* fall through */
@@ -519,7 +519,7 @@ static int cxlflash_eh_host_reset_handler(struct scsi_cmnd *scp)
519 519
520 switch (cfg->state) { 520 switch (cfg->state) {
521 case STATE_NORMAL: 521 case STATE_NORMAL:
522 cfg->state = STATE_LIMBO; 522 cfg->state = STATE_RESET;
523 scsi_block_requests(cfg->host); 523 scsi_block_requests(cfg->host);
524 cxlflash_mark_contexts_error(cfg); 524 cxlflash_mark_contexts_error(cfg);
525 rcr = cxlflash_afu_reset(cfg); 525 rcr = cxlflash_afu_reset(cfg);
@@ -528,11 +528,11 @@ static int cxlflash_eh_host_reset_handler(struct scsi_cmnd *scp)
528 cfg->state = STATE_FAILTERM; 528 cfg->state = STATE_FAILTERM;
529 } else 529 } else
530 cfg->state = STATE_NORMAL; 530 cfg->state = STATE_NORMAL;
531 wake_up_all(&cfg->limbo_waitq); 531 wake_up_all(&cfg->reset_waitq);
532 scsi_unblock_requests(cfg->host); 532 scsi_unblock_requests(cfg->host);
533 break; 533 break;
534 case STATE_LIMBO: 534 case STATE_RESET:
535 wait_event(cfg->limbo_waitq, cfg->state != STATE_LIMBO); 535 wait_event(cfg->reset_waitq, cfg->state != STATE_RESET);
536 if (cfg->state == STATE_NORMAL) 536 if (cfg->state == STATE_NORMAL)
537 break; 537 break;
538 /* fall through */ 538 /* fall through */
@@ -705,7 +705,7 @@ static void cxlflash_wait_for_pci_err_recovery(struct cxlflash_cfg *cfg)
705 struct pci_dev *pdev = cfg->dev; 705 struct pci_dev *pdev = cfg->dev;
706 706
707 if (pci_channel_offline(pdev)) 707 if (pci_channel_offline(pdev))
708 wait_event_timeout(cfg->limbo_waitq, 708 wait_event_timeout(cfg->reset_waitq,
709 !pci_channel_offline(pdev), 709 !pci_channel_offline(pdev),
710 CXLFLASH_PCI_ERROR_RECOVERY_TIMEOUT); 710 CXLFLASH_PCI_ERROR_RECOVERY_TIMEOUT);
711} 711}
@@ -2304,7 +2304,7 @@ static int cxlflash_probe(struct pci_dev *pdev,
2304 cfg->mcctx = NULL; 2304 cfg->mcctx = NULL;
2305 2305
2306 init_waitqueue_head(&cfg->tmf_waitq); 2306 init_waitqueue_head(&cfg->tmf_waitq);
2307 init_waitqueue_head(&cfg->limbo_waitq); 2307 init_waitqueue_head(&cfg->reset_waitq);
2308 2308
2309 INIT_WORK(&cfg->work_q, cxlflash_worker_thread); 2309 INIT_WORK(&cfg->work_q, cxlflash_worker_thread);
2310 cfg->lr_state = LINK_RESET_INVALID; 2310 cfg->lr_state = LINK_RESET_INVALID;
@@ -2396,7 +2396,7 @@ static pci_ers_result_t cxlflash_pci_error_detected(struct pci_dev *pdev,
2396 2396
2397 switch (state) { 2397 switch (state) {
2398 case pci_channel_io_frozen: 2398 case pci_channel_io_frozen:
2399 cfg->state = STATE_LIMBO; 2399 cfg->state = STATE_RESET;
2400 scsi_block_requests(cfg->host); 2400 scsi_block_requests(cfg->host);
2401 drain_ioctls(cfg); 2401 drain_ioctls(cfg);
2402 rc = cxlflash_mark_contexts_error(cfg); 2402 rc = cxlflash_mark_contexts_error(cfg);
@@ -2408,7 +2408,7 @@ static pci_ers_result_t cxlflash_pci_error_detected(struct pci_dev *pdev,
2408 return PCI_ERS_RESULT_NEED_RESET; 2408 return PCI_ERS_RESULT_NEED_RESET;
2409 case pci_channel_io_perm_failure: 2409 case pci_channel_io_perm_failure:
2410 cfg->state = STATE_FAILTERM; 2410 cfg->state = STATE_FAILTERM;
2411 wake_up_all(&cfg->limbo_waitq); 2411 wake_up_all(&cfg->reset_waitq);
2412 scsi_unblock_requests(cfg->host); 2412 scsi_unblock_requests(cfg->host);
2413 return PCI_ERS_RESULT_DISCONNECT; 2413 return PCI_ERS_RESULT_DISCONNECT;
2414 default: 2414 default:
@@ -2455,7 +2455,7 @@ static void cxlflash_pci_resume(struct pci_dev *pdev)
2455 dev_dbg(dev, "%s: pdev=%p\n", __func__, pdev); 2455 dev_dbg(dev, "%s: pdev=%p\n", __func__, pdev);
2456 2456
2457 cfg->state = STATE_NORMAL; 2457 cfg->state = STATE_NORMAL;
2458 wake_up_all(&cfg->limbo_waitq); 2458 wake_up_all(&cfg->reset_waitq);
2459 scsi_unblock_requests(cfg->host); 2459 scsi_unblock_requests(cfg->host);
2460} 2460}
2461 2461
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index 6e8fc1125e53..577aa25d80f5 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -100,7 +100,7 @@ void cxlflash_stop_term_user_contexts(struct cxlflash_cfg *cfg)
100 100
101 dev_dbg(dev, "%s: Wait for user contexts to quiesce...\n", 101 dev_dbg(dev, "%s: Wait for user contexts to quiesce...\n",
102 __func__); 102 __func__);
103 wake_up_all(&cfg->limbo_waitq); 103 wake_up_all(&cfg->reset_waitq);
104 ssleep(1); 104 ssleep(1);
105 } 105 }
106} 106}
@@ -1233,11 +1233,11 @@ static int check_state(struct cxlflash_cfg *cfg)
1233 1233
1234retry: 1234retry:
1235 switch (cfg->state) { 1235 switch (cfg->state) {
1236 case STATE_LIMBO: 1236 case STATE_RESET:
1237 dev_dbg(dev, "%s: Limbo state, going to wait...\n", __func__); 1237 dev_dbg(dev, "%s: Reset state, going to wait...\n", __func__);
1238 up_read(&cfg->ioctl_rwsem); 1238 up_read(&cfg->ioctl_rwsem);
1239 rc = wait_event_interruptible(cfg->limbo_waitq, 1239 rc = wait_event_interruptible(cfg->reset_waitq,
1240 cfg->state != STATE_LIMBO); 1240 cfg->state != STATE_RESET);
1241 down_read(&cfg->ioctl_rwsem); 1241 down_read(&cfg->ioctl_rwsem);
1242 if (unlikely(rc)) 1242 if (unlikely(rc))
1243 break; 1243 break;
@@ -1578,10 +1578,10 @@ err1:
1578 * quite possible for this routine to act as the kernel's EEH detection 1578 * quite possible for this routine to act as the kernel's EEH detection
1579 * source (MMIO read of mbox_r). Because of this, there is a window of 1579 * source (MMIO read of mbox_r). Because of this, there is a window of
1580 * time where an EEH might have been detected but not yet 'serviced' 1580 * time where an EEH might have been detected but not yet 'serviced'
1581 * (callback invoked, causing the device to enter limbo state). To avoid 1581 * (callback invoked, causing the device to enter reset state). To avoid
1582 * looping in this routine during that window, a 1 second sleep is in place 1582 * looping in this routine during that window, a 1 second sleep is in place
1583 * between the time the MMIO failure is detected and the time a wait on the 1583 * between the time the MMIO failure is detected and the time a wait on the
1584 * limbo wait queue is attempted via check_state(). 1584 * reset wait queue is attempted via check_state().
1585 * 1585 *
1586 * Return: 0 on success, -errno on failure 1586 * Return: 0 on success, -errno on failure
1587 */ 1587 */