Skip to content

Commit 33611ba

Browse files
committed
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
2 parents 26c5ceb + 2c67521 commit 33611ba

8 files changed

Lines changed: 58 additions & 37 deletions

File tree

‎drivers/scsi/Kconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,8 @@ config SCSI_LPFC
12301230
tristate "Emulex LightPulse Fibre Channel Support"
12311231
depends on PCI && SCSI
12321232
depends on SCSI_FC_ATTRS
1233+
depends on NVME_TARGET_FC || NVME_TARGET_FC=n
1234+
depends on NVME_FC || NVME_FC=n
12331235
select CRC_T10DIF
12341236
---help---
12351237
This lpfc driver supports the Emulex LightPulse

‎drivers/scsi/aic7xxx/Makefile‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \
5555

5656
ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
5757
$(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 \
5959
$(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
60-
$(src)/aic7xxx.seq
60+
$(srctree)/$(src)/aic7xxx.seq
6161

6262
$(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h
6363
else
@@ -72,14 +72,14 @@ aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \
7272

7373
ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
7474
$(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 \
7676
$(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
77-
$(src)/aic79xx.seq
77+
$(srctree)/$(src)/aic79xx.seq
7878

7979
$(aic79xx-gen-y): $(obj)/aic79xx_seq.h
8080
else
8181
$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
8282
endif
8383

84-
$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl]
85-
$(MAKE) -C $(src)/aicasm
84+
$(obj)/aicasm/aicasm: $(srctree)/$(src)/aicasm/*.[chyl]
85+
$(MAKE) -C $(srctree)/$(src)/aicasm OUTDIR=$(shell pwd)/$(obj)/aicasm/
Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
PROG= aicasm
22

3+
OUTDIR ?= ./
4+
35
.SUFFIXES= .l .y .c .h
46

57
CSRCS= aicasm.c aicasm_symbol.c
68
YSRCS= aicasm_gram.y aicasm_macro_gram.y
79
LSRCS= aicasm_scan.l aicasm_macro_scan.l
810

9-
GENHDRS= aicdb.h $(YSRCS:.y=.h)
10-
GENSRCS= $(YSRCS:.y=.c) $(LSRCS:.l=.c)
11+
GENHDRS= $(addprefix ${OUTDIR}/,aicdb.h $(YSRCS:.y=.h))
12+
GENSRCS= $(addprefix ${OUTDIR}/,$(YSRCS:.y=.c) $(LSRCS:.l=.c))
1113

1214
SRCS= ${CSRCS} ${GENSRCS}
1315
LIBS= -ldb
1416
clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
1517
# Override default kernel CFLAGS. This is a userland app.
16-
AICASM_CFLAGS:= -I/usr/include -I.
18+
AICASM_CFLAGS:= -I/usr/include -I. -I$(OUTDIR)
1719
LEX= flex
1820
YACC= bison
1921
YFLAGS= -d
@@ -32,22 +34,25 @@ YFLAGS+= -t -v
3234
LFLAGS= -d
3335
endif
3436

35-
$(PROG): ${GENHDRS} $(SRCS)
36-
$(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(PROG) $(LIBS)
37+
$(PROG): $(OUTDIR) ${GENHDRS} $(SRCS)
38+
$(AICASM_CC) $(AICASM_CFLAGS) $(SRCS) -o $(OUTDIR)/$(PROG) $(LIBS)
39+
40+
$(OUTDIR):
41+
mkdir -p $(OUTDIR)
3742

38-
aicdb.h:
43+
$(OUTDIR)/aicdb.h:
3944
@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>" > $@; \
4146
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>" > $@; \
4348
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>" > $@; \
4550
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>" > $@; \
4752
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>" > $@; \
4954
elif [ -e "/usr/include/db_185.h" ]; then \
50-
echo "#include <db_185.h>" > aicdb.h; \
55+
echo "#include <db_185.h>" > $@; \
5156
else \
5257
echo "*** Install db development libraries"; \
5358
fi
@@ -58,23 +63,23 @@ clean:
5863
# Create a dependency chain in generated files
5964
# to avoid concurrent invocations of the single
6065
# rule that builds them all.
61-
aicasm_gram.c: aicasm_gram.h
62-
aicasm_gram.c aicasm_gram.h: aicasm_gram.y
66+
$(OUTDIR)/aicasm_gram.c: $(OUTDIR)/aicasm_gram.h
67+
$(OUTDIR)/aicasm_gram.c $(OUTDIR)/aicasm_gram.h: aicasm_gram.y
6368
$(YACC) $(YFLAGS) -b $(<:.y=) $<
64-
mv $(<:.y=).tab.c $(<:.y=.c)
65-
mv $(<:.y=).tab.h $(<:.y=.h)
69+
mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
70+
mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
6671

6772
# Create a dependency chain in generated files
6873
# to avoid concurrent invocations of the single
6974
# rule that builds them all.
70-
aicasm_macro_gram.c: aicasm_macro_gram.h
71-
aicasm_macro_gram.c aicasm_macro_gram.h: aicasm_macro_gram.y
75+
$(OUTDIR)/aicasm_macro_gram.c: $(OUTDIR)/aicasm_macro_gram.h
76+
$(OUTDIR)/aicasm_macro_gram.c $(OUTDIR)/aicasm_macro_gram.h: aicasm_macro_gram.y
7277
$(YACC) $(YFLAGS) -b $(<:.y=) -p mm $<
73-
mv $(<:.y=).tab.c $(<:.y=.c)
74-
mv $(<:.y=).tab.h $(<:.y=.h)
78+
mv $(<:.y=).tab.c $(OUTDIR)/$(<:.y=.c)
79+
mv $(<:.y=).tab.h $(OUTDIR)/$(<:.y=.h)
7580

76-
aicasm_scan.c: aicasm_scan.l
77-
$(LEX) $(LFLAGS) -o$@ $<
81+
$(OUTDIR)/aicasm_scan.c: aicasm_scan.l
82+
$(LEX) $(LFLAGS) -o $@ $<
7883

79-
aicasm_macro_scan.c: aicasm_macro_scan.l
80-
$(LEX) $(LFLAGS) -Pmm -o$@ $<
84+
$(OUTDIR)/aicasm_macro_scan.c: aicasm_macro_scan.l
85+
$(LEX) $(LFLAGS) -Pmm -o $@ $<

‎drivers/scsi/cxgbi/libcxgbi.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,13 @@ void cxgbi_cleanup_task(struct iscsi_task *task)
21282128
struct iscsi_tcp_task *tcp_task = task->dd_data;
21292129
struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
21302130

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+
21312138
log_debug(1 << CXGBI_DBG_ISCSI,
21322139
"task 0x%p, skb 0x%p, itt 0x%x.\n",
21332140
task, tdata->skb, task->hdr_itt);

‎drivers/scsi/megaraid/megaraid_sas_fusion.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static int megasas_create_sg_sense_fusion(struct megasas_instance *instance)
425425
int
426426
megasas_alloc_cmdlist_fusion(struct megasas_instance *instance)
427427
{
428-
u32 max_mpt_cmd, i;
428+
u32 max_mpt_cmd, i, j;
429429
struct fusion_context *fusion;
430430

431431
fusion = instance->ctrl_context;
@@ -450,11 +450,15 @@ megasas_alloc_cmdlist_fusion(struct megasas_instance *instance)
450450
fusion->cmd_list[i] = kzalloc(sizeof(struct megasas_cmd_fusion),
451451
GFP_KERNEL);
452452
if (!fusion->cmd_list[i]) {
453+
for (j = 0; j < i; j++)
454+
kfree(fusion->cmd_list[j]);
455+
kfree(fusion->cmd_list);
453456
dev_err(&instance->pdev->dev,
454457
"Failed from %s %d\n", __func__, __LINE__);
455458
return -ENOMEM;
456459
}
457460
}
461+
458462
return 0;
459463
}
460464
int

‎drivers/scsi/qedi/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config QEDI
55
select SCSI_ISCSI_ATTRS
66
select QED_LL2
77
select QED_ISCSI
8+
select ISCSI_BOOT_SYSFS
89
---help---
910
This driver supports iSCSI offload for the QLogic FastLinQ
1011
41000 Series Converged Network Adapters.

‎drivers/scsi/qedi/qedi_iscsi.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
824824
u32 iscsi_cid = QEDI_CID_RESERVED;
825825
u16 len = 0;
826826
char *buf = NULL;
827-
int ret;
827+
int ret, tmp;
828828

829829
if (!shost) {
830830
ret = -ENXIO;
@@ -940,10 +940,10 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
940940

941941
ep_rel_conn:
942942
qedi->ep_tbl[iscsi_cid] = NULL;
943-
ret = qedi_ops->release_conn(qedi->cdev, qedi_ep->handle);
944-
if (ret)
943+
tmp = qedi_ops->release_conn(qedi->cdev, qedi_ep->handle);
944+
if (tmp)
945945
QEDI_WARN(&qedi->dbg_ctx, "release_conn returned %d\n",
946-
ret);
946+
tmp);
947947
ep_free_sq:
948948
qedi_free_sq(qedi, qedi_ep);
949949
ep_conn_exit:

‎drivers/scsi/scsi_transport_fc.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ store_fc_vport_delete(struct device *dev, struct device_attribute *attr,
12861286
unsigned long flags;
12871287

12881288
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)) {
12901290
spin_unlock_irqrestore(shost->host_lock, flags);
12911291
return -EBUSY;
12921292
}
@@ -2430,8 +2430,10 @@ fc_remove_host(struct Scsi_Host *shost)
24302430
spin_lock_irqsave(shost->host_lock, flags);
24312431

24322432
/* 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;
24342435
fc_queue_work(shost, &vport->vport_delete_work);
2436+
}
24352437

24362438
/* Remove any remote ports */
24372439
list_for_each_entry_safe(rport, next_rport,

0 commit comments

Comments
 (0)