mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 11:11:27 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -30,8 +30,8 @@ INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
|
||||
|
||||
# The file Modules.symvers has been renamed in the 2.6.18 kernel to
|
||||
# Module.symvers. Find out which name to use by looking in $(KDIR).
|
||||
MODULE_SYMVERS:=$(shell if [ -e $(KDIR)/Module.symvers ]; then \
|
||||
echo Module.symvers; else echo Modules.symvers; fi)
|
||||
MODULE_SYMVERS:=$(shell if [ -e $(KDIR)/Modules.symvers ]; then \
|
||||
echo Modules.symvers; else echo Module.symvers; fi)
|
||||
|
||||
|
||||
all: src/$(MODULE_SYMVERS)
|
||||
|
||||
@@ -3950,7 +3950,6 @@ static int iscsi_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
union iscsi_sid sid;
|
||||
int tr_id_size;
|
||||
uint8_t *tr_id;
|
||||
uint8_t q;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -3965,7 +3964,7 @@ static int iscsi_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
sid.id.tsih = 0;
|
||||
|
||||
tr_id_size = 4 + strlen(sess->initiator_name) + 5 +
|
||||
snprintf(&q, sizeof(q), "%llx", sid.id64) + 1;
|
||||
snprintf(NULL, 0, "%llx", sid.id64) + 1;
|
||||
tr_id_size = (tr_id_size + 3) & -4;
|
||||
|
||||
tr_id = kzalloc(tr_id_size, GFP_KERNEL);
|
||||
|
||||
4
qla2x00t/Makefile_in-tree
Normal file
4
qla2x00t/Makefile_in-tree
Normal file
@@ -0,0 +1,4 @@
|
||||
qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \
|
||||
qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o qla_nx.o
|
||||
|
||||
obj-$(CONFIG_SCSI_QLA_FC) += qla2xxx.o
|
||||
@@ -7,23 +7,29 @@ if [ "$1" = "" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${1#2.6.26}" = "$1" ]; then
|
||||
# Exit silently for other kernel versions than 2.6.26.x.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -e qla2xxx-orig/$1 ]; then
|
||||
./extract-qla2xxx-orig "$1"
|
||||
fi
|
||||
|
||||
mkdir -p in-tree-patches/"${kernel_version}"
|
||||
|
||||
for f in qla2xxx-orig/"${kernel_version}"/*
|
||||
do
|
||||
g="${f#qla2xxx-orig/${kernel_version}/}"
|
||||
f1="$f"
|
||||
for g in Kconfig *.[ch]; do
|
||||
f1="qla2xxx-orig/${kernel_version}/$g"
|
||||
f2="$g"
|
||||
f3="in-tree-patches/${kernel_version}/$g.patch"
|
||||
if [ "$f1" -nt "$f3" -o "$f2" -nt "$f3" ]; then
|
||||
if [ -e "$f1" ]; then
|
||||
diff -up "$f1" "$f2" > "$f3"
|
||||
else
|
||||
diff -up /dev/null "$f2" > "$f3"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
for g in Makefile; do
|
||||
f1="qla2xxx-orig/${kernel_version}/$g"
|
||||
f2="${g}_in-tree"
|
||||
f3="in-tree-patches/${kernel_version}/$g.patch"
|
||||
if [ "$f1" -nt "$f3" -o "$f2" -nt "$f3" ]; then
|
||||
diff -up "$f1" "$f2" > "$f3"
|
||||
fi
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1365,7 +1365,8 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)
|
||||
/* Model description. */
|
||||
eiter = (struct ct_fdmi_hba_attr *) (entries + size);
|
||||
eiter->type = cpu_to_be16(FDMI_HBA_MODEL_DESCRIPTION);
|
||||
strncpy(eiter->a.model_desc, ha->model_desc, 80);
|
||||
strlcpy(eiter->a.model_desc, ha->model_desc,
|
||||
sizeof(eiter->a.model_desc));
|
||||
alen = strlen(eiter->a.model_desc);
|
||||
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
|
||||
eiter->len = cpu_to_be16(4 + alen);
|
||||
@@ -1653,8 +1654,8 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
|
||||
ct_req->req.rpa.attrs.count = cpu_to_be32(FDMI_PORT_ATTR_COUNT);
|
||||
eiter = (struct ct_fdmi_port_attr *) (entries + size);
|
||||
eiter->type = cpu_to_be16(FDMI_PORT_HOST_NAME);
|
||||
snprintf(eiter->a.host_name, sizeof(eiter->a.host_name),
|
||||
"%s", fc_host_system_hostname(vha->host));
|
||||
strlcpy(eiter->a.host_name, fc_host_system_hostname(vha->host),
|
||||
sizeof(eiter->a.host_name));
|
||||
alen = strlen(eiter->a.host_name);
|
||||
alen += (alen & 3) ? (4 - (alen & 3)) : 4;
|
||||
eiter->len = cpu_to_be16(4 + alen);
|
||||
|
||||
@@ -1228,12 +1228,8 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
type, sp->handle, comp_status, fw_status[1], fw_status[2],
|
||||
le16_to_cpu(((struct els_sts_entry_24xx *)
|
||||
pkt)->total_byte_count));
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
fw_sts_ptr = ((uint8_t*)scsi_req(bsg_job->req)->sense) +
|
||||
fw_sts_ptr = bsg_job_sense(bsg_job) +
|
||||
sizeof(struct fc_bsg_reply);
|
||||
#else
|
||||
fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply);
|
||||
#endif
|
||||
memcpy( fw_sts_ptr, fw_status, sizeof(fw_status));
|
||||
}
|
||||
else {
|
||||
@@ -1250,12 +1246,8 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
#else
|
||||
bsg_reply->reply_payload_rcv_len = 0;
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
fw_sts_ptr = ((uint8_t*)scsi_req(bsg_job->req)->sense) +
|
||||
fw_sts_ptr = bsg_job_sense(bsg_job) +
|
||||
sizeof(struct fc_bsg_reply);
|
||||
#else
|
||||
fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply);
|
||||
#endif
|
||||
memcpy( fw_sts_ptr, fw_status, sizeof(fw_status));
|
||||
}
|
||||
ql_dump_buffer(ql_dbg_user + ql_dbg_buffer, vha, 0x5056,
|
||||
|
||||
@@ -48,8 +48,8 @@ function add_patch {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -e "s:^--- [^ ]*:--- orig/linux-${kver}/$2:" \
|
||||
-e "s:^+++ [^ ]*:+++ linux-${kver}/$2:" \
|
||||
sed -e "s:^--- [^ ]*:--- linux-${kver}/$2:" \
|
||||
-e "s:^+++ [^ ]*:+++ linux-${kver}/$2:" \
|
||||
< "$1"
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ function add_file {
|
||||
# -- skip *.mod.c.
|
||||
if [ "$1" = "${1%.mod.c}" ] && [ "$1" ]; then
|
||||
cat <<EOF
|
||||
diff -uprN orig/linux-${kver}/$2 linux-${kver}/$2
|
||||
--- orig/linux-${kver}/$2
|
||||
diff -uprN linux-${kver}/$2 linux-${kver}/$2
|
||||
--- linux-${kver}/$2
|
||||
+++ linux-${kver}/$2
|
||||
@@ -0,0 +1,$(wc -l "$1" | { read -r a b; echo "$a"; echo "$b" >/dev/null; }) @@
|
||||
EOF
|
||||
@@ -94,8 +94,8 @@ EOF
|
||||
|
||||
function add_empty_file {
|
||||
cat <<EOF
|
||||
diff -uprN orig/linux-${kver}/$1 linux-${kver}/$1
|
||||
--- orig/linux-${kver}/$1
|
||||
diff -uprN linux-${kver}/$1 linux-${kver}/$1
|
||||
--- linux-${kver}/$1
|
||||
+++ linux-${kver}/$1
|
||||
@@ -0,0 +1,1 @@
|
||||
+
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
kernel_mirror="http://cdn.kernel.org/pub/linux/kernel"
|
||||
kernel_sources="$HOME/software/downloads"
|
||||
|
||||
# Whether or not kernel version $1 is lower than or equal kernel version $2.
|
||||
function kernel_version_le {
|
||||
awk -v "v1=$1" -v "v2=$2" 'BEGIN { n1 = split(v1, v1a, "."); n2 = split(v2, v2a, "."); for (i=1;;i++) { e1 = i <= n1 ? v1a[i] : 0; e2 = i <= n2 ? v2a[i] : 0; if (e1 < e2 || i >= n1 && i >= n2) exit 0; if (e1 > e2) exit 1; }}'
|
||||
}
|
||||
|
||||
# Kernel version number.
|
||||
function kernel_version {
|
||||
if [ "${1#2.}" != "$1" ]; then
|
||||
|
||||
@@ -210,7 +210,6 @@ function generate_kernel_patch {
|
||||
kver="$(kernel_version "$1")"
|
||||
driver_options=(-l)
|
||||
[ "${mpt_scst}" = "true" ] && driver_options+=("-m")
|
||||
[ "${qla2x00t}" = "true" ] && driver_options+=("-q")
|
||||
|
||||
"${scriptsdir}"/generate-kernel-patch "${driver_options[@]}" "$2" "$1" > "${patchfile}"
|
||||
|
||||
@@ -343,19 +342,20 @@ function compile_patched_kernel {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Compile subdirectory $2 of the patched kernel tree linux-$1.
|
||||
# Compile subdirectories $2..$n of the patched kernel tree linux-$1.
|
||||
function compile_kernel {
|
||||
local kver plevel
|
||||
local k=$1
|
||||
kver="$(kernel_version "$1")"
|
||||
plevel="$(patchlevel "$1")"
|
||||
local outputfile="${outputdir}/compilation-$1-output.txt"
|
||||
local subdir="$2"
|
||||
shift
|
||||
|
||||
echo "Compiling the patched kernel ..."
|
||||
if (cd "${outputdir}/linux-$1" \
|
||||
if (cd "${outputdir}/linux-$k" \
|
||||
&& make -s prepare \
|
||||
&& make -s scripts \
|
||||
&& LC_ALL=C make -k M="${subdir}"
|
||||
&& for subdir; do LC_ALL=C make -k M="${subdir}"; done
|
||||
) &> "${outputfile}"
|
||||
then
|
||||
local errors warnings
|
||||
@@ -379,16 +379,16 @@ function run_sparse {
|
||||
kver="$(kernel_version "$1")"
|
||||
plevel="$(patchlevel "$1")"
|
||||
local outputfile="${outputdir}/sparse-$1-output.txt"
|
||||
local subdir="$2"
|
||||
shift
|
||||
shift
|
||||
|
||||
echo "Running sparse on the patched kernel in ${subdir} $* ..."
|
||||
echo "Running sparse on the patched kernel in $* ..."
|
||||
if (cd "${outputdir}/linux-$k" \
|
||||
&& make -s prepare \
|
||||
&& make -s scripts \
|
||||
&& if grep -q '^CONFIG_PPC=y$' .config; then LC_ALL=C make -k M=arch/powerpc/lib; fi \
|
||||
&& LC_ALL=C make -k C=2 CF="-D__CHECK_ENDIAN__ -DCONFIG_SPARSE_RCU_POINTER" M="${subdir}" "$@"
|
||||
&& for subdir; do
|
||||
LC_ALL=C make -k C=2 CF="-D__CHECK_ENDIAN__ -DCONFIG_SPARSE_RCU_POINTER" M="${subdir}"
|
||||
done
|
||||
) &> "${outputfile}"
|
||||
then
|
||||
local errors warnings
|
||||
@@ -410,25 +410,26 @@ function run_sparse {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Run smatch for kernel version $1 on directories $2..$n
|
||||
function run_smatch {
|
||||
local k="$1"
|
||||
local kver plevel
|
||||
kver="$(kernel_version "$1")"
|
||||
plevel="$(patchlevel "$1")"
|
||||
local outputfile="${outputdir}/smatch-$1-output.txt"
|
||||
local subdir="$2"
|
||||
local disable="CONFIG_DYNAMIC_DEBUG"
|
||||
shift
|
||||
shift
|
||||
|
||||
echo "Running smatch on the patched kernel in ${subdir} $* ..."
|
||||
echo "Running smatch on the patched kernel in $* ..."
|
||||
if (cd "${outputdir}/linux-$k" &&
|
||||
for c in $disable; do sed -i.tmp "s/^$c=y\$/$c=n/" .config; done &&
|
||||
make -s oldconfig </dev/null &&
|
||||
make -s prepare &&
|
||||
make -s scripts &&
|
||||
if grep -q '^CONFIG_PPC=y$' .config; then LC_ALL=C make -k M=arch/powerpc/lib; fi &&
|
||||
LC_ALL=C make -k CHECK="smatch -p=kernel" C=2 CF=-D__CHECK_ENDIAN__ M="${subdir}" "$@"
|
||||
for subdir; do
|
||||
LC_ALL=C make -k CHECK="smatch -p=kernel" C=2 CF=-D__CHECK_ENDIAN__ M="${subdir}"
|
||||
done
|
||||
) &> "${outputfile}"
|
||||
then
|
||||
local errors warnings
|
||||
@@ -542,7 +543,7 @@ outputdir="${PWD}/regression-test-output-$(date +%Y-%m-%d_%Hh%Mm%Ss)"
|
||||
# Driver configuration.
|
||||
mpt_scst="false"
|
||||
multiple_patches="false"
|
||||
qla2x00t="false"
|
||||
qla2x00t="true"
|
||||
remove_temporary_files_at_end="false"
|
||||
run_local_compilation="true"
|
||||
quiet_download="false"
|
||||
@@ -668,8 +669,9 @@ do
|
||||
run_checkpatch "$k"
|
||||
fi
|
||||
patch_and_configure_kernel "$k"
|
||||
subdirs=(drivers/scst)
|
||||
if [ "${run_sparse}" = "true" ]; then
|
||||
run_sparse "$k" drivers/scst
|
||||
run_sparse "$k" "${subdirs[@]}"
|
||||
mv "${outputdir}/sparse-$k-output.txt" \
|
||||
"${outputdir}/sparse-$k-scst-output.txt"
|
||||
if [ "${ibmvio}" = "true" ]; then
|
||||
@@ -685,9 +687,12 @@ do
|
||||
fi
|
||||
fi
|
||||
if [ "${run_smatch}" = "true" ]; then
|
||||
run_smatch "$k" drivers/scst
|
||||
run_smatch "$k" "${subdirs[@]}"
|
||||
fi
|
||||
compile_kernel "$k" drivers/scst
|
||||
if [ "${qla2x00t}" = "true" ] && $(kernel_version_le 2.6.37 $k); then
|
||||
subdirs+=(drivers/scsi/qla2xxx)
|
||||
fi
|
||||
compile_kernel "$k" "${subdirs[@]}"
|
||||
if [ "${full_check}" = "true" ]; then
|
||||
run_headers_check "$k"
|
||||
compile_patched_kernel "$k"
|
||||
|
||||
@@ -587,7 +587,7 @@ BEGIN {
|
||||
config_scst_proc_undefined = 0
|
||||
|
||||
# Variable initialization.
|
||||
is_c_source = 0
|
||||
process_file = 0
|
||||
reset_hunk_state_variables()
|
||||
}
|
||||
|
||||
@@ -599,10 +599,11 @@ BEGIN {
|
||||
# Start of new file.
|
||||
dump_lines()
|
||||
reset_hunk_state_variables()
|
||||
is_c_source = match(filename[1], "\\.[ch]$") != 0
|
||||
process_file = match(filename[1], "\\.[ch]$") != 0 &&
|
||||
match(filename[1], "drivers/scsi/qla2xxx/") == 0
|
||||
}
|
||||
|
||||
if (!is_c_source)
|
||||
if (!process_file)
|
||||
{
|
||||
print
|
||||
next
|
||||
@@ -647,6 +648,8 @@ BEGIN {
|
||||
else if (lines >= 2 && !match(line[lines-2], ":$") &&
|
||||
line[lines-1] == "+\x9return;" && $0 == "+}")
|
||||
{
|
||||
# Delete "return;" statements at the end of a function that are not
|
||||
# preceded by a label.
|
||||
line[lines-1] = $0
|
||||
lines_less_added++
|
||||
}
|
||||
|
||||
@@ -22,13 +22,17 @@
|
||||
|
||||
#include <linux/bio.h>
|
||||
#include <linux/blkdev.h> /* struct request_queue */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
|
||||
#include <linux/bsg-lib.h> /* struct bsg_job */
|
||||
#endif
|
||||
#include <linux/scatterlist.h> /* struct scatterlist */
|
||||
#include <linux/slab.h> /* kmalloc() */
|
||||
#include <linux/timer.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/writeback.h> /* sync_page_range() */
|
||||
#include <scsi/scsi_cmnd.h> /* struct scsi_cmnd */
|
||||
#include <rdma/ib_verbs.h>
|
||||
#include <scsi/scsi_cmnd.h> /* struct scsi_cmnd */
|
||||
#include <scsi/scsi_transport_fc.h> /* struct fc_bsg_job */
|
||||
|
||||
/* <asm-generic/barrier.h> */
|
||||
|
||||
@@ -90,6 +94,34 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <linux/bsg-lib.h> */
|
||||
|
||||
/*
|
||||
* Note: the function bsg_job_sense() exists only in SCST but not in any
|
||||
* upstream kernel.
|
||||
*/
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31) && \
|
||||
((LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) && \
|
||||
!defined(CONFIG_SUSE_KERNEL)) || \
|
||||
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) && \
|
||||
defined(CONFIG_SUSE_KERNEL)))
|
||||
static inline void *bsg_job_sense(struct fc_bsg_job *job)
|
||||
{
|
||||
return job->req->sense;
|
||||
}
|
||||
#else
|
||||
static inline void *bsg_job_sense(struct bsg_job *job)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
||||
return job->req->sense;
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
|
||||
return scsi_req(job->req)->sense;
|
||||
#else
|
||||
return scsi_req(blk_mq_rq_from_pdu(job))->sense;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <linux/compiler.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)
|
||||
@@ -717,14 +749,14 @@ struct t10_pi_tuple {
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
|
||||
#define timer_setup(_timer, _fn, _flags) do { \
|
||||
init_timer(_timer); \
|
||||
(_timer)->function = (void (*)(unsigned long))(_fn); \
|
||||
(_timer)->function = (void *)(_fn); \
|
||||
(_timer)->data = (unsigned long)(_timer); \
|
||||
WARN_ON_ONCE((_flags) != 0); \
|
||||
} while (0)
|
||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
||||
#define timer_setup(_timer, _fn, _flags) do { \
|
||||
init_timer(_timer); \
|
||||
(_timer)->function = (void (*)(unsigned long))(_fn); \
|
||||
(_timer)->function = (void *)(_fn);\
|
||||
(_timer)->data = (unsigned long)(_timer); \
|
||||
(_timer)->flags = (_flags); \
|
||||
} while (0)
|
||||
|
||||
@@ -101,8 +101,8 @@ scst:
|
||||
|
||||
# The file Modules.symvers has been renamed in the 2.6.18 kernel to
|
||||
# Module.symvers. Find out which name to use by looking in $(KDIR).
|
||||
MODULE_SYMVERS:=$(shell if [ -e $(KDIR)/Module.symvers ]; then \
|
||||
echo Module.symvers; else echo Modules.symvers; fi)
|
||||
MODULE_SYMVERS:=$(shell if [ -e $(KDIR)/Modules.symvers ]; then \
|
||||
echo Modules.symvers; else echo Module.symvers; fi)
|
||||
|
||||
install: all
|
||||
@if [ -z "$(DESTDIR)" ] && \
|
||||
|
||||
@@ -50,8 +50,8 @@ SRC_FILES=$(wildcard */*.[ch])
|
||||
|
||||
# The file Modules.symvers has been renamed in the 2.6.18 kernel to
|
||||
# Module.symvers. Find out which name to use by looking in $(KDIR).
|
||||
MODULE_SYMVERS:=$(shell if [ -e "$(KDIR)/Module.symvers" ]; then \
|
||||
echo Module.symvers; else echo Modules.symvers; fi)
|
||||
MODULE_SYMVERS:=$(shell if [ -e "$(KDIR)/Modules.symvers" ]; then \
|
||||
echo Modules.symvers; else echo Module.symvers; fi)
|
||||
|
||||
# Name of the OFED kernel package.
|
||||
OFED_KERNEL_IB_RPM:=$(shell for r in mlnx-ofa_kernel compat-rdma kernel-ib; do rpm -q $$r 2>/dev/null | grep -q "^$$r" && echo "$$r" && break; done)
|
||||
|
||||
Reference in New Issue
Block a user