Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update qla2x00t-32gbit to Linux Kernel v6.4 #166

Merged
merged 3 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions qla2x00t-32gbit/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#ifndef __QLA_DEF_H
#define __QLA_DEF_H

#ifndef INSIDE_KERNEL_TREE
#include <linux/version.h>
#endif
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
Expand All @@ -22,7 +25,9 @@
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/firmware.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
#include <linux/aer.h>
#endif
#include <linux/mutex.h>
#include <linux/btree.h>
#include <linux/version.h>
Expand Down Expand Up @@ -3843,6 +3848,7 @@ struct qla_qpair {
uint64_t retry_term_jiff;
struct qla_tgt_counters tgt_counters;
uint16_t cpuid;
bool cpu_mapped;
struct qla_fw_resources fwres ____cacheline_aligned;
struct qla_buf_pool buf_pool;
u32 cmd_cnt;
Expand Down
9 changes: 3 additions & 6 deletions qla2x00t-32gbit/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -9428,12 +9428,9 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos,
qpair->req = ha->req_q_map[req_id];
qpair->rsp->req = qpair->req;
qpair->rsp->qpair = qpair;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5))
/* init qpair to this cpu. Will adjust at run time. */
qla_cpu_update(qpair, raw_smp_processor_id());
#endif

if (!qpair->cpu_mapped)
qla_cpu_update(qpair, raw_smp_processor_id());

if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) {
if (ha->fw_attributes & BIT_4)
Expand Down
3 changes: 3 additions & 0 deletions qla2x00t-32gbit/qla_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,14 @@ qla_mapq_init_qp_cpu_map(struct qla_hw_data *ha,
if (!ha->qp_cpu_map)
return;
mask = pci_irq_get_affinity(ha->pdev, msix->vector_base0);
if (!mask)
return;
qpair->cpuid = cpumask_first(mask);
for_each_cpu(cpu, mask) {
ha->qp_cpu_map[cpu] = qpair;
}
msix->cpuid = qpair->cpuid;
qpair->cpu_mapped = true;
#endif
}

Expand Down
11 changes: 4 additions & 7 deletions qla2x00t-32gbit/qla_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3791,14 +3791,11 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
if (!ha->flags.fw_started)
return;

if (rsp->qpair->cpuid != raw_smp_processor_id() ||
!rsp->qpair->rcv_intr) {
if (rsp->qpair->cpuid != raw_smp_processor_id() || !rsp->qpair->rcv_intr) {
rsp->qpair->rcv_intr = 1;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5))
qla_cpu_update(rsp->qpair, raw_smp_processor_id());
#endif

if (!rsp->qpair->cpu_mapped)
qla_cpu_update(rsp->qpair, raw_smp_processor_id());
}

#define __update_rsp_in(_is_shadow_hba, _rsp, _rsp_in) \
Expand Down
6 changes: 6 additions & 0 deletions qla2x00t-32gbit/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -3010,8 +3010,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
ql2xallocfwdump = 0;
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
/* This may fail but that's ok */
pci_enable_pcie_error_reporting(pdev);
#endif

ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL);
if (!ha) {
Expand Down Expand Up @@ -4022,7 +4024,9 @@ qla2x00_remove_one(struct pci_dev *pdev)
pci_release_selected_regions(ha->pdev, ha->bars);
kfree(ha);

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
pci_disable_pcie_error_reporting(pdev);
#endif

pci_disable_device(pdev);
}
Expand Down Expand Up @@ -6899,7 +6903,9 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work)
qla2x00_unmap_iobases(ha);

pci_release_selected_regions(ha->pdev, ha->bars);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
pci_disable_pcie_error_reporting(pdev);
#endif
pci_disable_device(pdev);

/*
Expand Down