<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/platform/chrome/cros_ec_proto.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-10-04T03:40:54Z</updated>
<entry>
<title>platform/chrome: cros_ec_proto: Mark outdata as const</title>
<updated>2023-10-04T03:40:54Z</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2023-10-03T00:34:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2f3dd39e2b492bec366487a2c9bcbdbd7792f77c'/>
<id>urn:sha1:2f3dd39e2b492bec366487a2c9bcbdbd7792f77c</id>
<content type='text'>
The 'outdata' is copied to the data buffer in cros_ec_cmd() before being
sent over to the EC. Mark the argument as const so that callers can pass
const pointers to this function and so that callers know the data won't
be modified.

Cc: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@chromium.org&gt;
Acked-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Link: https://lore.kernel.org/r/20231003003429.1378109-5-swboyd@chromium.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure</title>
<updated>2022-08-15T03:24:49Z</updated>
<author>
<name>Patryk Duda</name>
<email>pdk@semihalf.com</email>
</author>
<published>2022-08-02T15:41:28Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f74c7557ed0d321947e8bb4e9d47c1013f8b2227'/>
<id>urn:sha1:f74c7557ed0d321947e8bb4e9d47c1013f8b2227</id>
<content type='text'>
Some EC based devices (e.g. Fingerpint MCU) can jump to RO part of the
firmware (intentionally or due to device reboot). The RO part doesn't
change during the device lifecycle, so it won't support newer version
of EC_CMD_GET_NEXT_EVENT command.

Function cros_ec_query_all() is responsible for finding maximum
supported MKBP event version. It's usually called when the device is
running RW part of the firmware, so the command version can be
potentially higher than version supported by the RO.

The problem was fixed by updating maximum supported version when the
device returns EC_RES_INVALID_VERSION (mapped to -ENOPROTOOPT). That way
the kernel will use highest common version supported by RO and RW.

Fixes: 3300fdd630d4 ("platform/chrome: cros_ec: handle MKBP more events flag")
Cc: &lt;stable@vger.kernel.org&gt; # 5.10+
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Signed-off-by: Patryk Duda &lt;pdk@semihalf.com&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220802154128.21175-1-pdk@semihalf.com
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: return -EPROTO if empty payload</title>
<updated>2022-07-20T01:22:58Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-07-18T05:09:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3e1c715ea179201372384fad738680d524600985'/>
<id>urn:sha1:3e1c715ea179201372384fad738680d524600985</id>
<content type='text'>
cros_ec_wait_until_complete() sends EC_CMD_GET_COMMS_STATUS which expects
to receive sizeof(struct ec_response_get_comms_status) from
cros_ec_xfer_command().

Return -EPROTO if cros_ec_xfer_command() returns 0.

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/20220718050914.2267370-11-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: return -EAGAIN when retries timed out</title>
<updated>2022-07-20T01:22:58Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-07-18T05:09:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7f95d2b68b9a4f6624438f2d7dbad01c157b92a6'/>
<id>urn:sha1:7f95d2b68b9a4f6624438f2d7dbad01c157b92a6</id>
<content type='text'>
While EC_COMMS_STATUS_PROCESSING flag is still on after it tries
EC_COMMAND_RETRIES times for sending EC_CMD_GET_COMMS_STATUS,
cros_ec_wait_until_complete() doesn't return an error code.

Return -EAGAIN in the case 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/20220718050914.2267370-9-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: separate cros_ec_wait_until_complete()</title>
<updated>2022-07-20T01:22:58Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-07-18T05:09:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0aad9aff6a6450f7ea5e980add1b33d40e5bed52'/>
<id>urn:sha1:0aad9aff6a6450f7ea5e980add1b33d40e5bed52</id>
<content type='text'>
EC returns EC_RES_IN_PROGRESS if the host command needs more time to
complete.  Whenever receives the return code, cros_ec_send_command()
sends EC_CMD_GET_COMMS_STATUS to query the command status.

Separate cros_ec_wait_until_complete() from cros_ec_send_command().
It sends EC_CMD_GET_COMMS_STATUS and waits until the previous command
was completed, or encountered error, or timed out.

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/20220718050914.2267370-7-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: separate cros_ec_xfer_command()</title>
<updated>2022-07-20T01:22:58Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-07-18T05:09:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=810be30d27bdfe7923084a5550dfddeed28ac08b'/>
<id>urn:sha1:810be30d27bdfe7923084a5550dfddeed28ac08b</id>
<content type='text'>
cros_ec_send_command() has extra logic to handle EC_RES_IN_PROGRESS.
Separate the command transfer part into cros_ec_xfer_command() so
that other functions can re-use it.

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/20220718050914.2267370-6-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: add "cros_ec_" prefix to send_command()</title>
<updated>2022-07-20T01:22:57Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-07-18T05:09:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d311664b90579c77c66bda18eb93affd4049b255'/>
<id>urn:sha1:d311664b90579c77c66bda18eb93affd4049b255</id>
<content type='text'>
To be neat, add "cros_ec_" prefix to static function send_command().

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/20220718050914.2267370-3-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: Fix spelling mistake "unknwon" -&gt; "unknown"</title>
<updated>2022-06-14T07:01:24Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.i.king@gmail.com</email>
</author>
<published>2022-06-14T06:49:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=203b2aff4786d16ef0cd1a6a9405043a99a5b3fb'/>
<id>urn:sha1:203b2aff4786d16ef0cd1a6a9405043a99a5b3fb</id>
<content type='text'>
There is a spelling mistake in a dev_dbg message. Fix it.

Signed-off-by: Colin Ian King &lt;colin.i.king@gmail.com&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220614064909.47804-1-colin.i.king@gmail.com
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: handle empty payload in getting wake mask</title>
<updated>2022-06-10T02:31:44Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-06-09T08:49:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cfed691b80dce32b62634b1d7f92a661a3b03e4f'/>
<id>urn:sha1:cfed691b80dce32b62634b1d7f92a661a3b03e4f</id>
<content type='text'>
cros_ec_get_host_event_wake_mask() expects to receive
sizeof(struct ec_response_host_event_mask) from send_command().  The
payload is valid only if the return value is positive.

Return -EPROTO if send_command() returns 0 in
cros_ec_get_host_event_wake_mask().

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-22-tzungbi@kernel.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_proto: return 0 on getting wake mask success</title>
<updated>2022-06-10T02:31:44Z</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2022-06-09T08:49:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d65da5f9bb0a5b6f2115bc0e5fcf65c0867fef17'/>
<id>urn:sha1:d65da5f9bb0a5b6f2115bc0e5fcf65c0867fef17</id>
<content type='text'>
cros_ec_get_host_event_wake_mask() used to return value from
send_command() which is number of bytes for input payload on success
(i.e. sizeof(struct ec_response_host_event_mask)).

However, the callers don't need to know how many bytes are available.

Don't return number of available bytes.  Instead, return 0 on success;
otherwise, negative integers on error.

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-20-tzungbi@kernel.org
</content>
</entry>
</feed>
