aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index e908c0631ace..558dae9639f3 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -670,24 +670,20 @@ static struct debug_view zfcp_rec_dbf_view = {
670 * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation 670 * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation
671 * @id2: identifier for event 671 * @id2: identifier for event
672 * @adapter: adapter 672 * @adapter: adapter
673 * @lock: non-zero value indicates that erp_lock has not yet been acquired 673 * This function assumes that the caller is holding erp_lock.
674 */ 674 */
675void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock) 675void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter)
676{ 676{
677 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; 677 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf;
678 unsigned long flags = 0; 678 unsigned long flags = 0;
679 struct list_head *entry; 679 struct list_head *entry;
680 unsigned ready = 0, running = 0, total; 680 unsigned ready = 0, running = 0, total;
681 681
682 if (lock)
683 read_lock_irqsave(&adapter->erp_lock, flags);
684 list_for_each(entry, &adapter->erp_ready_head) 682 list_for_each(entry, &adapter->erp_ready_head)
685 ready++; 683 ready++;
686 list_for_each(entry, &adapter->erp_running_head) 684 list_for_each(entry, &adapter->erp_running_head)
687 running++; 685 running++;
688 total = adapter->erp_total_count; 686 total = adapter->erp_total_count;
689 if (lock)
690 read_unlock_irqrestore(&adapter->erp_lock, flags);
691 687
692 spin_lock_irqsave(&adapter->rec_dbf_lock, flags); 688 spin_lock_irqsave(&adapter->rec_dbf_lock, flags);
693 memset(r, 0, sizeof(*r)); 689 memset(r, 0, sizeof(*r));
@@ -700,6 +696,21 @@ void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock)
700 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); 696 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
701} 697}
702 698
699/**
700 * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation
701 * @id2: identifier for event
702 * @adapter: adapter
703 * This function assumes that the caller does not hold erp_lock.
704 */
705void zfcp_rec_dbf_event_thread_lock(u8 id2, struct zfcp_adapter *adapter)
706{
707 unsigned long flags;
708
709 read_lock_irqsave(&adapter->erp_lock, flags);
710 zfcp_rec_dbf_event_thread(id2, adapter);
711 read_unlock_irqrestore(&adapter->erp_lock, flags);
712}
713
703static void zfcp_rec_dbf_event_target(u8 id2, void *ref, 714static void zfcp_rec_dbf_event_target(u8 id2, void *ref,
704 struct zfcp_adapter *adapter, 715 struct zfcp_adapter *adapter,
705 atomic_t *status, atomic_t *erp_count, 716 atomic_t *status, atomic_t *erp_count,