<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/platform/chrome/cros_ec_debugfs.c, branch v6.6.141</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.141</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.141'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-08-03T06:53:20+00:00</updated>
<entry>
<title>platform/chrome: cros_ec_debugfs: fix wrong EC message version</title>
<updated>2024-08-03T06:53:20+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2024-06-11T11:31:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b37d68ab60c58ab3db22300b0134ebd72dfb9e7a'/>
<id>urn:sha1:b37d68ab60c58ab3db22300b0134ebd72dfb9e7a</id>
<content type='text'>
[ Upstream commit c2a28647bbb4e0894e8824362410f72b06ac57a4 ]

ec_read_version_supported() uses ec_params_get_cmd_versions_v1 but it
wrongly uses message version 0.

Fix it.

Fixes: e86264595225 ("mfd: cros_ec: add debugfs, console log file")
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Link: https://lore.kernel.org/r/20240611113110.16955-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;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_debugfs: fix kernel-doc warning</title>
<updated>2023-04-24T05:35:12+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-04-11T05:33:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1f3744b89164a430865d18b757b86c4007627855'/>
<id>urn:sha1:1f3744b89164a430865d18b757b86c4007627855</id>
<content type='text'>
Fix the following kernel-doc warning:

$ ./scripts/kernel-doc -none drivers/platform/chrome/*
[...]
warning: This comment starts with '/**', but isn't a kernel-doc comment.

Fixes: 14bb09b32f43 ("platform/chrome: cros_ec: Separate logic for getting panic info")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Link: https://lore.kernel.org/r/20230411053308.1572493-1-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Separate logic for getting panic info</title>
<updated>2023-04-24T05:35:12+00:00</updated>
<author>
<name>Rob Barnes</name>
<email>robbarnes@google.com</email>
</author>
<published>2023-04-10T16:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=26e1dc1bef42a699734056271e790982e2ba8092'/>
<id>urn:sha1:26e1dc1bef42a699734056271e790982e2ba8092</id>
<content type='text'>
Create a separate function called cros_ec_get_panicinfo for getting
panic info from EC.

Currently cros_ec_create_panicinfo is the only caller.

Signed-off-by: Rob Barnes &lt;robbarnes@google.com&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20230410165817.932449-1-robbarnes@google.com
</content>
</entry>
<entry>
<title>platform/chrome: fix kernel-doc warnings for panic notifier</title>
<updated>2023-01-13T01:30:49+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-01-11T05:57:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=16d73129f1fd8e91eb565482245233809647c649'/>
<id>urn:sha1:16d73129f1fd8e91eb565482245233809647c649</id>
<content type='text'>
Fix the following kernel-doc warnings:

$ ./scripts/kernel-doc -none drivers/platform/chrome/*
drivers/platform/chrome/cros_ec_debugfs.c:54: warning: Function
parameter or member 'notifier_panic' not described in 'cros_ec_debugfs'

$ ./scripts/kernel-doc -none include/linux/platform_data/cros_ec_proto.h
include/linux/platform_data/cros_ec_proto.h:187: warning: Function
parameter or member 'panic_notifier' not described in 'cros_ec_device'

Cc: Rob Barnes &lt;robbarnes@google.com&gt;
Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Reviewed-by: Guenter Roeck &lt;groweck@chromium.org&gt;
Link: https://lore.kernel.org/r/20230111055728.708990-2-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Poll EC log on EC panic</title>
<updated>2023-01-06T03:48:06+00:00</updated>
<author>
<name>Rob Barnes</name>
<email>robbarnes@google.com</email>
</author>
<published>2023-01-04T01:15:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d90fa2c64d59f5f151beeef5dbc599784b3391ca'/>
<id>urn:sha1:d90fa2c64d59f5f151beeef5dbc599784b3391ca</id>
<content type='text'>
Add handler for CrOS EC panic events. When a panic is reported,
immediately poll for EC log.

This should result in the log leading to the EC panic being
preserved.

ACPI_NOTIFY_CROS_EC_PANIC is defined in coreboot at
https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src/ec/google/chromeec/acpi/ec.asl

Signed-off-by: Rob Barnes &lt;robbarnes@google.com&gt;
Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20230104011524.369764-2-robbarnes@google.com
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_debugfs: Set PROBE_PREFER_ASYNCHRONOUS</title>
<updated>2022-11-02T04:28:47+00:00</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2022-11-01T22:22:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=692a68ad7f3c568359b9f18d966628856fd34ff3'/>
<id>urn:sha1:692a68ad7f3c568359b9f18d966628856fd34ff3</id>
<content type='text'>
This driver takes on the order of 40ms to start on some systems. It
shouldn't have many cross-device dependencies to race with, nor racy
access to shared state with other drivers, so this should be a
relatively low risk change.

This driver was pinpointed as part of a survey of top slowest initcalls
(i.e., are built in, and probing synchronously) on a lab of ChromeOS
systems.

Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20221101152132.v2.3.Ic9a4f378f73319da323cd55940012fa6b1de24f4@changeid
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs</title>
<updated>2022-08-24T02:37:07+00:00</updated>
<author>
<name>Evan Green</name>
<email>evgreen@chromium.org</email>
</author>
<published>2022-08-22T21:40:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.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_debugfs: detach log reader wq from devm</title>
<updated>2022-03-31T23:56:48+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@google.com</email>
</author>
<published>2022-02-09T05:11:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0e8eb5e8acbad19ac2e1856b2fb2320184299b33'/>
<id>urn:sha1:0e8eb5e8acbad19ac2e1856b2fb2320184299b33</id>
<content type='text'>
Debugfs console_log uses devm memory (e.g. debug_info in
cros_ec_console_log_poll()).  However, lifecycles of device and debugfs
are independent.  An use-after-free issue is observed if userland
program operates the debugfs after the memory has been freed.

The call trace:
 do_raw_spin_lock
 _raw_spin_lock_irqsave
 remove_wait_queue
 ep_unregister_pollwait
 ep_remove
 do_epoll_ctl

A Python example to reproduce the issue:
... import select
... p = select.epoll()
... f = open('/sys/kernel/debug/cros_scp/console_log')
... p.register(f, select.POLLIN)
... p.poll(1)
[(4, 1)]                    # 4=fd, 1=select.POLLIN

[ shutdown cros_scp at the point ]

... p.poll(1)
[(4, 16)]                   # 4=fd, 16=select.POLLHUP
... p.unregister(f)

An use-after-free issue raises here.  It called epoll_ctl with
EPOLL_CTL_DEL which in turn to use the workqueue in the devm (i.e.
log_wq).

Detaches log reader's workqueue from devm to make sure it is persistent
even if the device has been removed.

Signed-off-by: Tzung-Bi Shih &lt;tzungbi@google.com&gt;
Reviewed-by: Guenter Roeck &lt;groeck@google.com&gt;
Link: https://lore.kernel.org/r/20220209051130.386175-1-tzungbi@google.com
Signed-off-by: Benson Leung &lt;bleung@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_debugfs: Control uptime information request</title>
<updated>2020-06-19T17:16:18+00:00</updated>
<author>
<name>Gwendal Grignou</name>
<email>gwendal@chromium.org</email>
</author>
<published>2020-05-26T18:53:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d378cdd0113878e3860f954d16dd3e91defb1492'/>
<id>urn:sha1:d378cdd0113878e3860f954d16dd3e91defb1492</id>
<content type='text'>
When EC does not support uptime command (EC_CMD_GET_UPTIME_INFO),
do not create the uptime sysfs entry point.
User space application will not probe the file needlessly.

The EC console log will not contain EC_CMD_GET_UPTIME_INFO anymore.

Signed-off-by: Gwendal Grignou &lt;gwendal@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>cros_ec: treewide: Remove 'include/linux/mfd/cros_ec.h'</title>
<updated>2020-01-07T16:36:46+00:00</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2019-12-03T14:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=11f1eabee0ba0aafe023ad92d1e3c29d0a96683e'/>
<id>urn:sha1:11f1eabee0ba0aafe023ad92d1e3c29d0a96683e</id>
<content type='text'>
This header file now only includes the cros_ec_dev struct, however, is the
'include/linux/platform_data/cros_ec_proto.h' who contains the definition of
all the Chrome OS EC related structs. There is no reason to have a
separate include for this struct so move to the place where other
structs are defined. That way, we can remove the include itself, but also
simplify the common pattern

    #include &lt;linux/mfd/cros_ec.h&gt;
    #include &lt;linux/platform_data/cros_ec_proto.h&gt;

for a single include

    #include &lt;linux/platform_data/cros_ec_proto.h&gt;

The changes to remove the cros_ec.h include were generated with the
following shell script:

    git grep -l "&lt;linux/mfd/cros_ec.h&gt;" | xargs sed -i '/&lt;linux\/mfd\/cros_ec.h&gt;/d'

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Sebastian Reichel &lt;sre@kernel.org&gt;
Acked-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
</entry>
</feed>
