<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/soc/qcom, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-02-15T22:30:34Z</updated>
<entry>
<title>soc: qcom: llcc-slice: Fix typos</title>
<updated>2019-02-15T22:30:34Z</updated>
<author>
<name>Andy Gross</name>
<email>andy.gross@linaro.org</email>
</author>
<published>2019-02-15T22:30:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=32616b2121f75f40f66eefa04cc49052200c4181'/>
<id>urn:sha1:32616b2121f75f40f66eefa04cc49052200c4181</id>
<content type='text'>
This patch fixes typos in the llcc-slice driver.

Fixes: 72d1cd033154 ("qcom: soc: llcc-slice: Clear the global drv_data pointer on error")

Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>qcom: soc: llcc-slice: Consolidate some code</title>
<updated>2019-02-12T21:27:17Z</updated>
<author>
<name>Jordan Crouse</name>
<email>jcrouse@codeaurora.org</email>
</author>
<published>2018-12-11T20:07:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ed10a259faa1bbdf77b8c2153b274b70c90cbb35'/>
<id>urn:sha1:ed10a259faa1bbdf77b8c2153b274b70c90cbb35</id>
<content type='text'>
Make the code a little bit clearer (and use less gotos)
by consolidating some of the initialization.

Signed-off-by: Jordan Crouse &lt;jcrouse@codeaurora.org&gt;
Reviewed-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>qcom: soc: llcc-slice: Clear the global drv_data pointer on error</title>
<updated>2019-02-12T21:27:14Z</updated>
<author>
<name>Jordan Crouse</name>
<email>jcrouse@codeaurora.org</email>
</author>
<published>2018-12-11T20:07:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=72d1cd033154f50e77cd4feb4e16c227b598632e'/>
<id>urn:sha1:72d1cd033154f50e77cd4feb4e16c227b598632e</id>
<content type='text'>
Currently the data structure for llc-slice is devm allocated and
stored as a global but never cleared if the probe function fails.
This is a problem because devm managed memory gets freed on probe
failure the API functions could access the pointer after it has been
freed.

Initialize the drv_data pointer to an error and reset it to an error
on probe failure or device destroy and add protection to the API
functions to make sure the memory doesn't get accessed.

Signed-off-by: Jordan Crouse &lt;jcrouse@codeaurora.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: smd-rpm: Add sdm660 compatible</title>
<updated>2019-02-01T22:08:58Z</updated>
<author>
<name>Craig Tatlor</name>
<email>ctatlor97@gmail.com</email>
</author>
<published>2018-08-11T16:24:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4e2256d31f0f24107c36dae35a1d84dff0fced30'/>
<id>urn:sha1:4e2256d31f0f24107c36dae35a1d84dff0fced30</id>
<content type='text'>
Add the compatible for the RPM in SDM660, so that rpm resources can be
made available.

Signed-off-by: Craig Tatlor &lt;ctatlor97@gmail.com&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: gsbi: Fix error handling in gsbi_probe()</title>
<updated>2019-02-01T22:08:52Z</updated>
<author>
<name>Alexey Khoroshilov</name>
<email>khoroshilov@ispras.ru</email>
</author>
<published>2018-12-07T22:57:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8cd09a3dd3e176c62da67efcd477a44a8d87185e'/>
<id>urn:sha1:8cd09a3dd3e176c62da67efcd477a44a8d87185e</id>
<content type='text'>
If of_platform_populate() fails in gsbi_probe(),
gsbi-&gt;hclk is left undisabled.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: rpmh: Avoid accessing freed memory from batch API</title>
<updated>2019-02-01T22:08:45Z</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2019-01-15T22:54:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=baef1c90aac7e5bf13f0360a3b334825a23d31a1'/>
<id>urn:sha1:baef1c90aac7e5bf13f0360a3b334825a23d31a1</id>
<content type='text'>
Using the batch API from the interconnect driver sometimes leads to a
KASAN error due to an access to freed memory. This is easier to trigger
with threadirqs on the kernel commandline.

 BUG: KASAN: use-after-free in rpmh_tx_done+0x114/0x12c
 Read of size 1 at addr fffffff51414ad84 by task irq/110-apps_rs/57

 CPU: 0 PID: 57 Comm: irq/110-apps_rs Tainted: G        W         4.19.10 #72
 Call trace:
  dump_backtrace+0x0/0x2f8
  show_stack+0x20/0x2c
  __dump_stack+0x20/0x28
  dump_stack+0xcc/0x10c
  print_address_description+0x74/0x240
  kasan_report+0x250/0x26c
  __asan_report_load1_noabort+0x20/0x2c
  rpmh_tx_done+0x114/0x12c
  tcs_tx_done+0x450/0x768
  irq_forced_thread_fn+0x58/0x9c
  irq_thread+0x120/0x1dc
  kthread+0x248/0x260
  ret_from_fork+0x10/0x18

 Allocated by task 385:
  kasan_kmalloc+0xac/0x148
  __kmalloc+0x170/0x1e4
  rpmh_write_batch+0x174/0x540
  qcom_icc_set+0x8dc/0x9ac
  icc_set+0x288/0x2e8
  a6xx_gmu_stop+0x320/0x3c0
  a6xx_pm_suspend+0x108/0x124
  adreno_suspend+0x50/0x60
  pm_generic_runtime_suspend+0x60/0x78
  __rpm_callback+0x214/0x32c
  rpm_callback+0x54/0x184
  rpm_suspend+0x3f8/0xa90
  pm_runtime_work+0xb4/0x178
  process_one_work+0x544/0xbc0
  worker_thread+0x514/0x7d0
  kthread+0x248/0x260
  ret_from_fork+0x10/0x18

 Freed by task 385:
  __kasan_slab_free+0x12c/0x1e0
  kasan_slab_free+0x10/0x1c
  kfree+0x134/0x588
  rpmh_write_batch+0x49c/0x540
  qcom_icc_set+0x8dc/0x9ac
  icc_set+0x288/0x2e8
  a6xx_gmu_stop+0x320/0x3c0
  a6xx_pm_suspend+0x108/0x124
  adreno_suspend+0x50/0x60
 cr50_spi spi5.0: SPI transfer timed out
  pm_generic_runtime_suspend+0x60/0x78
  __rpm_callback+0x214/0x32c
  rpm_callback+0x54/0x184
  rpm_suspend+0x3f8/0xa90
  pm_runtime_work+0xb4/0x178
  process_one_work+0x544/0xbc0
  worker_thread+0x514/0x7d0
  kthread+0x248/0x260
  ret_from_fork+0x10/0x18

 The buggy address belongs to the object at fffffff51414ac80
  which belongs to the cache kmalloc-512 of size 512
 The buggy address is located 260 bytes inside of
  512-byte region [fffffff51414ac80, fffffff51414ae80)
 The buggy address belongs to the page:
 page:ffffffbfd4505200 count:1 mapcount:0 mapping:fffffff51e00c680 index:0x0 compound_mapcount: 0
 flags: 0x4000000000008100(slab|head)
 raw: 4000000000008100 ffffffbfd4529008 ffffffbfd44f9208 fffffff51e00c680
 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000
 page dumped because: kasan: bad access detected

 Memory state around the buggy address:
  fffffff51414ac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  fffffff51414ad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 &gt;fffffff51414ad80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                    ^
  fffffff51414ae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  fffffff51414ae80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc

The batch API sets the same completion for each rpmh message that's sent
and then loops through all the messages and waits for that single
completion declared on the stack to be completed before returning from
the function and freeing the message structures. Unfortunately, some
messages may still be in process and 'stuck' in the TCS. At some later
point, the tcs_tx_done() interrupt will run and try to process messages
that have already been freed at the end of rpmh_write_batch(). This will
in turn access the 'needs_free' member of the rpmh_request structure and
cause KASAN to complain. Furthermore, if there's a message that's
completed in rpmh_tx_done() and freed immediately after the complete()
call is made we'll be racing with potentially freed memory when
accessing the 'needs_free' member:

	CPU0                         CPU1
	----                         ----
	rpmh_tx_done()
	 complete(&amp;compl)
	                             wait_for_completion(&amp;compl)
	                             kfree(rpm_msg)
	 if (rpm_msg-&gt;needs_free)
	 &lt;KASAN warning splat&gt;

Let's fix this by allocating a chunk of completions for each message and
waiting for all of them to be completed before returning from the batch
API. Alternatively, we could wait for the last message in the batch, but
that may be a more complicated change because it looks like
tcs_tx_done() just iterates through the indices of the queue and
completes each message instead of tracking the last inserted message and
completing that first.

Fixes: c8790cb6da58 ("drivers: qcom: rpmh: add support for batch RPMH request")
Cc: Lina Iyer &lt;ilina@codeaurora.org&gt;
Cc: "Raju P.L.S.S.S.N" &lt;rplsssn@codeaurora.org&gt;
Cc: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Cc: Evan Green &lt;evgreen@chromium.org&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Lina Iyer &lt;ilina@codeaurora.org&gt;
Reviewed-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>drivers: qcom: rpmh: avoid sending sleep/wake sets immediately</title>
<updated>2019-02-01T22:08:40Z</updated>
<author>
<name>Raju P.L.S.S.S.N</name>
<email>rplsssn@codeaurora.org</email>
</author>
<published>2018-10-23T17:29:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7300241926e8cf5b5f01059b0c07896fb1c74d9e'/>
<id>urn:sha1:7300241926e8cf5b5f01059b0c07896fb1c74d9e</id>
<content type='text'>
Fix the redundant call being made to send the sleep and wake requests
immediately to the controller.

As per the patch [1], the sleep and wake request votes are cached in
rpmh controller and sent during rpmh_flush(). These requests needs to be
sent only during entry of deeper system low power modes or suspend.

[1] https://patchwork.kernel.org/patch/10477533/

Reviewed-by: Lina Iyer &lt;ilina@codeaurora.org&gt;
Reviewed-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Raju P.L.S.S.S.N &lt;rplsssn@codeaurora.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: rmtfs-mem: Make sysfs attributes world-readable</title>
<updated>2019-02-01T22:08:34Z</updated>
<author>
<name>Evan Green</name>
<email>evgreen@chromium.org</email>
</author>
<published>2019-01-03T00:02:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f58b0f9d9dd6d033396561517bb191d904df9e54'/>
<id>urn:sha1:f58b0f9d9dd6d033396561517bb191d904df9e54</id>
<content type='text'>
In order to run an rmtfs daemon as an unprivileged user, that user would
need access to the phys_addr and size sysfs attributes. Sharing these
attributes with unprivileged users doesn't really leak anything
sensitive, since if you have access to physical memory, the jig is
up anyway.

Make those attributes readable by all.

Reviewed-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: rmtfs-mem: Add class to enable uevents</title>
<updated>2019-02-01T22:08:27Z</updated>
<author>
<name>Evan Green</name>
<email>evgreen@chromium.org</email>
</author>
<published>2019-01-03T00:02:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b4aa93bca91318a8cf832b9fd34a830e44660d50'/>
<id>urn:sha1:b4aa93bca91318a8cf832b9fd34a830e44660d50</id>
<content type='text'>
Currently the qcom_rmtfs_memN devices are entirely invisible to the udev world.
Add a class to the rmtfs device so that uevents fire when the device is added.

Reviewed-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Evan Green &lt;evgreen@chromium.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
<entry>
<title>soc: qcom: update config dependencies for QCOM_RPMPD</title>
<updated>2019-01-22T21:36:04Z</updated>
<author>
<name>Rajendra Nayak</name>
<email>rnayak@codeaurora.org</email>
</author>
<published>2019-01-18T04:48:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4eccc154b3866e59358f1102045d23a301dffe0a'/>
<id>urn:sha1:4eccc154b3866e59358f1102045d23a301dffe0a</id>
<content type='text'>
Since QCOM_RPMPD is bool and it depends on QCOM_SMD_RPM
which is tristate, configurations such as arm64:allmodconfig
result in

CONFIG_QCOM_RPMPD=y
CONFIG_QCOM_SMD_RPM=m

This in turn results in

drivers/soc/qcom/rpmpd.o: In function `rpmpd_send_corner':
rpmpd.c:(.text+0x10c): undefined reference to `qcom_rpm_smd_write'
drivers/soc/qcom/rpmpd.o: In function `rpmpd_power_on':
rpmpd.c:(.text+0x3b4): undefined reference to `qcom_rpm_smd_write'
drivers/soc/qcom/rpmpd.o: In function `rpmpd_power_off':
rpmpd.c:(.text+0x520): undefined reference to `qcom_rpm_smd_write'
make: *** [vmlinux] Error 1

Fix it by making QCOM_RPMPD depend on QCOM_SMD_RPM=y

Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Rajendra Nayak &lt;rnayak@codeaurora.org&gt;
Signed-off-by: Andy Gross &lt;andy.gross@linaro.org&gt;
</content>
</entry>
</feed>
