<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/soc/apple, branch v6.15</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>soc: apple: rtkit: Cut syslog messages after the first '\0'</title>
<updated>2025-02-28T21:36:45+00:00</updated>
<author>
<name>Janne Grunau</name>
<email>j@jannau.net</email>
</author>
<published>2025-02-26T19:00:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e210227f0259d2666cc41b28ed1b7b0b0a99ed4d'/>
<id>e210227f0259d2666cc41b28ed1b7b0b0a99ed4d</id>
<content type='text'>
Certain messages from DCP contain NUL bytes in the random data after the
NUL terminated syslog message. Since the syslog message ends with '\n'
this results in a dev_info() message terminated with two newlines and an
empty printed line in the kernel log.

Signed-off-by: Janne Grunau &lt;j@jannau.net&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-4-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Certain messages from DCP contain NUL bytes in the random data after the
NUL terminated syslog message. Since the syslog message ends with '\n'
this results in a dev_info() message terminated with two newlines and an
empty printed line in the kernel log.

Signed-off-by: Janne Grunau &lt;j@jannau.net&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-4-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: rtkit: Use high prio work queue</title>
<updated>2025-02-28T21:36:45+00:00</updated>
<author>
<name>Janne Grunau</name>
<email>j@jannau.net</email>
</author>
<published>2025-02-26T19:00:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=22af2fac88fa5dbc310bfe7d0b66d4de3ac47305'/>
<id>22af2fac88fa5dbc310bfe7d0b66d4de3ac47305</id>
<content type='text'>
rtkit messages as communication with the DCP firmware for framebuffer
swaps or input events are time critical so use WQ_HIGHPRI to prevent
user space CPU load to increase latency.
With kwin_wayland 6's explicit sync mode user space load was able to
delay the IOMFB rtkit communication enough to miss vsync for surface
swaps. Minimal test scenario is constantly resizing a glxgears
Xwayland window.

Signed-off-by: Janne Grunau &lt;j@jannau.net&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-3-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rtkit messages as communication with the DCP firmware for framebuffer
swaps or input events are time critical so use WQ_HIGHPRI to prevent
user space CPU load to increase latency.
With kwin_wayland 6's explicit sync mode user space load was able to
delay the IOMFB rtkit communication enough to miss vsync for surface
swaps. Minimal test scenario is constantly resizing a glxgears
Xwayland window.

Signed-off-by: Janne Grunau &lt;j@jannau.net&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-3-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: rtkit: Implement OSLog buffers properly</title>
<updated>2025-02-28T21:36:45+00:00</updated>
<author>
<name>Hector Martin</name>
<email>marcan@marcan.st</email>
</author>
<published>2025-02-26T19:00:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a06398687065e0c334dc5fc4d2778b5b87292e43'/>
<id>a06398687065e0c334dc5fc4d2778b5b87292e43</id>
<content type='text'>
Apparently nobody can figure out where the old logic came from, but it
seems like it has never been actually used on any supported firmware to
this day. OSLog buffers were apparently never requested.

But starting with 13.3, we actually need this implemented properly for
MTP (and later AOP) to work, so let's actually do that.

Signed-off-by: Hector Martin &lt;marcan@marcan.st&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-2-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apparently nobody can figure out where the old logic came from, but it
seems like it has never been actually used on any supported firmware to
this day. OSLog buffers were apparently never requested.

But starting with 13.3, we actually need this implemented properly for
MTP (and later AOP) to work, so let's actually do that.

Signed-off-by: Hector Martin &lt;marcan@marcan.st&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-2-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: rtkit: Add and use PWR_STATE_INIT instead of _ON</title>
<updated>2025-02-28T21:36:45+00:00</updated>
<author>
<name>Janne Grunau</name>
<email>j@jannau.net</email>
</author>
<published>2025-02-26T19:00:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3e46b6df8465e7a1c0d8e87a0966ecfb753ae84b'/>
<id>3e46b6df8465e7a1c0d8e87a0966ecfb753ae84b</id>
<content type='text'>
This state is needed to wake the dcp IOP after m1n1 shut it down
and works for all other co-processors as well.

Signed-off-by: Janne Grunau &lt;j@jannau.net&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-1-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This state is needed to wake the dcp IOP after m1n1 shut it down
and works for all other co-processors as well.

Signed-off-by: Janne Grunau &lt;j@jannau.net&gt;
Reviewed-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Link: https://lore.kernel.org/r/20250226-apple-soc-misc-v2-1-c3ec37f9021b@svenpeter.dev
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: rtkit: Fix use-after-free in apple_rtkit_crashlog_rx()</title>
<updated>2025-02-18T17:01:20+00:00</updated>
<author>
<name>Harshit Mogalapalli</name>
<email>harshit.m.mogalapalli@oracle.com</email>
</author>
<published>2025-02-12T08:58:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=00834971f0d9e38beae37e92055b1432782827d0'/>
<id>00834971f0d9e38beae37e92055b1432782827d0</id>
<content type='text'>
This code calls kfree(bfr); and then passes "bfr" to rtk-&gt;ops-&gt;crashed()
which is a use after free.  The -&gt;crashed function pointer is implemented
by apple_nvme_rtkit_crashed() and it doesn't use the "bfr" pointer so
this doesn't cause a problem.  But it still looks sketchy as can be.

Fix this by moving kfree() after the last usage of bfr.

Fixes: bf8b4e49777d ("soc: apple: rtkit: Pass the crashlog to the crashed() callback")
Signed-off-by: Harshit Mogalapalli &lt;harshit.m.mogalapalli@oracle.com&gt;
Reviewed-by: Eric Curtin &lt;ecurtin@redhat.com&gt;
Link: https://lore.kernel.org/r/20250212085853.1357906-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This code calls kfree(bfr); and then passes "bfr" to rtk-&gt;ops-&gt;crashed()
which is a use after free.  The -&gt;crashed function pointer is implemented
by apple_nvme_rtkit_crashed() and it doesn't use the "bfr" pointer so
this doesn't cause a problem.  But it still looks sketchy as can be.

Fix this by moving kfree() after the last usage of bfr.

Fixes: bf8b4e49777d ("soc: apple: rtkit: Pass the crashlog to the crashed() callback")
Signed-off-by: Harshit Mogalapalli &lt;harshit.m.mogalapalli@oracle.com&gt;
Reviewed-by: Eric Curtin &lt;ecurtin@redhat.com&gt;
Link: https://lore.kernel.org/r/20250212085853.1357906-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: rtkit: Pass the crashlog to the crashed() callback</title>
<updated>2025-02-18T16:59:11+00:00</updated>
<author>
<name>Asahi Lina</name>
<email>lina@asahilina.net</email>
</author>
<published>2025-02-02T13:48:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bf8b4e49777d944f84cf7d47360fe80dd3f69d96'/>
<id>bf8b4e49777d944f84cf7d47360fe80dd3f69d96</id>
<content type='text'>
Client drivers might want a copy of the crashlog to stash into a
devcoredump blob. Since device memory management can be very variable,
the actual devcoredump implementation is left to client drivers. Pass
the raw crashlog buffer to the client callback so it can use it if
desired.

Signed-off-by: Asahi Lina &lt;lina@asahilina.net&gt;
Reviewed-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Link: https://lore.kernel.org/r/20250202-rtkit-crashdump-v1-1-9d38615b4e12@asahilina.net
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Client drivers might want a copy of the crashlog to stash into a
devcoredump blob. Since device memory management can be very variable,
the actual devcoredump implementation is left to client drivers. Pass
the raw crashlog buffer to the client callback so it can use it if
desired.

Signed-off-by: Asahi Lina &lt;lina@asahilina.net&gt;
Reviewed-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Link: https://lore.kernel.org/r/20250202-rtkit-crashdump-v1-1-9d38615b4e12@asahilina.net
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: rtkit: Check &amp; log more failures</title>
<updated>2025-02-18T15:32:44+00:00</updated>
<author>
<name>Asahi Lina</name>
<email>lina@asahilina.net</email>
</author>
<published>2025-02-11T17:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ca0272d8638a4c50ecc2c63719f81e022d3450f1'/>
<id>ca0272d8638a4c50ecc2c63719f81e022d3450f1</id>
<content type='text'>
Check and log the following failures:

* regular messages
* management messages
* failed buffer requests

This helps debugging.

Signed-off-by: Asahi Lina &lt;lina@asahilina.net&gt;
Signed-off-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Reviewed-by: Neal Gompa &lt;neal@gompa.dev&gt;
Link: https://lore.kernel.org/r/20250211-rtkit-more-logging-v1-1-93334e9c1c77@rosenzweig.io
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check and log the following failures:

* regular messages
* management messages
* failed buffer requests

This helps debugging.

Signed-off-by: Asahi Lina &lt;lina@asahilina.net&gt;
Signed-off-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Reviewed-by: Neal Gompa &lt;neal@gompa.dev&gt;
Link: https://lore.kernel.org/r/20250211-rtkit-more-logging-v1-1-93334e9c1c77@rosenzweig.io
Signed-off-by: Sven Peter &lt;sven@svenpeter.dev&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: mailbox: error pointers are negative integers</title>
<updated>2024-01-30T19:34:49+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-01-30T19:34:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=53ed2ac8fc1de6658aadae5714627ac99b9dddb0'/>
<id>53ed2ac8fc1de6658aadae5714627ac99b9dddb0</id>
<content type='text'>
In an entirely unrelated discussion where I pointed out a stupid thinko
of mine, Rasmus piped up and noted that that obvious mistake already
existed elsewhere in the kernel tree.

An "error pointer" is the negative error value encoded as a pointer,
making the whole "return error or valid pointer" use-case simple and
straightforward.  We use it all over the kernel.

But the key here is that errors are _negative_ error numbers, not the
horrid UNIX user-level model of "-1 and the value of 'errno'".

The Apple mailbox driver used the positive error values, and thus just
returned invalid normal pointers instead of actual errors.

Of course, the reason nobody ever noticed is that the errors presumably
never actually happen, so this is fixing a conceptual bug rather than an
actual one.

Reported-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
Link: https://lore.kernel.org/all/5c30afe0-f9fb-45d5-9333-dd914a1ea93a@prevas.dk/
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In an entirely unrelated discussion where I pointed out a stupid thinko
of mine, Rasmus piped up and noted that that obvious mistake already
existed elsewhere in the kernel tree.

An "error pointer" is the negative error value encoded as a pointer,
making the whole "return error or valid pointer" use-case simple and
straightforward.  We use it all over the kernel.

But the key here is that errors are _negative_ error numbers, not the
horrid UNIX user-level model of "-1 and the value of 'errno'".

The Apple mailbox driver used the positive error values, and thus just
returned invalid normal pointers instead of actual errors.

Of course, the reason nobody ever noticed is that the errors presumably
never actually happen, so this is fixing a conceptual bug rather than an
actual one.

Reported-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
Link: https://lore.kernel.org/all/5c30afe0-f9fb-45d5-9333-dd914a1ea93a@prevas.dk/
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: mailbox: Add explicit include of platform_device.h</title>
<updated>2023-11-23T10:10:47+00:00</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-10-30T14:26:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4dae8c047a70307d83d912afbda2e2c94de155b6'/>
<id>4dae8c047a70307d83d912afbda2e2c94de155b6</id>
<content type='text'>
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other and pull in various other headers. In
preparation to fix this, adjust the includes for what is actually needed.

platform_device.h is implicitly included by of_platform.h, but that's going
to be removed.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Neal Gompa &lt;neal@gompa.dev&gt;
Signed-off-by: Hector Martin &lt;marcan@marcan.st&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other and pull in various other headers. In
preparation to fix this, adjust the includes for what is actually needed.

platform_device.h is implicitly included by of_platform.h, but that's going
to be removed.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Neal Gompa &lt;neal@gompa.dev&gt;
Signed-off-by: Hector Martin &lt;marcan@marcan.st&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>soc: apple: mailbox: Rename config symbol to APPLE_MAILBOX</title>
<updated>2023-11-23T10:10:39+00:00</updated>
<author>
<name>Hector Martin</name>
<email>marcan@marcan.st</email>
</author>
<published>2023-03-28T11:38:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c84292d9d253706267889cf2614400712f15d689'/>
<id>c84292d9d253706267889cf2614400712f15d689</id>
<content type='text'>
With the original owner of APPLE_MAILBOX removed, let's rename the new
APPLE_MBOX to the old name. This avoids .config churn for downstream
users, and leaves us with an identical config symbol and module name as
before.

Acked-by: Eric Curtin &lt;ecurtin@redhat.com&gt;
Acked-by: Neal Gompa &lt;neal@gompa.dev&gt;
Acked-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Signed-off-by: Hector Martin &lt;marcan@marcan.st&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the original owner of APPLE_MAILBOX removed, let's rename the new
APPLE_MBOX to the old name. This avoids .config churn for downstream
users, and leaves us with an identical config symbol and module name as
before.

Acked-by: Eric Curtin &lt;ecurtin@redhat.com&gt;
Acked-by: Neal Gompa &lt;neal@gompa.dev&gt;
Acked-by: Alyssa Rosenzweig &lt;alyssa@rosenzweig.io&gt;
Signed-off-by: Hector Martin &lt;marcan@marcan.st&gt;
</pre>
</div>
</content>
</entry>
</feed>
