Commit 32dd68f1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fixes from Michael Ellerman:

 - Fix atomic sleep warnings at boot due to get_phb_number() taking a
   mutex with a spinlock held on some machines.

 - Add missing PMU selftests to .gitignores.

Thanks to Guenter Roeck and Russell Currey.

* tag 'powerpc-6.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  selftests/powerpc: Add missing PMU selftests to .gitignores
  powerpc/pci: Fix get_phb_number() locking
parents f31c32ef f889a2e8
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -68,10 +68,6 @@ void __init set_pci_dma_ops(const struct dma_map_ops *dma_ops)
	pci_dma_ops = dma_ops;
}

/*
 * This function should run under locking protection, specifically
 * hose_spinlock.
 */
static int get_phb_number(struct device_node *dn)
{
	int ret, phb_id = -1;
@@ -108,15 +104,20 @@ static int get_phb_number(struct device_node *dn)
	if (!ret)
		phb_id = (int)(prop & (MAX_PHBS - 1));

	spin_lock(&hose_spinlock);

	/* We need to be sure to not use the same PHB number twice. */
	if ((phb_id >= 0) && !test_and_set_bit(phb_id, phb_bitmap))
		return phb_id;
		goto out_unlock;

	/* If everything fails then fallback to dynamic PHB numbering. */
	phb_id = find_first_zero_bit(phb_bitmap, MAX_PHBS);
	BUG_ON(phb_id >= MAX_PHBS);
	set_bit(phb_id, phb_bitmap);

out_unlock:
	spin_unlock(&hose_spinlock);

	return phb_id;
}

@@ -127,10 +128,13 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
	phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
	if (phb == NULL)
		return NULL;
	spin_lock(&hose_spinlock);

	phb->global_number = get_phb_number(dev);

	spin_lock(&hose_spinlock);
	list_add_tail(&phb->list_node, &hose_list);
	spin_unlock(&hose_spinlock);

	phb->dn = dev;
	phb->is_dynamic = slab_is_available();
#ifdef CONFIG_PPC64
+20 −0
Original line number Diff line number Diff line
blacklisted_events_test
event_alternatives_tests_p10
event_alternatives_tests_p9
generic_events_valid_test
group_constraint_cache_test
group_constraint_l2l3_sel_test
group_constraint_mmcra_sample_test
group_constraint_pmc56_test
group_constraint_pmc_count_test
group_constraint_radix_scope_qual_test
group_constraint_repeat_test
group_constraint_thresh_cmp_test
group_constraint_thresh_ctl_test
group_constraint_thresh_sel_test
group_constraint_unit_test
group_pmc56_exclude_constraints_test
hw_cache_event_type_test
invalid_event_code_test
reserved_bits_mmcra_sample_elig_mode_test
reserved_bits_mmcra_thresh_ctl_test
+14 −4
Original line number Diff line number Diff line
mmcr0_exceptionbits_test
bhrb_filter_map_test
bhrb_no_crash_wo_pmu_test
intr_regs_no_crash_wo_pmu_test
mmcr0_cc56run_test
mmcr0_pmccext_test
mmcr0_pmcjce_test
mmcr0_exceptionbits_test
mmcr0_fc56_pmc1ce_test
mmcr0_fc56_pmc56_test
mmcr0_pmccext_test
mmcr0_pmcjce_test
mmcr1_comb_test
mmcr2_l2l3_test
mmcr1_sel_unit_cache_test
mmcr2_fcs_fch_test
mmcr2_l2l3_test
mmcr3_src_test
mmcra_bhrb_any_test
mmcra_bhrb_cond_test
mmcra_bhrb_disable_no_branch_test
mmcra_bhrb_disable_test
mmcra_bhrb_ind_call_test
mmcra_thresh_cmp_test
mmcra_thresh_marked_sample_test