From 3a83346fba29bf639432908946def3ef0f10cdf9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 28 Mar 2021 14:42:20 +0000 Subject: [PATCH 1/4] scripts/specialize-patch: Clamp sublevel to 255 See also Linux kernel commit 9b82f13e7ef3 ("kbuild: clamp SUBLEVEL to 255"; v5.12-rc1). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9369 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/specialize-patch | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/specialize-patch b/scripts/specialize-patch index ce46d06c6..741759e01 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -31,10 +31,14 @@ # Convert a kernel version in the x.y.z format into numeric form, just like # the KERNEL_VERSION() macro. +function version_number(a, b, c) { + return a * 65536 + b * 256 + (c > 255 ? 255 : c); +} + function version_code(kver, array) { if (!match(kver, "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$", array)) match(kver, "^([0-9]+)\\.([0-9]+)$", array) - return 65536*array[1] + 256*array[2] + array[3] + return version_number(array[1], array[2], array[3]); } @@ -172,7 +176,7 @@ function evaluate(stmnt, pattern, arg, op, result) { pattern="KERNEL_VERSION\\([[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*\\)" while (match(stmnt, pattern, op) != 0) { - sub(pattern, op[1] * 65536 + op[2] * 256 + op[3], stmnt) + sub(pattern, version_number(op[1], op[2], op[3]), stmnt) } gsub("defined\\(INSIDE_KERNEL_TREE\\)", "1", stmnt) From 9369b29f1ccfdb033b9a58377f96dbd8c9988756 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 28 Mar 2021 14:43:16 +0000 Subject: [PATCH 2/4] fcst: Add a comment that explains which commits modified the FC API git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9370 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/fcst.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fcst/fcst.h b/fcst/fcst.h index 90b6a25fc..66ed933a0 100644 --- a/fcst/fcst.h +++ b/fcst/fcst.h @@ -27,6 +27,14 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || \ defined(CONFIG_SUSE_KERNEL) && \ LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) +/* + * See also commit 768c72cc34a2 ("scsi: libfc: Replace ->exch_done callback + * with function call") # v4.10 + * and commit 9625cc483b8c ("scsi: libfc: Replace ->seq_release callback with + * function call") # v4.10 + * and commit c6865b30be7e ("scsi: libfc: Replace ->seq_start_next callback + * with function call") # v4.10. + */ #define NEW_LIBFC_API #endif From 0e2c596c028fd1cf8b075cd2cceae8580db8d679 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 28 Mar 2021 14:45:06 +0000 Subject: [PATCH 3/4] qla2x00t-32gbit: Fix the CentOS 7.8 build Signed-off-by: Chesnokov Gleb [ bvanassche: modified qla_nvme changes ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9371 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_bsg.c | 20 ++++++++++++++++++++ qla2x00t-32gbit/qla_nvme.c | 16 ++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/qla2x00t-32gbit/qla_bsg.c b/qla2x00t-32gbit/qla_bsg.c index c8dd561a6..9cc1c5a85 100644 --- a/qla2x00t-32gbit/qla_bsg.c +++ b/qla2x00t-32gbit/qla_bsg.c @@ -2605,8 +2605,13 @@ qla2x00_get_flash_image_status(struct bsg_job *bsg_job) return 0; } +#ifndef NEW_LIBFC_API +static int +qla2x00_manage_host_stats(struct fc_bsg_job *bsg_job) +#else static int qla2x00_manage_host_stats(struct bsg_job *bsg_job) +#endif { scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); struct fc_bsg_reply *bsg_reply = bsg_job->reply; @@ -2674,8 +2679,13 @@ qla2x00_manage_host_stats(struct bsg_job *bsg_job) return ret; } +#ifndef NEW_LIBFC_API +static int +qla2x00_get_host_stats(struct fc_bsg_job *bsg_job) +#else static int qla2x00_get_host_stats(struct bsg_job *bsg_job) +#endif { scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); struct fc_bsg_reply *bsg_reply = bsg_job->reply; @@ -2775,8 +2785,13 @@ qla2xxx_find_rport(scsi_qla_host_t *vha, uint32_t tgt_num) return NULL; } +#ifndef NEW_LIBFC_API +static int +qla2x00_get_tgt_stats(struct fc_bsg_job *bsg_job) +#else static int qla2x00_get_tgt_stats(struct bsg_job *bsg_job) +#endif { scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); struct fc_bsg_reply *bsg_reply = bsg_job->reply; @@ -2864,8 +2879,13 @@ tgt_stat_out: return ret; } +#ifndef NEW_LIBFC_API +static int +qla2x00_manage_host_port(struct fc_bsg_job *bsg_job) +#else static int qla2x00_manage_host_port(struct bsg_job *bsg_job) +#endif { scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); struct fc_bsg_reply *bsg_reply = bsg_job->reply; diff --git a/qla2x00t-32gbit/qla_nvme.c b/qla2x00t-32gbit/qla_nvme.c index 4da6a9e8a..f6f8e6738 100644 --- a/qla2x00t-32gbit/qla_nvme.c +++ b/qla2x00t-32gbit/qla_nvme.c @@ -766,6 +766,14 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha) return ret; } +#else + +void qla_nvme_unregister_remote_port(struct fc_port *fcport) +{ +} + +#endif + void qla_nvme_abort_set_option(struct abort_entry_24xx *abt, srb_t *orig_sp) { struct qla_hw_data *ha; @@ -847,11 +855,3 @@ inline void qla_wait_nvme_release_cmd_kref(srb_t *orig_sp) return; kref_put(&orig_sp->cmd_kref, orig_sp->put_fn); } - -#else - -void qla_nvme_unregister_remote_port(struct fc_port *fcport) -{ -} - -#endif From 3749cf34271326599fe8c209acdde793dfa8535e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 28 Mar 2021 16:55:40 +0000 Subject: [PATCH 4/4] qla2x00t-32gbit: Minimize diffs with upstream git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9372 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_bsg.c | 99 +++++++++++++-------------------------- 1 file changed, 33 insertions(+), 66 deletions(-) diff --git a/qla2x00t-32gbit/qla_bsg.c b/qla2x00t-32gbit/qla_bsg.c index 9cc1c5a85..b37851583 100644 --- a/qla2x00t-32gbit/qla_bsg.c +++ b/qla2x00t-32gbit/qla_bsg.c @@ -152,11 +152,10 @@ qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *vha, return ret; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job) #else -static int qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) #endif { @@ -285,11 +284,10 @@ exit_fcp_prio_cfg: return ret; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_process_els(struct fc_bsg_job *bsg_job) #else -static int qla2x00_process_els(struct bsg_job *bsg_job) #endif { @@ -473,11 +471,10 @@ qla24xx_calc_ct_iocbs(uint16_t dsds) return iocbs; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_process_ct(struct fc_bsg_job *bsg_job) #else -static int qla2x00_process_ct(struct bsg_job *bsg_job) #endif { @@ -756,11 +753,10 @@ done_set_internal: return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_process_loopback(struct fc_bsg_job *bsg_job) #else -static int qla2x00_process_loopback(struct bsg_job *bsg_job) #endif { @@ -1004,11 +1000,10 @@ done_unmap_req_sg: return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla84xx_reset(struct fc_bsg_job *bsg_job) #else -static int qla84xx_reset(struct bsg_job *bsg_job) #endif { @@ -1045,11 +1040,10 @@ qla84xx_reset(struct bsg_job *bsg_job) return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla84xx_updatefw(struct fc_bsg_job *bsg_job) #else -static int qla84xx_updatefw(struct bsg_job *bsg_job) #endif { @@ -1160,11 +1154,10 @@ done_unmap_sg: return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job) #else -static int qla84xx_mgmt_cmd(struct bsg_job *bsg_job) #endif { @@ -1361,11 +1354,10 @@ exit_mgmt: return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla24xx_iidma(struct fc_bsg_job *bsg_job) #else -static int qla24xx_iidma(struct bsg_job *bsg_job) #endif { @@ -1455,12 +1447,11 @@ qla24xx_iidma(struct bsg_job *bsg_job) return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, scsi_qla_host_t *vha, uint8_t is_update) #else -static int qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha, uint8_t is_update) #endif @@ -1531,11 +1522,10 @@ qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha, return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_read_optrom(struct fc_bsg_job *bsg_job) #else -static int qla2x00_read_optrom(struct bsg_job *bsg_job) #endif { @@ -1573,11 +1563,10 @@ qla2x00_read_optrom(struct bsg_job *bsg_job) return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_update_optrom(struct fc_bsg_job *bsg_job) #else -static int qla2x00_update_optrom(struct bsg_job *bsg_job) #endif { @@ -1619,11 +1608,10 @@ qla2x00_update_optrom(struct bsg_job *bsg_job) return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_update_fru_versions(struct fc_bsg_job *bsg_job) #else -static int qla2x00_update_fru_versions(struct bsg_job *bsg_job) #endif { @@ -1677,11 +1665,10 @@ done: return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_read_fru_status(struct fc_bsg_job *bsg_job) #else -static int qla2x00_read_fru_status(struct bsg_job *bsg_job) #endif { @@ -1733,11 +1720,10 @@ done: return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_write_fru_status(struct fc_bsg_job *bsg_job) #else -static int qla2x00_write_fru_status(struct bsg_job *bsg_job) #endif { @@ -1785,11 +1771,10 @@ done: return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_write_i2c(struct fc_bsg_job *bsg_job) #else -static int qla2x00_write_i2c(struct bsg_job *bsg_job) #endif { @@ -1836,11 +1821,10 @@ done: return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_read_i2c(struct fc_bsg_job *bsg_job) #else -static int qla2x00_read_i2c(struct bsg_job *bsg_job) #endif { @@ -1891,11 +1875,10 @@ done: return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla24xx_process_bidir_cmd(struct fc_bsg_job *bsg_job) #else -static int qla24xx_process_bidir_cmd(struct bsg_job *bsg_job) #endif { @@ -2074,11 +2057,10 @@ done: return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qlafx00_mgmt_cmd(struct fc_bsg_job *bsg_job) #else -static int qlafx00_mgmt_cmd(struct bsg_job *bsg_job) #endif { @@ -2202,11 +2184,10 @@ done: return rval; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla26xx_serdes_op(struct fc_bsg_job *bsg_job) #else -static int qla26xx_serdes_op(struct bsg_job *bsg_job) #endif { @@ -2249,11 +2230,10 @@ qla26xx_serdes_op(struct bsg_job *bsg_job) return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla8044_serdes_op(struct fc_bsg_job *bsg_job) #else -static int qla8044_serdes_op(struct bsg_job *bsg_job) #endif { @@ -2296,11 +2276,10 @@ qla8044_serdes_op(struct bsg_job *bsg_job) return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla27xx_get_flash_upd_cap(struct fc_bsg_job *bsg_job) #else -static int qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job) #endif { @@ -2333,11 +2312,10 @@ qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job) return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla27xx_set_flash_upd_cap(struct fc_bsg_job *bsg_job) #else -static int qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job) #endif { @@ -2384,11 +2362,10 @@ qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job) return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla27xx_get_bbcr_data(struct fc_bsg_job *bsg_job) #else -static int qla27xx_get_bbcr_data(struct bsg_job *bsg_job) #endif { @@ -2448,11 +2425,10 @@ done: return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_get_priv_stats(struct fc_bsg_job *bsg_job) #else -static int qla2x00_get_priv_stats(struct bsg_job *bsg_job) #endif { @@ -2512,11 +2488,10 @@ qla2x00_get_priv_stats(struct bsg_job *bsg_job) return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_do_dport_diagnostics(struct fc_bsg_job *bsg_job) #else -static int qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job) #endif { @@ -2561,11 +2536,10 @@ qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job) return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_get_flash_image_status(struct fc_bsg_job *bsg_job) #else -static int qla2x00_get_flash_image_status(struct bsg_job *bsg_job) #endif { @@ -2605,11 +2579,10 @@ qla2x00_get_flash_image_status(struct bsg_job *bsg_job) return 0; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_manage_host_stats(struct fc_bsg_job *bsg_job) #else -static int qla2x00_manage_host_stats(struct bsg_job *bsg_job) #endif { @@ -2679,11 +2652,10 @@ qla2x00_manage_host_stats(struct bsg_job *bsg_job) return ret; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_get_host_stats(struct fc_bsg_job *bsg_job) #else -static int qla2x00_get_host_stats(struct bsg_job *bsg_job) #endif { @@ -2785,11 +2757,10 @@ qla2xxx_find_rport(scsi_qla_host_t *vha, uint32_t tgt_num) return NULL; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_get_tgt_stats(struct fc_bsg_job *bsg_job) #else -static int qla2x00_get_tgt_stats(struct bsg_job *bsg_job) #endif { @@ -2879,11 +2850,10 @@ tgt_stat_out: return ret; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_manage_host_port(struct fc_bsg_job *bsg_job) #else -static int qla2x00_manage_host_port(struct bsg_job *bsg_job) #endif { @@ -2942,11 +2912,10 @@ qla2x00_manage_host_port(struct bsg_job *bsg_job) return ret; } -#ifndef NEW_LIBFC_API static int +#ifndef NEW_LIBFC_API qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job) #else -static int qla2x00_process_vendor_specific(struct bsg_job *bsg_job) #endif { @@ -3040,11 +3009,10 @@ qla2x00_process_vendor_specific(struct bsg_job *bsg_job) } } -#ifndef NEW_LIBFC_API int +#ifndef NEW_LIBFC_API qla24xx_bsg_request(struct fc_bsg_job *bsg_job) #else -int qla24xx_bsg_request(struct bsg_job *bsg_job) #endif { @@ -3110,11 +3078,10 @@ skip_chip_chk: return ret; } -#ifndef NEW_LIBFC_API int +#ifndef NEW_LIBFC_API qla24xx_bsg_timeout(struct fc_bsg_job *bsg_job) #else -int qla24xx_bsg_timeout(struct bsg_job *bsg_job) #endif {