Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

RH7: PCI: hv: Fix the affinity setting for the NVMe crash #713

Merged
Merged
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
11 changes: 3 additions & 8 deletions hv-rhel7.x/hv/pci-hyperv.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,11 @@ struct irq_cfg *irqd_cfg(struct irq_data *irq_data)
}

/* Interrupt management hooks */
static int hv_set_affinity(struct irq_data *data, const struct cpumask *mask,
static int hv_set_affinity(struct irq_data *data, const struct cpumask *dest,
bool force)
{
struct msi_desc *msi_desc = data->msi_desc;
struct irq_cfg *cfg = irqd_cfg(data);
const struct cpumask *dest;
struct retarget_msi_interrupt *params;
struct hv_pcibus_device *hbus;
struct pci_bus *pbus;
Expand All @@ -827,10 +826,6 @@ static int hv_set_affinity(struct irq_data *data, const struct cpumask *mask,
u64 res;
u32 var_size = 0;

if (cpumask_equal(mask, cpu_online_mask))
dest = cfg->domain;
else
dest = mask;
ret = __ioapic_set_affinity(data, dest, &dest_id);
if (ret)
return ret;
Expand Down Expand Up @@ -880,7 +875,7 @@ static int hv_set_affinity(struct irq_data *data, const struct cpumask *mask,
*/
var_size = 1 + HV_VP_SET_BANK_COUNT_MAX;

for_each_cpu_and(cpu, dest, cpu_online_mask) {
for_each_cpu_and(cpu, cfg->domain, cpu_online_mask) {
cpu_vmbus = hv_cpu_number_to_vp_number(cpu);

if (cpu_vmbus >= HV_VP_SET_BANK_COUNT_MAX * 64) {
Expand All @@ -894,7 +889,7 @@ static int hv_set_affinity(struct irq_data *data, const struct cpumask *mask,
(1ULL << (cpu_vmbus & 63));
}
} else {
for_each_cpu_and(cpu, dest, cpu_online_mask) {
for_each_cpu_and(cpu, cfg->domain, cpu_online_mask) {
params->int_target.vp_mask |=
(1ULL << hv_cpu_number_to_vp_number(cpu));
}
Expand Down