Skip to content

Commit ac43e7e

Browse files
committed
Merge 4.19.154 into android-4.19-stable
Changes in 4.19.154 powerpc/tau: Check processor type before enabling TAU interrupt powerpc/tau: Disable TAU between measurements powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm RDMA/cma: Remove dead code for kernel rdmacm multicast RDMA/cma: Consolidate the destruction of a cma_multicast in one place perf intel-pt: Fix "context_switch event has no tid" error RDMA/hns: Set the unsupported wr opcode RDMA/hns: Fix missing sq_sig_type when querying QP kdb: Fix pager search for multi-line strings overflow: Include header file with SIZE_MAX declaration powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints powerpc/perf/hv-gpci: Fix starting index value cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier IB/rdmavt: Fix sizeof mismatch f2fs: wait for sysfs kobject removal before freeing f2fs_sb_info lib/crc32.c: fix trivial typo in preprocessor condition ramfs: fix nommu mmap with gaps in the page cache rapidio: fix error handling path rapidio: fix the missed put_device() for rio_mport_add_riodev mailbox: avoid timer start from callback i2c: rcar: Auto select RESET_CONTROLLER PCI: iproc: Set affinity mask on MSI interrupts rpmsg: smd: Fix a kobj leak in in qcom_smd_parse_edge() pwm: img: Fix null pointer access in probe clk: rockchip: Initialize hw to error to avoid undefined behavior clk: at91: clk-main: update key before writing AT91_CKGR_MOR clk: bcm2835: add missing release if devm_clk_hw_register fails watchdog: Fix memleak in watchdog_cdev_register watchdog: Use put_device on error watchdog: sp5100: Fix definition of EFCH_PM_DECODEEN3 svcrdma: fix bounce buffers for unaligned offsets and multiple pages ext4: limit entries returned when counting fsmap records vfio/pci: Clear token on bypass registration failure vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages SUNRPC: fix copying of multiple pages in gss_read_proxy_verf() Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume() Input: stmfts - fix a & vs && typo Input: ep93xx_keypad - fix handling of platform_get_irq() error Input: omap4-keypad - fix handling of platform_get_irq() error Input: twl4030_keypad - fix handling of platform_get_irq() error Input: sun4i-ps2 - fix handling of platform_get_irq() error KVM: x86: emulating RDPID failure shall return #UD rather than #GP netfilter: conntrack: connection timeout after re-register netfilter: nf_fwd_netdev: clear timestamp in forwarding path ARM: dts: imx6sl: fix rng node ARM: dts: sun8i: r40: bananapi-m2-ultra: Fix dcdc1 regulator memory: omap-gpmc: Fix a couple off by ones memory: omap-gpmc: Fix build error without CONFIG_OF memory: fsl-corenet-cf: Fix handling of platform_get_irq() error arm64: dts: qcom: pm8916: Remove invalid reg size from wcd_codec arm64: dts: qcom: msm8916: Fix MDP/DSI interrupts ARM: dts: owl-s500: Fix incorrect PPI interrupt specifiers arm64: dts: zynqmp: Remove additional compatible string for i2c IPs powerpc/powernv/dump: Fix race while processing OPAL dump nvmet: fix uninitialized work for zero kato NTB: hw: amd: fix an issue about leak system resources sched/features: Fix !CONFIG_JUMP_LABEL case perf: correct SNOOPX field offset i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs block: ratelimit handle_bad_sector() message crypto: ccp - fix error handling media: firewire: fix memory leak media: ati_remote: sanity check for both endpoints media: st-delta: Fix reference count leak in delta_run_work media: sti: Fix reference count leaks media: exynos4-is: Fix several reference count leaks due to pm_runtime_get_sync media: exynos4-is: Fix a reference count leak due to pm_runtime_get_sync media: exynos4-is: Fix a reference count leak media: vsp1: Fix runtime PM imbalance on error media: platform: s3c-camif: Fix runtime PM imbalance on error media: platform: sti: hva: Fix runtime PM imbalance on error media: bdisp: Fix runtime PM imbalance on error media: media/pci: prevent memory leak in bttv_probe media: uvcvideo: Ensure all probed info is returned to v4l2 mmc: sdio: Check for CISTPL_VERS_1 buffer size media: saa7134: avoid a shift overflow fs: dlm: fix configfs memory leak media: venus: core: Fix runtime PM imbalance in venus_probe ntfs: add check for mft record size in superblock ip_gre: set dev->hard_header_len and dev->needed_headroom properly mac80211: handle lack of sband->bitrates in rates PM: hibernate: remove the bogus call to get_gendisk() in software_resume() scsi: mvumi: Fix error return in mvumi_io_attach() scsi: target: core: Add CONTROL field for trace events mic: vop: copy data to kernel space then write to io memory misc: vop: add round_up(x,4) for vring_size to avoid kernel panic usb: gadget: function: printer: fix use-after-free in __lock_acquire udf: Limit sparing table size udf: Avoid accessing uninitialized data on failed inode read USB: cdc-acm: handle broken union descriptors usb: dwc3: simple: add support for Hikey 970 can: flexcan: flexcan_chip_stop(): add error handling and propagate error value ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs() misc: rtsx: Fix memory leak in rtsx_pci_probe reiserfs: only call unlock_new_inode() if I_NEW xfs: make sure the rt allocator doesn't run off the end usb: ohci: Default to per-port over-current protection Bluetooth: Only mark socket zapped after unlocking scsi: ibmvfc: Fix error return in ibmvfc_probe() brcmsmac: fix memory leak in wlc_phy_attach_lcnphy rtl8xxxu: prevent potential memory leak Fix use after free in get_capset_info callback. scsi: qedi: Protect active command list to avoid list corruption scsi: qedi: Fix list_del corruption while removing active I/O tty: ipwireless: fix error handling ipvs: Fix uninit-value in do_ip_vs_set_ctl() reiserfs: Fix memory leak in reiserfs_parse_options() mwifiex: don't call del_timer_sync() on uninitialized timer brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach usb: core: Solve race condition in anchor cleanup functions scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config() ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n() net: korina: cast KSEG0 address to pointer in kfree tty: serial: fsl_lpuart: fix lpuart32_poll_get_char usb: cdc-acm: add quirk to blacklist ETAS ES58X devices USB: cdc-wdm: Make wdm_flush() interruptible and add wdm_fsync(). eeprom: at25: set minimum read/write access stride to 1 usb: gadget: f_ncm: allow using NCM in SuperSpeed Plus gadgets. Linux 4.19.154 Signed-off-by: Greg Kroah-Hartman <[email protected]> Change-Id: I242a1afee6c5297423afd0f11e81f9a9f14ded77
2 parents ca12e94 + f5d8eef commit ac43e7e

File tree

122 files changed

+808
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+808
-450
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 4
33
PATCHLEVEL = 19
4-
SUBLEVEL = 153
4+
SUBLEVEL = 154
55
EXTRAVERSION =
66
NAME = "People's Front"
77

arch/arm/boot/dts/imx6sl.dtsi

+2
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,10 @@
922922
};
923923

924924
rngb: rngb@21b4000 {
925+
compatible = "fsl,imx6sl-rngb", "fsl,imx25-rngb";
925926
reg = <0x021b4000 0x4000>;
926927
interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
928+
clocks = <&clks IMX6SL_CLK_DUMMY>;
927929
};
928930

929931
weim: weim@21b8000 {

arch/arm/boot/dts/owl-s500.dtsi

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,21 @@
8585
global_timer: timer@b0020200 {
8686
compatible = "arm,cortex-a9-global-timer";
8787
reg = <0xb0020200 0x100>;
88-
interrupts = <GIC_PPI 0 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
88+
interrupts = <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
8989
status = "disabled";
9090
};
9191

9292
twd_timer: timer@b0020600 {
9393
compatible = "arm,cortex-a9-twd-timer";
9494
reg = <0xb0020600 0x20>;
95-
interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
95+
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
9696
status = "disabled";
9797
};
9898

9999
twd_wdt: wdt@b0020620 {
100100
compatible = "arm,cortex-a9-twd-wdt";
101101
reg = <0xb0020620 0xe0>;
102-
interrupts = <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
102+
interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>;
103103
status = "disabled";
104104
};
105105

arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts

+5-5
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@
206206
};
207207

208208
&reg_dc1sw {
209-
regulator-min-microvolt = <3000000>;
210-
regulator-max-microvolt = <3000000>;
209+
regulator-min-microvolt = <3300000>;
210+
regulator-max-microvolt = <3300000>;
211211
regulator-name = "vcc-gmac-phy";
212212
};
213213

214214
&reg_dcdc1 {
215215
regulator-always-on;
216-
regulator-min-microvolt = <3000000>;
217-
regulator-max-microvolt = <3000000>;
218-
regulator-name = "vcc-3v0";
216+
regulator-min-microvolt = <3300000>;
217+
regulator-max-microvolt = <3300000>;
218+
regulator-name = "vcc-3v3";
219219
};
220220

221221
&reg_dcdc2 {

arch/arm64/boot/dts/qcom/msm8916.dtsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@
877877
reg-names = "mdp_phys";
878878

879879
interrupt-parent = <&mdss>;
880-
interrupts = <0 0>;
880+
interrupts = <0>;
881881

882882
clocks = <&gcc GCC_MDSS_AHB_CLK>,
883883
<&gcc GCC_MDSS_AXI_CLK>,
@@ -909,7 +909,7 @@
909909
reg-names = "dsi_ctrl";
910910

911911
interrupt-parent = <&mdss>;
912-
interrupts = <4 0>;
912+
interrupts = <4>;
913913

914914
assigned-clocks = <&gcc BYTE0_CLK_SRC>,
915915
<&gcc PCLK0_CLK_SRC>;

arch/arm64/boot/dts/qcom/pm8916.dtsi

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
wcd_codec: codec@f000 {
101101
compatible = "qcom,pm8916-wcd-analog-codec";
102-
reg = <0xf000 0x200>;
102+
reg = <0xf000>;
103103
reg-names = "pmic-codec-core";
104104
clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>;
105105
clock-names = "mclk";

arch/arm64/boot/dts/xilinx/zynqmp.dtsi

+2-2
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
};
412412

413413
i2c0: i2c@ff020000 {
414-
compatible = "cdns,i2c-r1p14", "cdns,i2c-r1p10";
414+
compatible = "cdns,i2c-r1p14";
415415
status = "disabled";
416416
interrupt-parent = <&gic>;
417417
interrupts = <0 17 4>;
@@ -421,7 +421,7 @@
421421
};
422422

423423
i2c1: i2c@ff030000 {
424-
compatible = "cdns,i2c-r1p14", "cdns,i2c-r1p10";
424+
compatible = "cdns,i2c-r1p14";
425425
status = "disabled";
426426
interrupt-parent = <&gic>;
427427
interrupts = <0 18 4>;

arch/powerpc/include/asm/tlb.h

-13
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,6 @@ static inline int mm_is_thread_local(struct mm_struct *mm)
7676
return false;
7777
return cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm));
7878
}
79-
static inline void mm_reset_thread_local(struct mm_struct *mm)
80-
{
81-
WARN_ON(atomic_read(&mm->context.copros) > 0);
82-
/*
83-
* It's possible for mm_access to take a reference on mm_users to
84-
* access the remote mm from another thread, but it's not allowed
85-
* to set mm_cpumask, so mm_users may be > 1 here.
86-
*/
87-
WARN_ON(current->mm != mm);
88-
atomic_set(&mm->context.active_cpus, 1);
89-
cpumask_clear(mm_cpumask(mm));
90-
cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
91-
}
9279
#else /* CONFIG_PPC_BOOK3S_64 */
9380
static inline int mm_is_thread_local(struct mm_struct *mm)
9481
{

arch/powerpc/kernel/tau_6xx.c

+37-59
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static struct tau_temp
4040
unsigned char grew;
4141
} tau[NR_CPUS];
4242

43-
#undef DEBUG
43+
static bool tau_int_enable;
4444

4545
/* TODO: put these in a /proc interface, with some sanity checks, and maybe
4646
* dynamic adjustment to minimize # of interrupts */
@@ -54,62 +54,44 @@ static struct tau_temp
5454

5555
static void set_thresholds(unsigned long cpu)
5656
{
57-
#ifdef CONFIG_TAU_INT
58-
/*
59-
* setup THRM1,
60-
* threshold, valid bit, enable interrupts, interrupt when below threshold
61-
*/
62-
mtspr(SPRN_THRM1, THRM1_THRES(tau[cpu].low) | THRM1_V | THRM1_TIE | THRM1_TID);
57+
u32 maybe_tie = tau_int_enable ? THRM1_TIE : 0;
6358

64-
/* setup THRM2,
65-
* threshold, valid bit, enable interrupts, interrupt when above threshold
66-
*/
67-
mtspr (SPRN_THRM2, THRM1_THRES(tau[cpu].high) | THRM1_V | THRM1_TIE);
68-
#else
69-
/* same thing but don't enable interrupts */
70-
mtspr(SPRN_THRM1, THRM1_THRES(tau[cpu].low) | THRM1_V | THRM1_TID);
71-
mtspr(SPRN_THRM2, THRM1_THRES(tau[cpu].high) | THRM1_V);
72-
#endif
59+
/* setup THRM1, threshold, valid bit, interrupt when below threshold */
60+
mtspr(SPRN_THRM1, THRM1_THRES(tau[cpu].low) | THRM1_V | maybe_tie | THRM1_TID);
61+
62+
/* setup THRM2, threshold, valid bit, interrupt when above threshold */
63+
mtspr(SPRN_THRM2, THRM1_THRES(tau[cpu].high) | THRM1_V | maybe_tie);
7364
}
7465

7566
static void TAUupdate(int cpu)
7667
{
77-
unsigned thrm;
78-
79-
#ifdef DEBUG
80-
printk("TAUupdate ");
81-
#endif
68+
u32 thrm;
69+
u32 bits = THRM1_TIV | THRM1_TIN | THRM1_V;
8270

8371
/* if both thresholds are crossed, the step_sizes cancel out
8472
* and the window winds up getting expanded twice. */
85-
if((thrm = mfspr(SPRN_THRM1)) & THRM1_TIV){ /* is valid? */
86-
if(thrm & THRM1_TIN){ /* crossed low threshold */
87-
if (tau[cpu].low >= step_size){
88-
tau[cpu].low -= step_size;
89-
tau[cpu].high -= (step_size - window_expand);
90-
}
91-
tau[cpu].grew = 1;
92-
#ifdef DEBUG
93-
printk("low threshold crossed ");
94-
#endif
73+
thrm = mfspr(SPRN_THRM1);
74+
if ((thrm & bits) == bits) {
75+
mtspr(SPRN_THRM1, 0);
76+
77+
if (tau[cpu].low >= step_size) {
78+
tau[cpu].low -= step_size;
79+
tau[cpu].high -= (step_size - window_expand);
9580
}
81+
tau[cpu].grew = 1;
82+
pr_debug("%s: low threshold crossed\n", __func__);
9683
}
97-
if((thrm = mfspr(SPRN_THRM2)) & THRM1_TIV){ /* is valid? */
98-
if(thrm & THRM1_TIN){ /* crossed high threshold */
99-
if (tau[cpu].high <= 127-step_size){
100-
tau[cpu].low += (step_size - window_expand);
101-
tau[cpu].high += step_size;
102-
}
103-
tau[cpu].grew = 1;
104-
#ifdef DEBUG
105-
printk("high threshold crossed ");
106-
#endif
84+
thrm = mfspr(SPRN_THRM2);
85+
if ((thrm & bits) == bits) {
86+
mtspr(SPRN_THRM2, 0);
87+
88+
if (tau[cpu].high <= 127 - step_size) {
89+
tau[cpu].low += (step_size - window_expand);
90+
tau[cpu].high += step_size;
10791
}
92+
tau[cpu].grew = 1;
93+
pr_debug("%s: high threshold crossed\n", __func__);
10894
}
109-
110-
#ifdef DEBUG
111-
printk("grew = %d\n", tau[cpu].grew);
112-
#endif
11395
}
11496

11597
#ifdef CONFIG_TAU_INT
@@ -134,17 +116,16 @@ void TAUException(struct pt_regs * regs)
134116
static void tau_timeout(void * info)
135117
{
136118
int cpu;
137-
unsigned long flags;
138119
int size;
139120
int shrink;
140121

141-
/* disabling interrupts *should* be okay */
142-
local_irq_save(flags);
143122
cpu = smp_processor_id();
144123

145-
#ifndef CONFIG_TAU_INT
146-
TAUupdate(cpu);
147-
#endif
124+
if (!tau_int_enable)
125+
TAUupdate(cpu);
126+
127+
/* Stop thermal sensor comparisons and interrupts */
128+
mtspr(SPRN_THRM3, 0);
148129

149130
size = tau[cpu].high - tau[cpu].low;
150131
if (size > min_window && ! tau[cpu].grew) {
@@ -167,18 +148,12 @@ static void tau_timeout(void * info)
167148

168149
set_thresholds(cpu);
169150

170-
/*
171-
* Do the enable every time, since otherwise a bunch of (relatively)
172-
* complex sleep code needs to be added. One mtspr every time
173-
* tau_timeout is called is probably not a big deal.
174-
*
151+
/* Restart thermal sensor comparisons and interrupts.
175152
* The "PowerPC 740 and PowerPC 750 Microprocessor Datasheet"
176153
* recommends that "the maximum value be set in THRM3 under all
177154
* conditions."
178155
*/
179156
mtspr(SPRN_THRM3, THRM3_SITV(0x1fff) | THRM3_E);
180-
181-
local_irq_restore(flags);
182157
}
183158

184159
static struct workqueue_struct *tau_workq;
@@ -225,6 +200,9 @@ static int __init TAU_init(void)
225200
return 1;
226201
}
227202

203+
tau_int_enable = IS_ENABLED(CONFIG_TAU_INT) &&
204+
!strcmp(cur_cpu_spec->platform, "ppc750");
205+
228206
tau_workq = alloc_workqueue("tau", WQ_UNBOUND, 1);
229207
if (!tau_workq)
230208
return -ENOMEM;
@@ -234,7 +212,7 @@ static int __init TAU_init(void)
234212
queue_work(tau_workq, &tau_work);
235213

236214
pr_info("Thermal assist unit using %s, shrink_timer: %d ms\n",
237-
IS_ENABLED(CONFIG_TAU_INT) ? "interrupts" : "workqueue", shrink_timer);
215+
tau_int_enable ? "interrupts" : "workqueue", shrink_timer);
238216
tau_initialized = 1;
239217

240218
return 0;

arch/powerpc/mm/tlb-radix.c

+16-7
Original file line numberDiff line numberDiff line change
@@ -598,19 +598,29 @@ static void do_exit_flush_lazy_tlb(void *arg)
598598
struct mm_struct *mm = arg;
599599
unsigned long pid = mm->context.id;
600600

601+
/*
602+
* A kthread could have done a mmget_not_zero() after the flushing CPU
603+
* checked mm_is_singlethreaded, and be in the process of
604+
* kthread_use_mm when interrupted here. In that case, current->mm will
605+
* be set to mm, because kthread_use_mm() setting ->mm and switching to
606+
* the mm is done with interrupts off.
607+
*/
601608
if (current->mm == mm)
602-
return; /* Local CPU */
609+
goto out_flush;
603610

604611
if (current->active_mm == mm) {
605-
/*
606-
* Must be a kernel thread because sender is single-threaded.
607-
*/
608-
BUG_ON(current->mm);
612+
WARN_ON_ONCE(current->mm != NULL);
613+
/* Is a kernel thread and is using mm as the lazy tlb */
609614
mmgrab(&init_mm);
610-
switch_mm(mm, &init_mm, current);
611615
current->active_mm = &init_mm;
616+
switch_mm_irqs_off(mm, &init_mm, current);
612617
mmdrop(mm);
613618
}
619+
620+
atomic_dec(&mm->context.active_cpus);
621+
cpumask_clear_cpu(smp_processor_id(), mm_cpumask(mm));
622+
623+
out_flush:
614624
_tlbiel_pid(pid, RIC_FLUSH_ALL);
615625
}
616626

@@ -625,7 +635,6 @@ static void exit_flush_lazy_tlbs(struct mm_struct *mm)
625635
*/
626636
smp_call_function_many(mm_cpumask(mm), do_exit_flush_lazy_tlb,
627637
(void *)mm, 1);
628-
mm_reset_thread_local(mm);
629638
}
630639

631640
void radix__flush_tlb_mm(struct mm_struct *mm)

arch/powerpc/perf/hv-gpci-requests.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ REQUEST(__field(0, 8, partition_id)
9595

9696
#define REQUEST_NAME system_performance_capabilities
9797
#define REQUEST_NUM 0x40
98-
#define REQUEST_IDX_KIND "starting_index=0xffffffffffffffff"
98+
#define REQUEST_IDX_KIND "starting_index=0xffffffff"
9999
#include I(REQUEST_BEGIN)
100100
REQUEST(__field(0, 1, perf_collect_privileged)
101101
__field(0x1, 1, capability_mask)
@@ -223,7 +223,7 @@ REQUEST(__field(0, 2, partition_id)
223223

224224
#define REQUEST_NAME system_hypervisor_times
225225
#define REQUEST_NUM 0xF0
226-
#define REQUEST_IDX_KIND "starting_index=0xffffffffffffffff"
226+
#define REQUEST_IDX_KIND "starting_index=0xffffffff"
227227
#include I(REQUEST_BEGIN)
228228
REQUEST(__count(0, 8, time_spent_to_dispatch_virtual_processors)
229229
__count(0x8, 8, time_spent_processing_virtual_processor_timers)
@@ -234,7 +234,7 @@ REQUEST(__count(0, 8, time_spent_to_dispatch_virtual_processors)
234234

235235
#define REQUEST_NAME system_tlbie_count_and_time
236236
#define REQUEST_NUM 0xF4
237-
#define REQUEST_IDX_KIND "starting_index=0xffffffffffffffff"
237+
#define REQUEST_IDX_KIND "starting_index=0xffffffff"
238238
#include I(REQUEST_BEGIN)
239239
REQUEST(__count(0, 8, tlbie_instructions_issued)
240240
/*

arch/powerpc/perf/isa207-common.c

+10
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,15 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp)
273273

274274
mask |= CNST_PMC_MASK(pmc);
275275
value |= CNST_PMC_VAL(pmc);
276+
277+
/*
278+
* PMC5 and PMC6 are used to count cycles and instructions and
279+
* they do not support most of the constraint bits. Add a check
280+
* to exclude PMC5/6 from most of the constraints except for
281+
* EBB/BHRB.
282+
*/
283+
if (pmc >= 5)
284+
goto ebb_bhrb;
276285
}
277286

278287
if (pmc <= 4) {
@@ -331,6 +340,7 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp)
331340
}
332341
}
333342

343+
ebb_bhrb:
334344
if (!pmc && ebb)
335345
/* EBB events must specify the PMC */
336346
return -1;

0 commit comments

Comments
 (0)