diff --git a/qla2x00t-32gbit/qla_inline.h b/qla2x00t-32gbit/qla_inline.h index 512c3c37b..77dae3265 100644 --- a/qla2x00t-32gbit/qla_inline.h +++ b/qla2x00t-32gbit/qla_inline.h @@ -5,7 +5,14 @@ * See LICENSE.qla2xxx for copyright and licensing details. */ +#ifdef INSIDE_KERNEL_TREE +#include /* timer_setup() */ +#else +#include "backport.h" +#endif + #include "qla_target.h" + /** * qla24xx_calc_iocbs() - Determine number of Command Type 3 and * Continuation Type 1 IOCBs to allocate. diff --git a/qla2x00t-32gbit/qla_nvme.c b/qla2x00t-32gbit/qla_nvme.c index 41c85da3a..9ebdc12e7 100644 --- a/qla2x00t-32gbit/qla_nvme.c +++ b/qla2x00t-32gbit/qla_nvme.c @@ -45,7 +45,13 @@ int qla_nvme_register_remote(struct scsi_qla_host *vha, struct fc_port *fcport) req.port_name = wwn_to_u64(fcport->port_name); req.node_name = wwn_to_u64(fcport->node_name); req.port_role = 0; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) + /* + * See also commit 9dd9686b1419 ("scsi: qla2xxx: Add changes for + * devloss timeout in driver") # v4.17. + */ req.dev_loss_tmo = NVME_FC_DEV_LOSS_TMO; +#endif if (fcport->nvme_prli_service_param & NVME_PRLI_SP_INITIATOR) req.port_role = FC_PORT_ROLE_NVME_INITIATOR; @@ -629,7 +635,9 @@ static void qla_nvme_unregister_remote_port(struct work_struct *work) "%s: Notify FC-NVMe transport, set devloss=0\n", __func__); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); +#endif } list_for_each_entry_safe(qla_rport, trport, diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index aa75d3b8b..376ba0695 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -7191,7 +7191,15 @@ static int qla2xxx_map_queues(struct Scsi_Host *shost) if (USER_CTRL_IRQ(vha->hw)) rc = blk_mq_map_queues(&shost->tag_set); else +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) + /* + * See also commit f23f5bece686 ("blk-mq: Allow PCI vector + * offset for mapping queues") # v4.17. + */ + rc = blk_mq_pci_map_queues(&shost->tag_set, vha->hw->pdev); +#else rc = blk_mq_pci_map_queues(&shost->tag_set, vha->hw->pdev, 0); +#endif #endif return rc; }