<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/platform/chrome/cros_ec.c, branch linux-7.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-09-14T03:34:41+00:00</updated>
<entry>
<title>platform/chrome: cros_ec: Add a flag to track registration state</title>
<updated>2025-09-14T03:34:41+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2025-08-28T08:36:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=56cb557279d70397cefb497e0f06bdd6fd685f8e'/>
<id>urn:sha1:56cb557279d70397cefb497e0f06bdd6fd685f8e</id>
<content type='text'>
Introduce a `registered` flag to the `struct cros_ec_device` to allow
callers to determine if the device has been fully registered and is
ready for use.

This is a preparatory step to prevent race conditions where other drivers
might try to access the device before it is fully registered or after
it has been unregistered.

Link: https://lore.kernel.org/r/20250828083601.856083-5-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Separate initialization from cros_ec_register()</title>
<updated>2025-09-14T03:34:41+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2025-08-28T08:35:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7a79b0bfd8b3995a39d25bffcf57273635c0e542'/>
<id>urn:sha1:7a79b0bfd8b3995a39d25bffcf57273635c0e542</id>
<content type='text'>
Move the initialization of the `struct cros_ec_device` from
cros_ec_register() into cros_ec_device_alloc().

This decouples device initialization from registration.  By doing so,
the per-device lock is now available immediately after allocation,
allowing it to be used safely even before the device is fully
registered.

Link: https://lore.kernel.org/r/20250828083601.856083-4-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: Centralize common cros_ec_device initialization</title>
<updated>2025-09-14T03:34:41+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2025-08-28T08:35:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e19ceeb1c0f63e3e15b197c5f34797134b51ba0e'/>
<id>urn:sha1:e19ceeb1c0f63e3e15b197c5f34797134b51ba0e</id>
<content type='text'>
Move the common initialization from protocol device drivers into central
cros_ec_device_alloc().

This removes duplicated code from each driver's probe function.
The buffer sizes are now calculated once, using the maximum possible
overhead required by any of the transport protocols, ensuring the
allocated buffers are sufficient for all cases.

Link: https://lore.kernel.org/r/20250828083601.856083-3-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: Centralize cros_ec_device allocation</title>
<updated>2025-09-14T03:34:41+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2025-08-28T08:35:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=918856986014142271a70a334d300994b9c41720'/>
<id>urn:sha1:918856986014142271a70a334d300994b9c41720</id>
<content type='text'>
Introduce a helper function, cros_ec_device_alloc(), to centralize the
allocation of the struct cros_ec_device.  Convert all protocol device
drivers to use this new function.

This is a preparatory step for separating common initialization logic
out of device drivers' probe() and cros_ec_register().

Link: https://lore.kernel.org/r/20250828083601.856083-2-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Avoid -Wflex-array-member-not-at-end warning</title>
<updated>2025-08-13T09:52:41+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2025-08-11T13:27:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8abbbbb588f1f1bf95ae56c1531a17520ce487e2'/>
<id>urn:sha1:8abbbbb588f1f1bf95ae56c1531a17520ce487e2</id>
<content type='text'>
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Use the new TRAILING_OVERLAP() helper to fix the following warning:

drivers/platform/chrome/cros_ec.c:106:40: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

This helper creates a union between a flexible-array member (FAM)
and a set of members that would otherwise follow it. This overlays
the trailing members onto the FAM while preserving the original
memory layout.

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Link: https://lore.kernel.org/r/aJnvuv334M7TljoB@kspp
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()</title>
<updated>2025-07-23T02:44:39+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2025-07-22T12:05:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e2374953461947eee49f69b3e3204ff080ef31b1'/>
<id>urn:sha1:e2374953461947eee49f69b3e3204ff080ef31b1</id>
<content type='text'>
The blocking notifier is registered in cros_ec_register(); however, it
isn't unregistered in cros_ec_unregister().

Fix it.

Fixes: 42cd0ab476e2 ("platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW")
Cc: stable@vger.kernel.org
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Link: https://lore.kernel.org/r/20250722120513.234031-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: jump to RW before probing</title>
<updated>2024-12-30T01:31:05+00:00</updated>
<author>
<name>Dawid Niedzwiecki</name>
<email>dawidn@google.com</email>
</author>
<published>2024-12-06T09:15:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ffa0dbfdc9fc05acae02d5b0dc766ec778569ac'/>
<id>urn:sha1:5ffa0dbfdc9fc05acae02d5b0dc766ec778569ac</id>
<content type='text'>
There are EC devices, like FPMCU, that use RWSIG as a method of
authenticating RW section. After the authentication succeeds, EC device
waits some time before jumping to RW. EC can be probed before the jump,
which means there is a time window after jump to RW in which EC won't
respond, because it is not initialized. It can cause a communication
errors after probing.

To avoid such problems, send the RWSIG continue command first, which
skips waiting for the jump to RW. Send the command more times, to make
sure EC is ready in RW before the start of the actual probing process. If
a EC device doesn't support the RWSIG, it will respond with invalid
command error code and probing will continue as usual.

Signed-off-by: Dawid Niedzwiecki &lt;dawidn@google.com&gt;
Link: https://lore.kernel.org/r/20241206091514.2538350-2-dawidn@google.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: let cros_ec_suspend() call cros_ec_suspend_*</title>
<updated>2024-05-27T02:42:28+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2024-04-30T02:09:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47ef58cdbd7fae42f1adcb6015fdc05ce2b2471e'/>
<id>urn:sha1:47ef58cdbd7fae42f1adcb6015fdc05ce2b2471e</id>
<content type='text'>
After commit 2fbe479c0024 ("platform/chrome: cros_ec: Handle events
during suspend after resume completion"), cros_ec_resume() starts to
call cros_ec_resume_early() and cros_ec_resume_complete().

To be neat, let cros_ec_suspend() call cros_ec_suspend_prepare() and
cros_ec_suspend_late().

Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Link: https://lore.kernel.org/r/20240430020924.610724-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Handle events during suspend after resume completion</title>
<updated>2024-04-30T01:38:04+00:00</updated>
<author>
<name>Karthikeyan Ramasubramanian</name>
<email>kramasub@chromium.org</email>
</author>
<published>2024-04-29T18:13:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2fbe479c0024e1c6b992184a799055e19932aa48'/>
<id>urn:sha1:2fbe479c0024e1c6b992184a799055e19932aa48</id>
<content type='text'>
Commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host
command and irq disable") re-ordered the resume sequence. Before that
change, cros_ec resume sequence is:
1) Enable IRQ
2) Send resume event
3) Handle events during suspend

After commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host
command and irq disable"), cros_ec resume sequence is:
1) Enable IRQ
2) Handle events during suspend
3) Send resume event.

This re-ordering leads to delayed handling of any events queued between
items 2) and 3) with the updated sequence. Also in certain platforms, EC
skips triggering interrupt for certain events eg. mkbp events until the
resume event is received. Such events are stuck in the host event queue
indefinitely. This change puts back the original order to avoid any
delay in handling the pending events.

Fixes: 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host command and irq disable")
Cc: &lt;stable@vger.kernel.org&gt;
Cc: Lalith Rajendran &lt;lalithkraj@chromium.org&gt;
Cc: &lt;chrome-platform@lists.linux.dev&gt;
Signed-off-by: Karthikeyan Ramasubramanian &lt;kramasub@chromium.org&gt;
Link: https://lore.kernel.org/r/20240429121343.v2.1.If2e0cef959f1f6df9f4d1ab53a97c54aa54208af@changeid
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_lpc: Separate host command and irq disable</title>
<updated>2023-10-28T03:13:25+00:00</updated>
<author>
<name>Lalith Rajendran</name>
<email>lalithkraj@chromium.org</email>
</author>
<published>2023-10-27T21:02:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47ea0ddb1f5604ba3496baa19110aec6a3151f2e'/>
<id>urn:sha1:47ea0ddb1f5604ba3496baa19110aec6a3151f2e</id>
<content type='text'>
Both cros host command and irq disable were moved to suspend
prepare stage from late suspend recently. This is causing EC
to report MKBP event timeouts during suspend stress testing.
When the MKBP event timeouts happen during suspend, subsequent
wakeup of AP by EC using MKBP doesn't happen properly. Move the
irq disabling part back to late suspend stage which is a general
suggestion from the suspend kernel documentaiton to do irq
disable as late as possible.

Fixes: 4b9abbc132b8 ("platform/chrome: cros_ec_lpc: Move host command to prepare/complete")
Signed-off-by: Lalith Rajendran &lt;lalithkraj@chromium.org&gt;
Link: https://lore.kernel.org/r/20231027160221.v4.1.I1725c3ed27eb7cd9836904e49e8bfa9fb0200a97@changeid
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
</feed>
