Unverified Commit b31404af authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!2873 Fix SAS start error with maxcpus=1

Merge Pull Request from: @cloudyyy1234 
 
For description	about the feature, see the following issue:
#I8GYPY

 
 
Link:https://gitee.com/openeuler/kernel/pulls/2873

 

Reviewed-by: default avatarZhang Jianhua <chris.zjh@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents 345ae9a0 e69fe475
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1274,7 +1274,7 @@ static int its_select_cpu(struct irq_data *d,

		cpu = cpumask_pick_least_loaded(d, tmpmask);
	} else {
		cpumask_and(tmpmask, irq_data_get_affinity_mask(d), cpu_online_mask);
		cpumask_copy(tmpmask, aff_mask);

		/* If we cannot cross sockets, limit the search to that node */
		if ((its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) &&
+20 −1
Original line number Diff line number Diff line
@@ -224,10 +224,29 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
	struct irq_chip *chip = irq_data_get_irq_chip(data);
	int ret;

	static DEFINE_RAW_SPINLOCK(tmp_mask_lock);
	static struct cpumask tmp_mask;

	if (!chip || !chip->irq_set_affinity)
		return -EINVAL;

	raw_spin_lock(&tmp_mask_lock);

	/*
	 * Make sure we only provide online CPUs to the irqchip,
	 * unless we are being asked to force the affinity (in which
	 * case we do as we are told).
	 */
	cpumask_and(&tmp_mask, mask, cpu_online_mask);
	if (!force && !cpumask_empty(&tmp_mask))
		ret = chip->irq_set_affinity(data, &tmp_mask, force);
	else if (force)
		ret = chip->irq_set_affinity(data, mask, force);
	else
		ret = -EINVAL;

	raw_spin_unlock(&tmp_mask_lock);

	switch (ret) {
	case IRQ_SET_MASK_OK:
	case IRQ_SET_MASK_OK_DONE:
+15 −0
Original line number Diff line number Diff line
@@ -457,6 +457,21 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
			irqd_clr_can_reserve(irq_data);
			if (domain->flags & IRQ_DOMAIN_MSI_NOMASK_QUIRK)
				irqd_set_msi_nomask_quirk(irq_data);

			/*
			 * If the interrupt is managed but no CPU is available
			 * to service it, shut it down until better times. Note
			 * that we only do this on the !RESERVE path as x86
			 * (the only architecture using this flag) deals with
			 * this in a different way by using a catch-all vector.
			 */
			if ((info->flags & MSI_FLAG_ACTIVATE_EARLY) &&
			    irqd_affinity_is_managed(irq_data) &&
			    !cpumask_intersects(irq_data_get_affinity_mask(irq_data),
						cpu_online_mask)) {
				irqd_set_managed_shutdown(irq_data);
				return 0;
			}
		}
		ret = irq_domain_activate_irq(irq_data, can_reserve);
		if (ret)