Skip to content

Commit 602432c

Browse files
committed
Merge remote-tracking branch 'mkp-scsi/4.9/scsi-fixes' into fixes
2 parents ebbb759 + 77f18a8 commit 602432c

3 files changed

Lines changed: 28 additions & 19 deletions

File tree

drivers/scsi/NCR5380.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static void NCR5380_print_phase(struct Scsi_Host *instance)
353353
#endif
354354

355355

356-
static int probe_irq __initdata;
356+
static int probe_irq;
357357

358358
/**
359359
* probe_intr - helper for IRQ autoprobe
@@ -365,7 +365,7 @@ static int probe_irq __initdata;
365365
* used by the IRQ probe code.
366366
*/
367367

368-
static irqreturn_t __init probe_intr(int irq, void *dev_id)
368+
static irqreturn_t probe_intr(int irq, void *dev_id)
369369
{
370370
probe_irq = irq;
371371
return IRQ_HANDLED;
@@ -380,7 +380,7 @@ static irqreturn_t __init probe_intr(int irq, void *dev_id)
380380
* and then looking to see what interrupt actually turned up.
381381
*/
382382

383-
static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
383+
static int __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
384384
int possible)
385385
{
386386
struct NCR5380_hostdata *hostdata = shost_priv(instance);

drivers/scsi/be2iscsi/be_main.c

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -900,8 +900,9 @@ void hwi_ring_cq_db(struct beiscsi_hba *phba,
900900
static struct sgl_handle *alloc_io_sgl_handle(struct beiscsi_hba *phba)
901901
{
902902
struct sgl_handle *psgl_handle;
903+
unsigned long flags;
903904

904-
spin_lock_bh(&phba->io_sgl_lock);
905+
spin_lock_irqsave(&phba->io_sgl_lock, flags);
905906
if (phba->io_sgl_hndl_avbl) {
906907
beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_IO,
907908
"BM_%d : In alloc_io_sgl_handle,"
@@ -919,14 +920,16 @@ static struct sgl_handle *alloc_io_sgl_handle(struct beiscsi_hba *phba)
919920
phba->io_sgl_alloc_index++;
920921
} else
921922
psgl_handle = NULL;
922-
spin_unlock_bh(&phba->io_sgl_lock);
923+
spin_unlock_irqrestore(&phba->io_sgl_lock, flags);
923924
return psgl_handle;
924925
}
925926

926927
static void
927928
free_io_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
928929
{
929-
spin_lock_bh(&phba->io_sgl_lock);
930+
unsigned long flags;
931+
932+
spin_lock_irqsave(&phba->io_sgl_lock, flags);
930933
beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_IO,
931934
"BM_%d : In free_,io_sgl_free_index=%d\n",
932935
phba->io_sgl_free_index);
@@ -941,7 +944,7 @@ free_io_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
941944
"value there=%p\n", phba->io_sgl_free_index,
942945
phba->io_sgl_hndl_base
943946
[phba->io_sgl_free_index]);
944-
spin_unlock_bh(&phba->io_sgl_lock);
947+
spin_unlock_irqrestore(&phba->io_sgl_lock, flags);
945948
return;
946949
}
947950
phba->io_sgl_hndl_base[phba->io_sgl_free_index] = psgl_handle;
@@ -950,23 +953,24 @@ free_io_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
950953
phba->io_sgl_free_index = 0;
951954
else
952955
phba->io_sgl_free_index++;
953-
spin_unlock_bh(&phba->io_sgl_lock);
956+
spin_unlock_irqrestore(&phba->io_sgl_lock, flags);
954957
}
955958

956959
static inline struct wrb_handle *
957960
beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context,
958961
unsigned int wrbs_per_cxn)
959962
{
960963
struct wrb_handle *pwrb_handle;
964+
unsigned long flags;
961965

962-
spin_lock_bh(&pwrb_context->wrb_lock);
966+
spin_lock_irqsave(&pwrb_context->wrb_lock, flags);
963967
pwrb_handle = pwrb_context->pwrb_handle_base[pwrb_context->alloc_index];
964968
pwrb_context->wrb_handles_available--;
965969
if (pwrb_context->alloc_index == (wrbs_per_cxn - 1))
966970
pwrb_context->alloc_index = 0;
967971
else
968972
pwrb_context->alloc_index++;
969-
spin_unlock_bh(&pwrb_context->wrb_lock);
973+
spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags);
970974

971975
if (pwrb_handle)
972976
memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb));
@@ -1001,14 +1005,16 @@ beiscsi_put_wrb_handle(struct hwi_wrb_context *pwrb_context,
10011005
struct wrb_handle *pwrb_handle,
10021006
unsigned int wrbs_per_cxn)
10031007
{
1004-
spin_lock_bh(&pwrb_context->wrb_lock);
1008+
unsigned long flags;
1009+
1010+
spin_lock_irqsave(&pwrb_context->wrb_lock, flags);
10051011
pwrb_context->pwrb_handle_base[pwrb_context->free_index] = pwrb_handle;
10061012
pwrb_context->wrb_handles_available++;
10071013
if (pwrb_context->free_index == (wrbs_per_cxn - 1))
10081014
pwrb_context->free_index = 0;
10091015
else
10101016
pwrb_context->free_index++;
1011-
spin_unlock_bh(&pwrb_context->wrb_lock);
1017+
spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags);
10121018
}
10131019

10141020
/**
@@ -1037,8 +1043,9 @@ free_wrb_handle(struct beiscsi_hba *phba, struct hwi_wrb_context *pwrb_context,
10371043
static struct sgl_handle *alloc_mgmt_sgl_handle(struct beiscsi_hba *phba)
10381044
{
10391045
struct sgl_handle *psgl_handle;
1046+
unsigned long flags;
10401047

1041-
spin_lock_bh(&phba->mgmt_sgl_lock);
1048+
spin_lock_irqsave(&phba->mgmt_sgl_lock, flags);
10421049
if (phba->eh_sgl_hndl_avbl) {
10431050
psgl_handle = phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index];
10441051
phba->eh_sgl_hndl_base[phba->eh_sgl_alloc_index] = NULL;
@@ -1056,14 +1063,16 @@ static struct sgl_handle *alloc_mgmt_sgl_handle(struct beiscsi_hba *phba)
10561063
phba->eh_sgl_alloc_index++;
10571064
} else
10581065
psgl_handle = NULL;
1059-
spin_unlock_bh(&phba->mgmt_sgl_lock);
1066+
spin_unlock_irqrestore(&phba->mgmt_sgl_lock, flags);
10601067
return psgl_handle;
10611068
}
10621069

10631070
void
10641071
free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
10651072
{
1066-
spin_lock_bh(&phba->mgmt_sgl_lock);
1073+
unsigned long flags;
1074+
1075+
spin_lock_irqsave(&phba->mgmt_sgl_lock, flags);
10671076
beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
10681077
"BM_%d : In free_mgmt_sgl_handle,"
10691078
"eh_sgl_free_index=%d\n",
@@ -1078,7 +1087,7 @@ free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
10781087
"BM_%d : Double Free in eh SGL ,"
10791088
"eh_sgl_free_index=%d\n",
10801089
phba->eh_sgl_free_index);
1081-
spin_unlock_bh(&phba->mgmt_sgl_lock);
1090+
spin_unlock_irqrestore(&phba->mgmt_sgl_lock, flags);
10821091
return;
10831092
}
10841093
phba->eh_sgl_hndl_base[phba->eh_sgl_free_index] = psgl_handle;
@@ -1088,7 +1097,7 @@ free_mgmt_sgl_handle(struct beiscsi_hba *phba, struct sgl_handle *psgl_handle)
10881097
phba->eh_sgl_free_index = 0;
10891098
else
10901099
phba->eh_sgl_free_index++;
1091-
spin_unlock_bh(&phba->mgmt_sgl_lock);
1100+
spin_unlock_irqrestore(&phba->mgmt_sgl_lock, flags);
10921101
}
10931102

10941103
static void

drivers/scsi/libiscsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
791791

792792
free_task:
793793
/* regular RX path uses back_lock */
794-
spin_lock_bh(&session->back_lock);
794+
spin_lock(&session->back_lock);
795795
__iscsi_put_task(task);
796-
spin_unlock_bh(&session->back_lock);
796+
spin_unlock(&session->back_lock);
797797
return NULL;
798798
}
799799

0 commit comments

Comments
 (0)