<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/platform/chrome, branch v5.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-03-19T18:00:30Z</updated>
<entry>
<title>platform/chrome: cros_ec_debugfs: cancel/schedule logging work only if supported</title>
<updated>2019-03-19T18:00:30Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2019-03-19T16:32:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=57aeef7f7a6848024b92c32bf23e8c85a8ac896d'/>
<id>urn:sha1:57aeef7f7a6848024b92c32bf23e8c85a8ac896d</id>
<content type='text'>
The following traceback was reported on ASUS C201, which does not support
console logging.

------------[ cut here ]------------
WARNING: CPU: 2 PID: 361 at kernel/workqueue.c:3030 __flush_work+0x38/0x154
Modules linked in: snd_soc_hdmi_codec cros_ec_debugfs cros_ec_sysfs uvcvideo dw_hdmi_cec dw_hdmi_i2s_audio videobuf2_vmalloc cfg80211 gpio_charger rk_crypto rfkill videobuf2_memops videobuf2_v4l2 des_generic videobuf2_common ofpart m25p80 spi_nor tpm_i2c_infineon sbs_battery mtd tpm joydev cros_ec_dev coreboot_table evdev mousedev ip_tables x_tables [last unloaded: brcmutil]
CPU: 2 PID: 361 Comm: systemd-sleep Not tainted 5.1.0-rc1-1-ARCH+ #1
Hardware name: Rockchip (Device Tree)
[&lt;c020e4b0&gt;] (unwind_backtrace) from [&lt;c020ac18&gt;] (show_stack+0x10/0x14)
[&lt;c020ac18&gt;] (show_stack) from [&lt;c07a3e04&gt;] (dump_stack+0x7c/0x9c)
[&lt;c07a3e04&gt;] (dump_stack) from [&lt;c0222748&gt;] (__warn+0xd0/0xec)
[&lt;c0222748&gt;] (__warn) from [&lt;c022279c&gt;] (warn_slowpath_null+0x38/0x44)
[&lt;c022279c&gt;] (warn_slowpath_null) from [&lt;c02365d0&gt;] (__flush_work+0x38/0x154)
[&lt;c02365d0&gt;] (__flush_work) from [&lt;c023786c&gt;] (__cancel_work_timer+0x114/0x1a4)
[&lt;c023786c&gt;] (__cancel_work_timer) from [&lt;bf33233c&gt;] (cros_ec_debugfs_suspend+0x14/0x1c [cros_ec_debugfs])
[&lt;bf33233c&gt;] (cros_ec_debugfs_suspend [cros_ec_debugfs]) from [&lt;c056a888&gt;] (dpm_run_callback+0x64/0xcc)
[&lt;c056a888&gt;] (dpm_run_callback) from [&lt;c056ad2c&gt;] (__device_suspend+0x174/0x3a8)
[&lt;c056ad2c&gt;] (__device_suspend) from [&lt;c056b9e0&gt;] (dpm_suspend+0x174/0x1e0)
[&lt;c056b9e0&gt;] (dpm_suspend) from [&lt;c026b3e0&gt;] (suspend_devices_and_enter+0x6c/0x50c)
[&lt;c026b3e0&gt;] (suspend_devices_and_enter) from [&lt;c026ba8c&gt;] (pm_suspend+0x20c/0x274)
[&lt;c026ba8c&gt;] (pm_suspend) from [&lt;c026a628&gt;] (state_store+0x54/0x88)
[&lt;c026a628&gt;] (state_store) from [&lt;c03cd2d0&gt;] (kernfs_fop_write+0x114/0x180)
[&lt;c03cd2d0&gt;] (kernfs_fop_write) from [&lt;c035d48c&gt;] (__vfs_write+0x1c/0x154)
[&lt;c035d48c&gt;] (__vfs_write) from [&lt;c035f9e8&gt;] (vfs_write+0xb8/0x198)
[&lt;c035f9e8&gt;] (vfs_write) from [&lt;c035fbc0&gt;] (ksys_write+0x3c/0x74)
[&lt;c035fbc0&gt;] (ksys_write) from [&lt;c0201000&gt;] (ret_fast_syscall+0x0/0x4c)
Exception stack(0xe9365fa8 to 0xe9365ff0)
5fa0: 00000004 beef8b28 00000004 beef8b28 00000004 00000000
5fc0: 00000004 beef8b28 02319170 00000004 beef8b28 00000004 b6f3d900 beef8b74
5fe0: 0000006c beef8a98 b6c0adac b6c66534
---[ end trace f4ee5df14e8ea0ec ]---

If console logging is not supported, the work structure is never
initialized, resulting in the traceback. Calling cancel/schedule functions
conditionally fixes the problem.

While at it, also fix error handling in the probe function.

Reported-by: Urja Rannikko &lt;urjaman@gmail.com&gt;
Cc: Urja Rannikko &lt;urjaman@gmail.com&gt;
Fixes: 6fce0a2cf5a05 ("mfd / platform: cros_ec: Move debugfs attributes to its own driver")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Benson Leung &lt;bleung@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: Fix locking pattern in wilco_ec_mailbox()</title>
<updated>2019-03-18T17:29:40Z</updated>
<author>
<name>Nick Crews</name>
<email>ncrews@chromium.org</email>
</author>
<published>2019-03-11T15:58:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6f8f89ce1e18de1e391c9c1c14e7738881d1c00c'/>
<id>urn:sha1:6f8f89ce1e18de1e391c9c1c14e7738881d1c00c</id>
<content type='text'>
Before, ec-&gt;data_buffer could be written to from multiple
contexts at the same time. Since the ec is shared data,
it needs to be inside the mutex as well.

Fixes: 7b3d4f44abf0 ("platform/chrome: Add new driver for Wilco EC")
Signed-off-by: Nick Crews &lt;ncrews@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Signed-off-by: Benson Leung &lt;bleung@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: fix wilco-ec dependencies</title>
<updated>2019-03-05T10:35:46Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2019-03-04T20:06:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2794449576a6024e203eca5cc2c1a3ae33102b8e'/>
<id>urn:sha1:2794449576a6024e203eca5cc2c1a3ae33102b8e</id>
<content type='text'>
When CROS_EC_LPC is set to =m, we get a link failure for a
builtin wilco-ec module:

drivers/platform/chrome/wilco_ec/core.o: In function `wilco_ec_remove':
core.c:(.text+0x26): undefined reference to `cros_ec_lpc_mec_destroy'
drivers/platform/chrome/wilco_ec/core.o: In function `wilco_ec_probe':
core.c:(.text+0x18c): undefined reference to `cros_ec_lpc_mec_init'
core.c:(.text+0x224): undefined reference to `cros_ec_lpc_mec_destroy'
drivers/platform/chrome/wilco_ec/mailbox.o: In function `wilco_ec_mailbox':
mailbox.c:(.text+0x104): undefined reference to `cros_ec_lpc_io_bytes_mec'

The problem with the existing CROS_EC_LPC_MEC dependency is that this
is only for a 'bool' symbol, so the information about the exported
functions being in a module is lost on the way, and we actually have
to depend on both CROS_EC_LPC and CROS_EC_LPC_MEC.

Fixes: 7b3d4f44abf0 ("platform/chrome: Add new driver for Wilco EC")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: wilco_ec: Add RTC driver</title>
<updated>2019-02-21T20:36:53Z</updated>
<author>
<name>Nick Crews</name>
<email>ncrews@chromium.org</email>
</author>
<published>2019-02-09T00:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d2f2a3da1f2a9ebeb66bb03073dd149fccf1bdd'/>
<id>urn:sha1:0d2f2a3da1f2a9ebeb66bb03073dd149fccf1bdd</id>
<content type='text'>
This Embedded Controller has an internal RTC that is exposed
as a standard RTC class driver with read/write functionality.

The driver is added to the drivers/rtc/ so that the maintainer of that
directory will be able to comment on this change, as that maintainer is
the expert on this system. In addition, the driver code is called
indirectly after a corresponding device is registered from core.c,
as opposed to core.c registering the driver callbacks directly.

To test:
&gt; hwclock --show --rtc /dev/rtc1
2007-12-31 16:01:20.460959-08:00
&gt; hwclock --systohc --rtc /dev/rtc1
&gt; hwclock --show --rtc /dev/rtc1
2018-11-29 17:08:00.780793-08:00

&gt; hwclock --show --rtc /dev/rtc1
2007-12-31 16:01:20.460959-08:00
&gt; hwclock --systohc --rtc /dev/rtc1
&gt; hwclock --show --rtc /dev/rtc1
2018-11-29 17:08:00.780793-08:00

Signed-off-by: Duncan Laurie &lt;dlaurie@google.com&gt;
Signed-off-by: Nick Crews &lt;ncrews@chromium.org&gt;
Acked-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
[Fix the sparse warning: symbol 'wilco_ec_rtc_read/write' was not declared]
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: wilco_ec: Add support for raw commands in debugfs</title>
<updated>2019-02-21T20:36:21Z</updated>
<author>
<name>Nick Crews</name>
<email>ncrews@chromium.org</email>
</author>
<published>2019-02-09T00:37:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b787bb126cbcd73754bcbc055ae9f804ac576e4a'/>
<id>urn:sha1:b787bb126cbcd73754bcbc055ae9f804ac576e4a</id>
<content type='text'>
Add a debugfs attribute that allows sending raw commands to the EC.
This is useful for development and debug but should not be enabled
in a production environment.

To test:
Get the EC firmware build date
First send the request command
&gt; echo 00 f0 38 00 03 00 &gt; raw
Then read the result. "12/21/18" is in the middle of the response
&gt; cat raw
00 31 32 2f 32 31 2f 31 38 00 00 0f 01 00 01 00  .12/21/18.......

Get the EC firmware build date
First send the request command
&gt; echo 00 f0 38 00 03 00 &gt; raw
Then read the result. "12/21/18" is in the middle of the response
&gt; cat raw
00 31 32 2f 32 31 2f 31 38 00 00 0f 01 00 01 00  .12/21/18.......

Signed-off-by: Duncan Laurie &lt;dlaurie@google.com&gt;
Signed-off-by: Nick Crews &lt;ncrews@chromium.org&gt;
[Fix off-by-one error in wilco_ec/debugfs.c]
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: Add new driver for Wilco EC</title>
<updated>2019-02-21T20:35:59Z</updated>
<author>
<name>Nick Crews</name>
<email>ncrews@chromium.org</email>
</author>
<published>2019-02-09T00:37:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7b3d4f44abf0e7a1ba762c8a9c99a8b39ee0c8b1'/>
<id>urn:sha1:7b3d4f44abf0e7a1ba762c8a9c99a8b39ee0c8b1</id>
<content type='text'>
This EC is an incompatible variant of the typical Chrome OS embedded
controller.  It uses the same low-level communication and a similar
protocol with some significant differences.  The EC firmware does
not support the same mailbox commands so it is not registered as a
cros_ec device type.  This commit exports the wilco_ec_mailbox()
function so that other modules can use it to communicate with the EC.

Signed-off-by: Duncan Laurie &lt;dlaurie@google.com&gt;
Signed-off-by: Nick Crews &lt;ncrews@chromium.org&gt;
[Fix the sparse warning: symbol 'wilco_ec_transfer' was not declared]
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
[Fix Kconfig dependencies for wilco_ec]
Reported-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Remove cros_ec dependency in lpc_mec</title>
<updated>2019-02-11T09:07:40Z</updated>
<author>
<name>Nick Crews</name>
<email>ncrews@chromium.org</email>
</author>
<published>2019-02-09T00:37:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6b7cb2227d4d833aaccb3e98214015f2162d5bb0'/>
<id>urn:sha1:6b7cb2227d4d833aaccb3e98214015f2162d5bb0</id>
<content type='text'>
In order to allow this code to be re-used, remove the dependency
on the rest of the cros_ec code from the cros_ec_lpc_mec functions.

Instead of using a hardcoded register base address of 0x800 have
this be passed in to cros_ec_lpc_mec_init().  The existing cros_ec
use case now passes in the 0x800 base address this way.

There are some error checks that happen in cros_ec_lpc_mec_in_range()
that probably shouldn't be there, as they are checking kernel-space
callers and not user-space input. However, we'll just do the refactor in
this patch, and in a future patch might remove this error checking and
fix all the instances of code that calls this.

There's a similar problem in cros_ec_lpc_read_bytes(), where we return a
checksum, but on error just return 0. This should probably be changed so
that it returns int, but we don't want to have to mess with all the
calling code for this fix. Maybe we'll come back through later and fix
this.

Signed-off-by: Duncan Laurie &lt;dlaurie@google.com&gt;
Signed-off-by: Nick Crews &lt;ncrews@chromium.org&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_sysfs: remove pr_fmt() define</title>
<updated>2019-02-01T09:13:06Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2019-01-29T09:38:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=73c935de7fde46c0052cf4b7564e956ce79c02e7'/>
<id>urn:sha1:73c935de7fde46c0052cf4b7564e956ce79c02e7</id>
<content type='text'>
This driver no longer has any pr_{level} messages. Remove the pr_fmt().

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_lightbar: remove pr_fmt() define</title>
<updated>2019-02-01T09:13:06Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2019-01-29T09:38:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6c7901ba88f760f529c07d7b795710dcf3889b7'/>
<id>urn:sha1:d6c7901ba88f760f529c07d7b795710dcf3889b7</id>
<content type='text'>
This driver no longer has any pr_{level} messages. Remove the pr_fmt().

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_kbd_led_backlight: switch to SPDX identifier</title>
<updated>2019-02-01T09:13:06Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2019-01-29T09:38:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0e27a11f3201a9835d5bb584c9842d8d47326073'/>
<id>urn:sha1:0e27a11f3201a9835d5bb584c9842d8d47326073</id>
<content type='text'>
Adopt the SPDX license identifier headers to ease license compliance
management. Also change the term 'Chrome OS' for 'ChromeOS' to be
coherent with other drivers.

Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
</content>
</entry>
</feed>
