powerpc fixes for 6.0 #3

- 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, Russell Currey.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAmMAG1oTHG1wZUBlbGxl
 cm1hbi5pZC5hdQAKCRBR6+o8yOGlgOkfD/0caaEOHTJakpC1FLk1H7owpqJG/GSM
 iHpYnMu672CiqmGEiDAa20or1DwRHSThTQGgLR+nJUyB1AtGhavE7qKJ2yAJDz7I
 /vbEWtJLtLJg4SF6sIQT7AYk//GPcOCFLOKyxsDQd7sI+UWEEUdO2OpCcLkIMJw/
 JKwz3S621UDf9XMObu1dU69DNwkg37SZ9g1o60C5HrDGoP89OmgYaEs/MyqInwMX
 e4v5jvFnCYGLBsTPPx9IEHyxWMFPydPl673WuI0dDlpZ0+PaWf/4y9Yilidu14a0
 XT+hiTDFKzjJ8cDCLCZy9Ckhz0onuOM2hzqLpnnjeHoo/8NZNXDnH/jpKSuqV/6n
 OSM9tFjmQCh/3dBOU9VOPxvbz50XakWqRoY/UIhMtqVhLc9EmNX+l2Q621TBlMBK
 sd269EMTHrLUT1qyEl6zofTje6DTAPZpc4lxjLlicMtleadJuaVacVJGsikbZ/qx
 5dYFunmMGHgjrFnY3nA2hIQsFukOHLyz4KpUGIqMYMmILk6rzRRKomLAtsEoUvfD
 Y7JcaBkxO7VrypJrld1+RDSp4snOfTpx7SyhHWcVPCKfuO8fa4yAxhi+IB0QTpvL
 QiVZNMFK1U5c+lU5i9JxpX/HaMo9gQEIdgh87ws0Tg2A4scMHpT34adKWy25Gkml
 qIq+z4Zn13/Zsg==
 =Yvlp
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-6.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

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
This commit is contained in:
Linus Torvalds 2022-08-20 11:20:37 -07:00
commit 32dd68f110
3 changed files with 44 additions and 10 deletions

View File

@ -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

View File

@ -0,0 +1,20 @@
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

View File

@ -1,11 +1,21 @@
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