aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-08-02 11:43:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-08-02 11:43:19 -0400
commit33611ba0fed7c7f7768aeb5e0dcda85cc8cf74c4 (patch)
tree35031a4876fe03c4c37c12202400564716c2d20b
parent26c5cebfdb6ca799186f1e56be7d6f2480c5012c (diff)
parent2c67521821acd900d7508f37e49d0b494011106d (diff)
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "These seven patches are mostly minor build, Kconfig and error leg fixes" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qedi: Fix return code in qedi_ep_connect() scsi: lpfc: fix linking against modular NVMe support scsi: scsi_transport_fc: return -EBUSY for deleted vport scsi: libcxgbi: add check for valid cxgbi_task_data scsi: aic7xxx: fix firmware build with O=path scsi: megaraid_sas: fix memleak in megasas_alloc_cmdlist_fusion scsi: qedi: Add ISCSI_BOOT_SYSFS to Kconfig
-rw-r--r--drivers/scsi/Kconfig2
-rw-r--r--drivers/scsi/aic7xxx/Makefile12
-rw-r--r--drivers/scsi/aic7xxx/aicasm/Makefile53
-rw-r--r--drivers/scsi/cxgbi/libcxgbi.c7
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c6
-rw-r--r--drivers/scsi/qedi/Kconfig1
-rw-r--r--drivers/scsi/qedi/qedi_iscsi.c8
-rw-r--r--drivers/scsi/scsi_transport_fc.c6
8 files changed, 58 insertions, 37 deletions
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index d384f4f86c26..f4538d7a3016 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1230,6 +1230,8 @@ config SCSI_LPFC
1230 tristate "Emulex LightPulse Fibre Channel Support" 1230 tristate "Emulex LightPulse Fibre Channel Support"
1231 depends on PCI && SCSI 1231 depends on PCI && SCSI
1232 depends on SCSI_FC_ATTRS 1232 depends on SCSI_FC_ATTRS
1233 depends on NVME_TARGET_FC || NVME_TARGET_FC=n
1234 depends on NVME_FC || NVME_FC=n
1233 select CRC_T10DIF 1235 select CRC_T10DIF
1234 ---help--- 1236 ---help---
1235 This lpfc driver supports the Emulex LightPulse 1237 This lpfc driver supports the Emulex LightPulse
diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 741d81861d17..07b60a780c06 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -55,9 +55,9 @@ aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \
55 55
56ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y) 56ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
57$(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm 57$(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
58 $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \ 58 $(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic7xxx_reg.h \
59 $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \ 59 $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
60 $(src)/aic7xxx.seq 60 $(srctree)/$(src)/aic7xxx.seq
61 61
62$(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h 62$(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h
63else 63else
@@ -72,14 +72,14 @@ aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \
72 72
73ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y) 73ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
74$(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm 74$(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
75 $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \ 75 $(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic79xx_reg.h \
76 $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \ 76 $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
77 $(src)/aic79xx.seq 77 $(srctree)/$(src)/aic79xx.seq
78 78
79$(aic79xx-gen-y): $(obj)/aic79xx_seq.h 79$(aic79xx-gen-y): $(obj)/aic79xx_seq.h
80else 80else
81$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped 81$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
82endif 82endif
83 83
84$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl] 84$(obj)/aicasm/aicasm: $(srctree)/$(src)/aicasm/*.[chyl]
85 $(MAKE) -C $(src)/aicasm 85 $(MAKE) -C $(srctree)/$(src)/aicasm OUTDIR=$(shell pwd)/$(obj)/aicasm/
diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile b/drivers/scsi/aic7xxx/aicasm/Makefile
index b98c5c1056c3..45e2d49c1fff 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -1,19 +1,21 @@
1PROG= aicasm 1PROG= aicasm
2 2
3OUTDIR ?= ./
4
3.SUFFIXES= .l .y .c .h 5.SUFFIXES= .l .y .c .h
4 6
5CSRCS= aicasm.c aicasm_symbol.c 7CSRCS= aicasm.c aicasm_symbol.c
6YSRCS= aicasm_gram.y aicasm_macro_gram.y 8YSRCS= aicasm_gram.y aicasm_macro_gram.y
7LSRCS= aicasm_scan.l aicasm_macro_scan.l 9LSRCS= aicasm_scan.l aicasm_macro_scan.l
8 10
9GENHDRS= aicdb.h $(YSRCS:.y=.h) 11GENHDRS= $(addprefix ${OUTDIR}/,aicdb.h $(YSRCS:.y=.h))
10GENSRCS= $(YSRCS:.y=.c) $(LSRCS:.l=.c) 12GENSRCS= $(addprefix ${OUTDIR}/,$(YSRCS:.y=.c) $(LSRCS:.l=.c))
11 13
12SRCS= ${CSRCS} ${GENSRCS} 14SRCS= ${CSRCS} ${GENSRCS}
13LIBS= -ldb 15LIBS= -ldb
14clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG) 16clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
15# Override default kernel CFLAGS. This is a userland app. 17# Override default kernel CFLAGS. This is a userland app.
16AICASM_CFLAGS:= -I/usr/include -I. 18AICASM_CFLAGS:= -I/usr/include -I. -I$(OUTDIR)
17LEX= flex 19LEX= flex
18YACC= bison 20YACC= bison
19YFLAGS= -d 21YFLAGS= -d
@@ -32,22 +34,25 @@ YFLAGS+= -t -v
32LFLAGS= -d 34LFLAGS= -d
33endif 35endif
34 36
35$(PROG): ${GENHDRS} $(SRCS) 37$(PROG): $(OUTDIR) ${GENHDRS} $(SRCS)
36 $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG) $(LIBS) 38 $(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(OUTDIR)/$(PROG) $(LIBS)
39
40$(OUTDIR):
41 mkdir -p $(OUTDIR)
37 42
38aicdb.h: 43$(OUTDIR)/aicdb.h:
39 @if [ -e "/usr/include/db4/db_185.h" ]; then \ 44 @if [ -e "/usr/include/db4/db_185.h" ]; then \
40 echo "#include <db4/db_185.h>" > aicdb.h; \ 45 echo "#include <db4/db_185.h>" > $@; \
41 elif [ -e "/usr/include/db3/db_185.h" ]; then \ 46 elif [ -e "/usr/include/db3/db_185.h" ]; then \
42 echo "#include <db3/db_185.h>" > aicdb.h; \ 47 echo "#include <db3/db_185.h>" > $@; \
43 elif [ -e "/usr/include/db2/db_185.h" ]; then \ 48 elif [ -e "/usr/include/db2/db_185.h" ]; then \
44 echo "#include <db2/db_185.h>" > aicdb.h; \ 49 echo "#include <db2/db_185.h>" > $@; \
45 elif [ -e "/usr/include/db1/db_185.h" ]; then \ 50 elif [ -e "/usr/include/db1/db_185.h" ]; then \
46 echo "#include <db1/db_185.h>" > aicdb.h; \ 51 echo "#include <db1/db_185.h>" > $@; \
47 elif [ -e "/usr/include/db/db_185.h" ]; then \ 52 elif [ -e "/usr/include/db/db_185.h" ]; then \
48 echo "#include <db/db_185.h>" > aicdb.h; \ 53 echo "#include <db/db_185.h>" > $@; \
49 elif [ -e "/usr/include/db_185.h" ]; then \ 54 elif [ -e "/usr/include/db_185.h" ]; then \
50 echo "#include <db_185.h>" > aicdb.h; \ 55 echo "#include <db_185.h>" > $@; \
51 else \ 56 else \
52 echo "*** Install db development libraries"; \ 57 echo "*** Install db development libraries"; \
53 fi 58 fi
@@ -58,23 +63,23 @@ clean:
58# Create a dependency chain in generated files 63# Create a dependency chain in generated files
59# to avoid concurrent invocations of the single 64# to avoid concurrent invocations of the single
60# rule that builds them all. 65# rule that builds them all.
61aicasm_gram.c: aicasm_gram.h 66$(OUTDIR)/aicasm_gram.c: $(OUTDIR)/aicasm_gram.h
62aicasm_gram.c aicasm_gram.h: aicasm_gram.y 67$(OUTDIR)/aicasm_gram.c $(OUTDIR)/aicasm_gram.h: aicasm_gram.y
63 $(YACC) $(YFLAGS) -b $(<:.y=) $< 68 $(YACC) $(YFLAGS) -b $(<:.y=) $<
64 mv $(<:.y=).tab.c $(<:.y=.c) 69 mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
65 mv $(<:.y=).tab.h $(<:.y=.h) 70 mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
66 71
67# Create a dependency chain in generated files 72# Create a dependency chain in generated files
68# to avoid concurrent invocations of the single 73# to avoid concurrent invocations of the single
69# rule that builds them all. 74# rule that builds them all.
70aicasm_macro_gram.c: aicasm_macro_gram.h 75$(OUTDIR)/aicasm_macro_gram.c: $(OUTDIR)/aicasm_macro_gram.h
71aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y 76$(OUTDIR)/aicasm_macro_gram.c $(OUTDIR)/aicasm_macro_gram.h: aicasm_macro_gram.y
72 $(YACC) $(YFLAGS) -b $(<:.y=) -p mm $< 77 $(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
73 mv $(<:.y=).tab.c $(<:.y=.c) 78 mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
74 mv $(<:.y=).tab.h $(<:.y=.h) 79 mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
75 80
76aicasm_scan.c: aicasm_scan.l 81$(OUTDIR)/aicasm_scan.c: aicasm_scan.l
77 $(LEX) $(LFLAGS) -o$@ $< 82 $(LEX) $(LFLAGS) -o $@ $<
78 83
79aicasm_macro_scan.c: aicasm_macro_scan.l 84$(OUTDIR)/aicasm_macro_scan.c: aicasm_macro_scan.l
80 $(LEX) $(LFLAGS) -Pmm -o$@ $< 85 $(LEX) $(LFLAGS) -Pmm -o $@ $<
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index e4c83b7c96a8..1a4cfa562a60 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2128,6 +2128,13 @@ void cxgbi_cleanup_task(struct iscsi_task *task)
2128 struct iscsi_tcp_task *tcp_task = task->dd_data; 2128 struct iscsi_tcp_task *tcp_task = task->dd_data;
2129 struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task); 2129 struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
2130 2130
2131 if (!tcp_task || !tdata || (tcp_task->dd_data != tdata)) {
2132 pr_info("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
2133 task, task->sc, tcp_task,
2134 tcp_task ? tcp_task->dd_data : NULL, tdata);
2135 return;
2136 }
2137
2131 log_debug(1 << CXGBI_DBG_ISCSI, 2138 log_debug(1 << CXGBI_DBG_ISCSI,
2132 "task 0x%p, skb 0x%p, itt 0x%x.\n", 2139 "task 0x%p, skb 0x%p, itt 0x%x.\n",
2133 task, tdata->skb, task->hdr_itt); 2140 task, tdata->skb, task->hdr_itt);
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index f990ab4d45e1..985510628f56 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -425,7 +425,7 @@ static int megasas_create_sg_sense_fusion(struct megasas_instance *instance)
425int 425int
426megasas_alloc_cmdlist_fusion(struct megasas_instance *instance) 426megasas_alloc_cmdlist_fusion(struct megasas_instance *instance)
427{ 427{
428 u32 max_mpt_cmd, i; 428 u32 max_mpt_cmd, i, j;
429 struct fusion_context *fusion; 429 struct fusion_context *fusion;
430 430
431 fusion = instance->ctrl_context; 431 fusion = instance->ctrl_context;
@@ -450,11 +450,15 @@ megasas_alloc_cmdlist_fusion(struct megasas_instance *instance)
450 fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion), 450 fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion),
451 GFP_KERNEL); 451 GFP_KERNEL);
452 if (!fusion->cmd_list[i]) { 452 if (!fusion->cmd_list[i]) {
453 for (j = 0; j < i; j++)
454 kfree(fusion->cmd_list[j]);
455 kfree(fusion->cmd_list);
453 dev_err(&instance->pdev->dev, 456 dev_err(&instance->pdev->dev,
454 "Failed from %s %d\n", __func__, __LINE__); 457 "Failed from %s %d\n", __func__, __LINE__);
455 return -ENOMEM; 458 return -ENOMEM;
456 } 459 }
457 } 460 }
461
458 return 0; 462 return 0;
459} 463}
460int 464int
diff --git a/drivers/scsi/qedi/Kconfig b/drivers/scsi/qedi/Kconfig
index 21331453db7b..2ff753ce6e27 100644
--- a/drivers/scsi/qedi/Kconfig
+++ b/drivers/scsi/qedi/Kconfig
@@ -5,6 +5,7 @@ config QEDI
5 select SCSI_ISCSI_ATTRS 5 select SCSI_ISCSI_ATTRS
6 select QED_LL2 6 select QED_LL2
7 select QED_ISCSI 7 select QED_ISCSI
8 select ISCSI_BOOT_SYSFS
8 ---help--- 9 ---help---
9 This driver supports iSCSI offload for the QLogic FastLinQ 10 This driver supports iSCSI offload for the QLogic FastLinQ
10 41000 Series Converged Network Adapters. 11 41000 Series Converged Network Adapters.
diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c
index 80edd28b635f..37da9a8b43b1 100644
--- a/drivers/scsi/qedi/qedi_iscsi.c
+++ b/drivers/scsi/qedi/qedi_iscsi.c
@@ -824,7 +824,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
824 u32 iscsi_cid = QEDI_CID_RESERVED; 824 u32 iscsi_cid = QEDI_CID_RESERVED;
825 u16 len = 0; 825 u16 len = 0;
826 char *buf = NULL; 826 char *buf = NULL;
827 int ret; 827 int ret, tmp;
828 828
829 if (!shost) { 829 if (!shost) {
830 ret = -ENXIO; 830 ret = -ENXIO;
@@ -940,10 +940,10 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
940 940
941ep_rel_conn: 941ep_rel_conn:
942 qedi->ep_tbl[iscsi_cid] = NULL; 942 qedi->ep_tbl[iscsi_cid] = NULL;
943 ret = qedi_ops->release_conn(qedi->cdev, qedi_ep->handle); 943 tmp = qedi_ops->release_conn(qedi->cdev, qedi_ep->handle);
944 if (ret) 944 if (tmp)
945 QEDI_WARN(&qedi->dbg_ctx, "release_conn returned %d\n", 945 QEDI_WARN(&qedi->dbg_ctx, "release_conn returned %d\n",
946 ret); 946 tmp);
947ep_free_sq: 947ep_free_sq:
948 qedi_free_sq(qedi, qedi_ep); 948 qedi_free_sq(qedi, qedi_ep);
949ep_conn_exit: 949ep_conn_exit:
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 7e24aa30c3b0..892fbd9800d9 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -1286,7 +1286,7 @@ store_fc_vport_delete(struct device *dev, struct device_attribute *attr,
1286 unsigned long flags; 1286 unsigned long flags;
1287 1287
1288 spin_lock_irqsave(shost->host_lock, flags); 1288 spin_lock_irqsave(shost->host_lock, flags);
1289 if (vport->flags & (FC_VPORT_DEL | FC_VPORT_CREATING)) { 1289 if (vport->flags & (FC_VPORT_DEL | FC_VPORT_CREATING | FC_VPORT_DELETING)) {
1290 spin_unlock_irqrestore(shost->host_lock, flags); 1290 spin_unlock_irqrestore(shost->host_lock, flags);
1291 return -EBUSY; 1291 return -EBUSY;
1292 } 1292 }
@@ -2430,8 +2430,10 @@ fc_remove_host(struct Scsi_Host *shost)
2430 spin_lock_irqsave(shost->host_lock, flags); 2430 spin_lock_irqsave(shost->host_lock, flags);
2431 2431
2432 /* Remove any vports */ 2432 /* Remove any vports */
2433 list_for_each_entry_safe(vport, next_vport, &fc_host->vports, peers) 2433 list_for_each_entry_safe(vport, next_vport, &fc_host->vports, peers) {
2434 vport->flags |= FC_VPORT_DELETING;
2434 fc_queue_work(shost, &vport->vport_delete_work); 2435 fc_queue_work(shost, &vport->vport_delete_work);
2436 }
2435 2437
2436 /* Remove any remote ports */ 2438 /* Remove any remote ports */
2437 list_for_each_entry_safe(rport, next_rport, 2439 list_for_each_entry_safe(rport, next_rport,