<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/platform/chrome, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/platform/chrome?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/platform/chrome?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-05-16T02:01:52Z</updated>
<entry>
<title>platform/chrome: cros_ec_spi: drop BUG_ON() if `din` isn't large enough</title>
<updated>2022-05-16T02:01:52Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bbd43a37ec7a02e81dc0afb2c6194957518a904b'/>
<id>urn:sha1:bbd43a37ec7a02e81dc0afb2c6194957518a904b</id>
<content type='text'>
It is overkill to crash the kernel if the `din` buffer is going to full
or overflow.

Drop the BUG_ON() and return -EINVAL instead.

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/20220513044143.1045728-8-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_spi: drop unneeded BUG_ON()</title>
<updated>2022-05-16T02:01:51Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ddec8e9e90cea8e8430b04a01adce7fb196d95c6'/>
<id>urn:sha1:ddec8e9e90cea8e8430b04a01adce7fb196d95c6</id>
<content type='text'>
In the context, the following conditions are always false:

- `todo` &lt; 0
Suppose that EC_SPI_FRAME_START is found at the last byte of transfer.

In the case, `ptr` == `end` - 1.  As a result, `todo` must be 0.

- `todo` &gt; `ec_dev-&gt;din_size`
Suppose that there is no preamble bytes.  EC_SPI_FRAME_START is found at
the first byte of transfer.

In the case, `end` == `ptr` + EC_MSG_PREAMBLE_COUNT.
As a result, `todo` == EC_MSG_PREAMBLE_COUNT - 1.
However, it already checked `ec_dev-&gt;din_size` &lt; EC_MSG_PREAMBLE_COUNT at
the beginning of function.

Drop the unneeded BUG_ON().

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/20220513044143.1045728-7-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_i2c: drop BUG_ON() in cros_ec_pkt_xfer_i2c()</title>
<updated>2022-05-16T02:01:51Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=8bff946c4199fd79f43dbff93c030b58b01bed65'/>
<id>urn:sha1:8bff946c4199fd79f43dbff93c030b58b01bed65</id>
<content type='text'>
It is overkill to crash the kernel if the given message is oversize.

Drop the BUG_ON() and return -EINVAL instead.

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/20220513044143.1045728-6-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_get_host_event()</title>
<updated>2022-05-16T02:01:51Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=20a264c97bc8c17d3a7dd7e8d0f72dc57b02c75e'/>
<id>urn:sha1:20a264c97bc8c17d3a7dd7e8d0f72dc57b02c75e</id>
<content type='text'>
It is overkill to crash the kernel if the `ec_dev` doesn't support MKBP
event but gets called into cros_ec_get_host_event().

Drop the BUG_ON() and return error (0 in the case) instead.

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/20220513044143.1045728-5-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_prepare_tx()</title>
<updated>2022-05-16T02:01:51Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c2dcb1b06053a1ccfb73fe84e7b54b92383401cc'/>
<id>urn:sha1:c2dcb1b06053a1ccfb73fe84e7b54b92383401cc</id>
<content type='text'>
It is overkill to crash the kernel if the given message is oversize.

Drop the BUG_ON() and return -EINVAL instead.

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/20220513044143.1045728-4-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: correct cros_ec_prepare_tx() usage</title>
<updated>2022-05-16T02:01:51Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=71d3ae7fb6404c87b498f8b7f86b8271dd74989f'/>
<id>urn:sha1:71d3ae7fb6404c87b498f8b7f86b8271dd74989f</id>
<content type='text'>
cros_ec_prepare_tx() returns either:
- &gt;= 0 for number of prepared bytes.
- &lt; 0 for -errno.

Correct the comment and make sure all callers check the return code.

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/20220513044143.1045728-3-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: drop unneeded BUG_ON() in prepare_packet()</title>
<updated>2022-05-16T02:01:51Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-05-13T04:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=42701e7c0cd2a715def2dafd22f11f25ca0f5024'/>
<id>urn:sha1:42701e7c0cd2a715def2dafd22f11f25ca0f5024</id>
<content type='text'>
prepare_packet() gets called if `ec_dev-&gt;proto_version` &gt; 2.  For now, it
must be equivalent to EC_HOST_REQUEST_VERSION.

Drop the BUG_ON().

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/20220513044143.1045728-2-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: Add ChromeOS ACPI device driver</title>
<updated>2022-05-13T11:42:30Z</updated>
<author>
<name>Enric Balletbo i Serra</name>
<email>enric.balletbo@collabora.com</email>
</author>
<published>2022-05-13T07:52:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0a4cad9c11ad46662ede48d94f08ecb7cd9f6916'/>
<id>urn:sha1:0a4cad9c11ad46662ede48d94f08ecb7cd9f6916</id>
<content type='text'>
The x86 Chromebooks have the ChromeOS ACPI device. This driver attaches
to the ChromeOS ACPI device and exports the values reported by ACPI in a
sysfs directory. This data isn't present in ACPI tables when read
through ACPI tools, hence a driver is needed to do it. The driver gets
data from firmware using the ACPI component of the kernel. The ACPI values
are presented in string form (numbers as decimal values) or binary
blobs, and can be accessed as the contents of the appropriate read only
files in the standard ACPI device's sysfs directory tree. This data is
consumed by the ChromeOS user space.

Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Enric Balletbo i Serra &lt;enric.balletbo@collabora.com&gt;
Co-developed-by: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Signed-off-by: Muhammad Usama Anjum &lt;usama.anjum@collabora.com&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/Yn4OKYrtV35Dv+nd@debian-BULLSEYE-live-builder-AMD64
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_typec: Check for EC driver</title>
<updated>2022-05-10T22:47:40Z</updated>
<author>
<name>Akihiko Odaki</name>
<email>akihiko.odaki@gmail.com</email>
</author>
<published>2022-04-04T04:11:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7464ff8bf2d762251b9537863db0e1caf9b0e402'/>
<id>urn:sha1:7464ff8bf2d762251b9537863db0e1caf9b0e402</id>
<content type='text'>
The EC driver may not be initialized when cros_typec_probe is called,
particulary when CONFIG_CROS_EC_CHARDEV=m.

Signed-off-by: Akihiko Odaki &lt;akihiko.odaki@gmail.com&gt;
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Link: https://lore.kernel.org/r/20220404041101.6276-1-akihiko.odaki@gmail.com
Signed-off-by: Prashant Malani &lt;pmalani@chromium.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_lpcs: reserve the MEC LPC I/O ports first</title>
<updated>2022-05-03T05:43:21Z</updated>
<author>
<name>Dustin L. Howett</name>
<email>dustin@howett.net</email>
</author>
<published>2022-02-17T16:59:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c9bc1a0ef9f613a7bc1adfff4c67dc5e5d7d1709'/>
<id>urn:sha1:c9bc1a0ef9f613a7bc1adfff4c67dc5e5d7d1709</id>
<content type='text'>
Some ChromeOS EC devices (such as the Framework Laptop) only map I/O
ports 0x800-0x807. Making the larger reservation required by the non-MEC
LPC (the 0xFF ports for the memory map, and the 0xFF ports for the
parameter region) is non-viable on these devices.

Since we probe the MEC EC first, we can get away with a smaller
reservation that covers the MEC EC ports. If we fall back to classic
LPC, we can grow the reservation to cover the memory map and the
parameter region.

cros_ec_lpc_probe also interacted with I/O ports 0x800-0x807 without a
reservation. Restructuring the code to request the MEC LPC region first
obviates the need to do so.

Signed-off-by: Dustin L. Howett &lt;dustin@howett.net&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220217165930.15081-3-dustin@howett.net
</content>
</entry>
</feed>
