Merge remote-tracking branch 'mkp-scsi/4.9/scsi-fixes' into fixes
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 21 Oct 2016 16:40:02 +0000 (12:40 -0400)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 21 Oct 2016 16:40:02 +0000 (12:40 -0400)
1  2 
drivers/scsi/be2iscsi/be_main.c

@@@ -61,7 -61,7 +61,7 @@@ MODULE_PARM_DESC(be_max_phys_size
                "memory that can be allocated. Range is 16 - 128");
  
  #define beiscsi_disp_param(_name)\
 -ssize_t       \
 +static ssize_t        \
  beiscsi_##_name##_disp(struct device *dev,\
                        struct device_attribute *attrib, char *buf)     \
  {     \
@@@ -74,7 -74,7 +74,7 @@@
  }
  
  #define beiscsi_change_param(_name, _minval, _maxval, _defaval)\
 -int \
 +static int \
  beiscsi_##_name##_change(struct beiscsi_hba *phba, uint32_t val)\
  {\
        if (val >= _minval && val <= _maxval) {\
@@@ -93,7 -93,7 +93,7 @@@
  }
  
  #define beiscsi_store_param(_name)  \
 -ssize_t \
 +static ssize_t \
  beiscsi_##_name##_store(struct device *dev,\
                         struct device_attribute *attr, const char *buf,\
                         size_t count) \
  }
  
  #define beiscsi_init_param(_name, _minval, _maxval, _defval) \
 -int \
 +static int \
  beiscsi_##_name##_init(struct beiscsi_hba *phba, uint32_t val) \
  { \
        if (val >= _minval && val <= _maxval) {\
@@@ -900,8 -900,9 +900,9 @@@ void hwi_ring_cq_db(struct beiscsi_hba 
  static struct sgl_handle *alloc_io_sgl_handle(struct beiscsi_hba *phba)
  {
        struct sgl_handle *psgl_handle;
+       unsigned long flags;
  
-       spin_lock_bh(&phba->io_sgl_lock);
+       spin_lock_irqsave(&phba->io_sgl_lock, flags);
        if (phba->io_sgl_hndl_avbl) {
                beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_IO,
                            "BM_%d : In alloc_io_sgl_handle,"
                        phba->io_sgl_alloc_index++;
        } else
                psgl_handle = NULL;
-       spin_unlock_bh(&phba->io_sgl_lock);
+       spin_unlock_irqrestore(&phba->io_sgl_lock, flags);
        return psgl_handle;
  }
  
  static void
  free_io_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
  {
-       spin_lock_bh(&phba->io_sgl_lock);
+       unsigned long flags;
+       spin_lock_irqsave(&phba->io_sgl_lock, flags);
        beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_IO,
                    "BM_%d : In free_,io_sgl_free_index=%d\n",
                    phba->io_sgl_free_index);
                             "value there=%p\n", phba->io_sgl_free_index,
                             phba->io_sgl_hndl_base
                             [phba->io_sgl_free_index]);
-                spin_unlock_bh(&phba->io_sgl_lock);
+                spin_unlock_irqrestore(&phba->io_sgl_lock, flags);
                return;
        }
        phba->io_sgl_hndl_base[phba->io_sgl_free_index] = psgl_handle;
                phba->io_sgl_free_index = 0;
        else
                phba->io_sgl_free_index++;
-       spin_unlock_bh(&phba->io_sgl_lock);
+       spin_unlock_irqrestore(&phba->io_sgl_lock, flags);
  }
  
  static inline struct wrb_handle *
@@@ -958,15 -961,16 +961,16 @@@ beiscsi_get_wrb_handle(struct hwi_wrb_c
                       unsigned int wrbs_per_cxn)
  {
        struct wrb_handle *pwrb_handle;
+       unsigned long flags;
  
-       spin_lock_bh(&pwrb_context->wrb_lock);
+       spin_lock_irqsave(&pwrb_context->wrb_lock, flags);
        pwrb_handle = pwrb_context->pwrb_handle_base[pwrb_context->alloc_index];
        pwrb_context->wrb_handles_available--;
        if (pwrb_context->alloc_index == (wrbs_per_cxn - 1))
                pwrb_context->alloc_index = 0;
        else
                pwrb_context->alloc_index++;
-       spin_unlock_bh(&pwrb_context->wrb_lock);
+       spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags);
  
        if (pwrb_handle)
                memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb));
@@@ -1001,14 -1005,16 +1005,16 @@@ beiscsi_put_wrb_handle(struct hwi_wrb_c
                       struct wrb_handle *pwrb_handle,
                       unsigned int wrbs_per_cxn)
  {
-       spin_lock_bh(&pwrb_context->wrb_lock);
+       unsigned long flags;
+       spin_lock_irqsave(&pwrb_context->wrb_lock, flags);
        pwrb_context->pwrb_handle_base[pwrb_context->free_index] = pwrb_handle;
        pwrb_context->wrb_handles_available++;
        if (pwrb_context->free_index == (wrbs_per_cxn - 1))
                pwrb_context->free_index = 0;
        else
                pwrb_context->free_index++;
-       spin_unlock_bh(&pwrb_context->wrb_lock);
+       spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags);
  }
  
  /**
@@@ -1037,8 -1043,9 +1043,9 @@@ free_wrb_handle(struct beiscsi_hba *phb
  static struct sgl_handle *alloc_mgmt_sgl_handle(struct beiscsi_hba *phba)
  {
        struct sgl_handle *psgl_handle;
+       unsigned long flags;
  
-       spin_lock_bh(&phba->mgmt_sgl_lock);
+       spin_lock_irqsave(&phba->mgmt_sgl_lock, flags);
        if (phba->eh_sgl_hndl_avbl) {
                psgl_handle = phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index];
                phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index] = NULL;
                        phba->eh_sgl_alloc_index++;
        } else
                psgl_handle = NULL;
-       spin_unlock_bh(&phba->mgmt_sgl_lock);
+       spin_unlock_irqrestore(&phba->mgmt_sgl_lock, flags);
        return psgl_handle;
  }
  
  void
  free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
  {
-       spin_lock_bh(&phba->mgmt_sgl_lock);
+       unsigned long flags;
+       spin_lock_irqsave(&phba->mgmt_sgl_lock, flags);
        beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
                    "BM_%d : In  free_mgmt_sgl_handle,"
                    "eh_sgl_free_index=%d\n",
                            "BM_%d : Double Free in eh SGL ,"
                            "eh_sgl_free_index=%d\n",
                            phba->eh_sgl_free_index);
-               spin_unlock_bh(&phba->mgmt_sgl_lock);
+               spin_unlock_irqrestore(&phba->mgmt_sgl_lock, flags);
                return;
        }
        phba->eh_sgl_hndl_base[phba->eh_sgl_free_index] = psgl_handle;
                phba->eh_sgl_free_index = 0;
        else
                phba->eh_sgl_free_index++;
-       spin_unlock_bh(&phba->mgmt_sgl_lock);
+       spin_unlock_irqrestore(&phba->mgmt_sgl_lock, flags);
  }
  
  static void
@@@ -4584,7 -4593,7 +4593,7 @@@ free_hndls
        io_task->cmd_bhs = NULL;
        return -ENOMEM;
  }
 -int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
 +static int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
                       unsigned int num_sg, unsigned int xferlen,
                       unsigned int writedir)
  {
@@@ -4973,7 -4982,7 +4982,7 @@@ static int beiscsi_bsg_request(struct b
        return rc;
  }
  
 -void beiscsi_hba_attrs_init(struct beiscsi_hba *phba)
 +static void beiscsi_hba_attrs_init(struct beiscsi_hba *phba)
  {
        /* Set the logging parameter */
        beiscsi_log_enable_init(phba, beiscsi_log_enable);