<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/platform/chrome/cros_ec_debugfs.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-11-21T20:10:44Z</updated>
<entry>
<title>platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo</title>
<updated>2023-11-21T20:10:44Z</updated>
<author>
<name>Avadhut Naik</name>
<email>Avadhut.Naik@amd.com</email>
</author>
<published>2023-11-16T22:47:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0706526ec7704dcd046239078ac175d11a88a95e'/>
<id>urn:sha1:0706526ec7704dcd046239078ac175d11a88a95e</id>
<content type='text'>
The debugfs_create_blob() function has been used to create read-only binary
blobs in debugfs. The function filters out permissions, other than S_IRUSR,
S_IRGRP and S_IROTH, provided while creating the blobs.

The very behavior though is being changed through previous patch in the
series (fs: debugfs: Add write functionality to debugfs blobs) which makes
the binary blobs writable by owners. Thus, all permissions provided while
creating the blobs, except S_IRUSR,S_IWUSR, S_IRGRP, S_IROTH, will be
filtered by debugfs_create_blob().

As such, rectify the permissions of panicinfo file since the S_IFREG flag
was anyways being filtered out by debugfs_create_blob(). Moreover, the
very flag will always be set be set for the panicinfo file through
__debugfs_create_file().

Signed-off-by: Avadhut Naik &lt;Avadhut.Naik@amd.com&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_debugfs: Convert to platform remove callback returning void</title>
<updated>2023-09-28T05:18:06Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-09-27T08:10:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f366fa0064ef3f7dda4ed8d25b41f8c96f5b2d3e'/>
<id>urn:sha1:f366fa0064ef3f7dda4ed8d25b41f8c96f5b2d3e</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20230927081040.2198742-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_debugfs: fix kernel-doc warning</title>
<updated>2023-04-24T05:35:12Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-04-11T05:33:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:12Z</updated>
<author>
<name>Rob Barnes</name>
<email>robbarnes@google.com</email>
</author>
<published>2023-04-10T16:58:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:49Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-01-11T05:57:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:06Z</updated>
<author>
<name>Rob Barnes</name>
<email>robbarnes@google.com</email>
</author>
<published>2023-01-04T01:15:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:47Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2022-11-01T22:22:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:07Z</updated>
<author>
<name>Evan Green</name>
<email>evgreen@chromium.org</email>
</author>
<published>2022-08-22T21:40:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:48Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@google.com</email>
</author>
<published>2022-02-09T05:11:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:18Z</updated>
<author>
<name>Gwendal Grignou</name>
<email>gwendal@chromium.org</email>
</author>
<published>2020-05-26T18:53:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
</feed>
