<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/platform/chrome/cros_ec.c, branch linux-6.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-08-28T14:26:11Z</updated>
<entry>
<title>platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()</title>
<updated>2025-08-28T14:26:11Z</updated>
<author>
<name>Tzung-Bi Shih</name>
</author>
<published>2025-08-21T13:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bb1609b745f46df235a57f72d4db8e91c928d09'/>
<id>urn:sha1:1bb1609b745f46df235a57f72d4db8e91c928d09</id>
<content type='text'>
[ Upstream commit e2374953461947eee49f69b3e3204ff080ef31b1 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: remove unneeded label and if-condition</title>
<updated>2025-08-28T14:26:11Z</updated>
<author>
<name>Tzung-Bi Shih</name>
</author>
<published>2025-08-21T13:27:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8b2c86393c3f6dfca51191d80b106ce319bd668'/>
<id>urn:sha1:a8b2c86393c3f6dfca51191d80b106ce319bd668</id>
<content type='text'>
[ Upstream commit 554ec02c97254962bbb0a8776c3160d294fc7e51 ]

Both `ec_dev-&gt;ec` and `ec_dev-&gt;pd` are initialized to NULL at the
beginning of cros_ec_register().  Also, platform_device_unregister()
takes care if the given platform_device is NULL.

Remove the unneeded goto-label and if-condition.

Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Link: https://lore.kernel.org/r/20230308031247.2866401-1-tzungbi@kernel.org
Stable-dep-of: e23749534619 ("platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Use per-device lockdep key</title>
<updated>2025-08-28T14:26:11Z</updated>
<author>
<name>Chen-Yu Tsai</name>
</author>
<published>2025-08-21T13:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a394c7ed7d4d187c2f46df0e90108aa044291d5'/>
<id>urn:sha1:8a394c7ed7d4d187c2f46df0e90108aa044291d5</id>
<content type='text'>
[ Upstream commit 961a325becd9a142ae5c8b258e5c2f221f8bfac8 ]

Lockdep reports a bogus possible deadlock on MT8192 Chromebooks due to
the following lock sequences:

1. lock(i2c_register_adapter) [1]; lock(&amp;ec_dev-&gt;lock)
2. lock(&amp;ec_dev-&gt;lock); lock(prepare_lock);

The actual dependency chains are much longer. The shortened version
looks somewhat like:

1. cros-ec-rpmsg on mtk-scp
   ec_dev-&gt;lock -&gt; prepare_lock
2. In rt5682_i2c_probe() on native I2C bus:
   prepare_lock -&gt; regmap-&gt;lock -&gt; (possibly) i2c_adapter-&gt;bus_lock
3. In rt5682_i2c_probe() on native I2C bus:
   regmap-&gt;lock -&gt; i2c_adapter-&gt;bus_lock
4. In sbs_probe() on i2c-cros-ec-tunnel I2C bus attached on cros-ec:
   i2c_adapter-&gt;bus_lock -&gt; ec_dev-&gt;lock

While lockdep is correct that the shared lockdep classes have a circular
dependency, it is bogus because

  a) 2+3 happen on a native I2C bus
  b) 4 happens on the actual EC on ChromeOS devices
  c) 1 happens on the SCP coprocessor on MediaTek Chromebooks that just
     happens to expose a cros-ec interface, but does not have an
     i2c-cros-ec-tunnel I2C bus

In short, the "dependencies" are actually on different devices.

Setup a per-device lockdep key for cros_ec devices so lockdep can tell
the two instances apart. This helps with getting rid of the bogus
lockdep warning. For ChromeOS devices that only have one cros-ec
instance this doesn't change anything.

Also add a missing mutex_destroy, just to make the teardown complete.

[1] This is likely the per I2C bus lock with shared lockdep class

Signed-off-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20230111074146.2624496-1-wenst@chromium.org
Stable-dep-of: e23749534619 ("platform/chrome: cros_ec: Unregister notifier in cros_ec_unregister()")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Notify the PM of wake events during resume</title>
<updated>2022-09-19T02:34:38Z</updated>
<author>
<name>Jameson Thies</name>
</author>
<published>2022-09-13T20:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8edd2752b0aa498b3a61f3caee8f79f7e0567fad'/>
<id>urn:sha1:8edd2752b0aa498b3a61f3caee8f79f7e0567fad</id>
<content type='text'>
cros_ec_handle_event in the cros_ec driver can notify the PM of wake
events. When a device is suspended, cros_ec_handle_event will not check
MKBP events. Instead, received MKBP events are checked during resume by
cros_ec_report_events_during_suspend. But
cros_ec_report_events_during_suspend cannot notify the PM if received
events are wake events, causing wake events to not be reported if
received while the device is suspended.

Update cros_ec_report_events_during_suspend to notify the PM of wake
events during resume by calling pm_wakeup_event.

Signed-off-by: Jameson Thies &lt;jthies@google.com&gt;
Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220913204954.2931042-1-jthies@google.com
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs</title>
<updated>2022-08-24T02:37:07Z</updated>
<author>
<name>Evan Green</name>
</author>
<published>2022-08-22T21:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8bf17d58a4db4b4f38617925414097f12e0d509'/>
<id>urn:sha1:e8bf17d58a4db4b4f38617925414097f12e0d509</id>
<content type='text'>
In modern Chromebooks, the embedded controller has a mechanism where
it will watch a hardware-controlled line that toggles in suspend, and
wake the system up if an expected sleep transition didn't occur. This
can be very useful for detecting power management issues where the
system appears to suspend, but doesn't actually reach its lowest
expected power states.

Sometimes it's useful in debug and test scenarios to be able to control
the duration of that timeout, or even disable the EC timeout mechanism
altogether. Add a debugfs control to set the timeout to values other
than the EC-defined default, for more convenient debug and
development iteration.

Signed-off-by: Evan Green &lt;evgreen@chromium.org&gt;
Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Reviewed-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Link: https://lore.kernel.org/r/20220822144026.v3.1.Idd188ff3f9caddebc17ac357a13005f93333c21f@changeid
[tzungbi: fix one nit in Documentation/ABI/testing/debugfs-cros-ec.]
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Always expose last resume result</title>
<updated>2022-06-14T08:18:18Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2022-06-14T07:57:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74bb746407bf0d7c7d126c7731dbcd66d467619b'/>
<id>urn:sha1:74bb746407bf0d7c7d126c7731dbcd66d467619b</id>
<content type='text'>
The last resume result exposing logic in cros_ec_sleep_event()
incorrectly requires S0ix support, which doesn't work on ARM based
systems where S0ix doesn't exist. That's because cros_ec_sleep_event()
only reports the last resume result when the EC indicates the last sleep
event was an S0ix resume. On ARM systems, the last sleep event is always
S3 resume, but the EC can still detect sleep hang events in case some
other part of the AP is blocking sleep.

Always expose the last resume result if the EC supports it so that this
works on all devices regardless of S0ix support. This fixes sleep hang
detection on ARM based chromebooks like Trogdor.

Cc: Rajat Jain &lt;rajatja@chromium.org&gt;
Cc: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Cc: Hsin-Yi Wang &lt;hsinyi@chromium.org&gt;
Cc: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Reviewed-by: Evan Green &lt;evgreen@chromium.org&gt;
Fixes: 7235560ac77a ("platform/chrome: Add support for v1 of host sleep event")
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220614075726.2729987-1-swboyd@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: use macros for passthru indexes</title>
<updated>2022-06-10T02:31:42Z</updated>
<author>
<name>Tzung-Bi Shih</name>
</author>
<published>2022-06-09T08:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3db0c9e5de7bd9dbe52580eb9752b2b3049e38da'/>
<id>urn:sha1:3db0c9e5de7bd9dbe52580eb9752b2b3049e38da</id>
<content type='text'>
Move passthru indexes for EC and PD devices to common header.  Also use
them instead of literal constants.

Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220609084957.3684698-4-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: append newline to all logs</title>
<updated>2022-04-18T07:39:27Z</updated>
<author>
<name>Tzung-Bi Shih</name>
</author>
<published>2022-02-16T08:03:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d4668064cce8f8d52d4bd2b3b864feed33b1258'/>
<id>urn:sha1:8d4668064cce8f8d52d4bd2b3b864feed33b1258</id>
<content type='text'>
To be consistent, append newline ("\n") to all logs.

Reviewed-by: Guenter Roeck &lt;groeck@google.com&gt;
Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: sort header inclusion alphabetically</title>
<updated>2022-04-18T07:39:27Z</updated>
<author>
<name>Tzung-Bi Shih</name>
</author>
<published>2022-02-16T08:03:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5781a33098c69a3b08890ad78a297b81bb69ca4b'/>
<id>urn:sha1:5781a33098c69a3b08890ad78a297b81bb69ca4b</id>
<content type='text'>
Sort header inclusion alphabetically.

Reviewed-by: Guenter Roeck &lt;groeck@google.com&gt;
Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: determine `wake_enabled` in cros_ec_suspend()</title>
<updated>2022-04-18T07:39:27Z</updated>
<author>
<name>Tzung-Bi Shih</name>
</author>
<published>2022-02-16T08:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9fbe967d4e6e017c85c94aead6a1310b5f77db9a'/>
<id>urn:sha1:9fbe967d4e6e017c85c94aead6a1310b5f77db9a</id>
<content type='text'>
`wake_enabled` indicates cros_ec_resume() needs to call
disable_irq_wake() to undo enable_irq_wake() in cros_ec_suspend().

Determine `wake_enabled` in cros_ec_suspend() instead of
reset-after-used in cros_ec_resume().

Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
</feed>
