<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/perf/arm-cci.c, branch linux-6.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-07-06T10:02:58Z</updated>
<entry>
<title>perf/arm-cci: Use the bitmap API to allocate bitmaps</title>
<updated>2022-07-06T10:02:58Z</updated>
<author>
<name>Christophe JAILLET</name>
</author>
<published>2022-07-06T05:20:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e35850b341e88055ca11cad74efa464b2159984'/>
<id>urn:sha1:0e35850b341e88055ca11cad74efa464b2159984</id>
<content type='text'>
Use devm_bitmap_zalloc() instead of hand-writing it.
It is less verbose and it improves the semantic.

While at it, use bitmap_zero() instead of hand-writing it.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Link: https://lore.kernel.org/r/fbde85a5e8ae99b10a2115d8ea1e69320a62947f.1657084786.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf/arm-cci: fix typo in comment</title>
<updated>2022-06-23T14:44:59Z</updated>
<author>
<name>Julia Lawall</name>
</author>
<published>2022-05-21T11:11:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ba86a4746351424cb9aa8fdd2dd5f9f899df461'/>
<id>urn:sha1:9ba86a4746351424cb9aa8fdd2dd5f9f899df461</id>
<content type='text'>
Spelling mistake (triple letters) in comment.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;
Link: https://lore.kernel.org/r/20220521111145.81697-67-Julia.Lawall@inria.fr
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: replace bitmap_weight with bitmap_empty where appropriate</title>
<updated>2022-02-15T14:38:57Z</updated>
<author>
<name>Yury Norov</name>
</author>
<published>2022-02-10T22:48:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=95ed57c73bbcffa02cbb1d61c19484c2ec6de094'/>
<id>urn:sha1:95ed57c73bbcffa02cbb1d61c19484c2ec6de094</id>
<content type='text'>
In some places, drivers/perf code calls bitmap_weight() to check if any
bit of a given bitmap is set. It's better to use bitmap_empty() in that
case because bitmap_empty() stops traversing the bitmap as soon as it
finds first set bit, while bitmap_weight() counts all bits unconditionally.

Signed-off-by: Yury Norov &lt;yury.norov@gmail.com&gt;
Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Link: https://lore.kernel.org/r/20220210224933.379149-13-yury.norov@gmail.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers/perf: arm-cci: Fix checkpatch spacing error</title>
<updated>2021-05-25T17:59:23Z</updated>
<author>
<name>Junhao He</name>
</author>
<published>2021-05-11T12:27:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb2b22f024c3615d576cead56f2a7d2c90355716'/>
<id>urn:sha1:eb2b22f024c3615d576cead56f2a7d2c90355716</id>
<content type='text'>
Fix some coding style issues reported by checkpatch.pl, including
following types:

ERROR: need consistent spacing around '-' (ctx:WxV)
ERROR: space required before the open parenthesis '('

Signed-off-by: Junhao He &lt;hejunhao2@hisilicon.com&gt;
Signed-off-by: Jay Fang &lt;f.fangjian@huawei.com&gt;
Link: https://lore.kernel.org/r/1620736054-58412-5-git-send-email-f.fangjian@huawei.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers/perf: convert sysfs snprintf family to sysfs_emit</title>
<updated>2021-03-25T12:55:44Z</updated>
<author>
<name>Zihao Tang</name>
</author>
<published>2021-03-19T10:04:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=700a9cf0527ca2d7d3e4980fef2deb4883432ab6'/>
<id>urn:sha1:700a9cf0527ca2d7d3e4980fef2deb4883432ab6</id>
<content type='text'>
Fix the following coccicheck warning:

./drivers/perf/hisilicon/hisi_uncore_pmu.c:128:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/fsl_imx8_ddr_perf.c:173:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm_spe_pmu.c:129:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm_smmu_pmu.c:563:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm_dsu_pmu.c:149:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm_dsu_pmu.c:139:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm-cmn.c:563:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm-cmn.c:351:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm-ccn.c:224:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm-cci.c:708:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm-cci.c:699:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm-cci.c:528:8-16: WARNING: use scnprintf or sprintf.
./drivers/perf/arm-cci.c:309:8-16: WARNING: use scnprintf or sprintf.

Signed-off-by: Zihao Tang &lt;tangzihao1@hisilicon.com&gt;
Signed-off-by: Qi Liu &lt;liuqi115@huawei.com&gt;
Link: https://lore.kernel.org/r/1616148273-16374-2-git-send-email-liuqi115@huawei.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers/perf: Replace spin_lock_irqsave to spin_lock</title>
<updated>2021-02-10T18:50:42Z</updated>
<author>
<name>Qi Liu</name>
</author>
<published>2021-02-09T09:42:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ee37e0f97ec66b953d202257293670efaab1daa'/>
<id>urn:sha1:8ee37e0f97ec66b953d202257293670efaab1daa</id>
<content type='text'>
There is no need to do spin_lock_irqsave in context of hard IRQ, so
replace them with spin_lock.

Signed-off-by: Qi Liu &lt;liuqi115@huawei.com&gt;
Link: https://lore.kernel.org/r/1612863742-1551-1-git-send-email-liuqi115@huawei.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf: Constify static struct attribute_group</title>
<updated>2021-01-20T17:51:23Z</updated>
<author>
<name>Rikard Falkeborn</name>
</author>
<published>2021-01-17T21:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f0c140481d1b807217cacdcf11d24cfa407a7a53'/>
<id>urn:sha1:f0c140481d1b807217cacdcf11d24cfa407a7a53</id>
<content type='text'>
The only usage is to put their addresses in an array of pointers to
const struct attribute group. Make them const to allow the compiler
to put them in read-only memory.

Signed-off-by: Rikard Falkeborn &lt;rikard.falkeborn@gmail.com&gt;
Link: https://lore.kernel.org/r/20210117212847.21319-5-rikard.falkeborn@gmail.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers/perf: Prevent forced unbinding of PMU drivers</title>
<updated>2020-07-17T09:51:44Z</updated>
<author>
<name>Qi Liu</name>
</author>
<published>2020-07-17T08:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f32ed8eb0e3f0d0ef4ddb854554d60ca5863a9f9'/>
<id>urn:sha1:f32ed8eb0e3f0d0ef4ddb854554d60ca5863a9f9</id>
<content type='text'>
Forcefully unbinding PMU drivers during perf sampling will lead to
a kernel panic, because the perf upper-layer framework call a NULL
pointer in this situation.

To solve this issue, "suppress_bind_attrs" should be set to true, so
that bind/unbind can be disabled via sysfs and prevent unbinding PMU
drivers during perf sampling.

Signed-off-by: Qi Liu &lt;liuqi115@huawei.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Link: https://lore.kernel.org/r/1594975763-32966-1-git-send-email-liuqi115@huawei.com
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf/arm-cci: use devm_platform_ioremap_resource() to simplify code</title>
<updated>2019-10-01T11:28:47Z</updated>
<author>
<name>YueHaibing</name>
</author>
<published>2019-09-06T14:40:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=504db0f82660898cbb76478cb2eaee46817c85b8'/>
<id>urn:sha1:504db0f82660898cbb76478cb2eaee46817c85b8</id>
<content type='text'>
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: Will Deacon &lt;will@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf/arm-cci: Remove broken race mitigation</title>
<updated>2019-04-23T11:29:23Z</updated>
<author>
<name>Robin Murphy</name>
</author>
<published>2019-04-16T15:24:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d2e2a82d4de298d006bf8eddc86829e3c7da820'/>
<id>urn:sha1:0d2e2a82d4de298d006bf8eddc86829e3c7da820</id>
<content type='text'>
Uncore PMU drivers face an awkward cyclic dependency wherein:

 - They have to pick a valid online CPU to associate with before
   registering the PMU device, since it will get exposed to userspace
   immediately.
 - The PMU registration has to be be at least partly complete before
   hotplug events can be handled, since trying to migrate an
   uninitialised context would be bad.
 - The hotplug handler has to be ready as soon as a CPU is chosen, lest
   it go offline without the user-visible cpumask value getting updated.

The arm-cci driver has tried to solve this by using get_cpu() to pick
the current CPU and prevent it from disappearing while both
registrations are performed, but that results in taking mutexes with
preemption disabled, which makes certain configurations very unhappy:

[ 1.983337] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:2004
[ 1.983340] in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0
[ 1.983342] Preemption disabled at:
[ 1.983353] [&lt;ffffff80089801f4&gt;] cci_pmu_probe+0x1dc/0x488
[ 1.983360] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.20-rt8-yocto-preempt-rt #1
[ 1.983362] Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
[ 1.983364] Call trace:
[ 1.983369] dump_backtrace+0x0/0x158
[ 1.983372] show_stack+0x24/0x30
[ 1.983378] dump_stack+0x80/0xa4
[ 1.983383] ___might_sleep+0x138/0x160
[ 1.983386] __might_sleep+0x58/0x90
[ 1.983391] __rt_mutex_lock_state+0x30/0xc0
[ 1.983395] _mutex_lock+0x24/0x30
[ 1.983400] perf_pmu_register+0x2c/0x388
[ 1.983404] cci_pmu_probe+0x2bc/0x488
[ 1.983409] platform_drv_probe+0x58/0xa8

It is not feasible to resolve all the possible races outside of the perf
core itself, so address the immediate bug by following the example of
nearly every other PMU driver and not even trying to do so. Registering
the hotplug notifier first should minimise the window in which things
can go wrong, so that's about as much as we can reasonably do here. This
also revealed an additional race in assigning the global pointer too
late relative to the hotplug notifier, which gets fixed in the process.

Reported-by: Li, Meng &lt;Meng.Li@windriver.com&gt;
Tested-by: Corentin Labbe &lt;clabbe.montjoie@gmail.com&gt;
Reviewed-by: Suzuki K Poulose &lt;suzuki.poulose@arm.com&gt;
Signed-off-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
</feed>
