<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/platform/chrome, branch v6.1.87</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.87</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.87'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-11-28T17:06:56+00:00</updated>
<entry>
<title>platform/chrome: kunit: initialize lock for fake ec_dev</title>
<updated>2023-11-28T17:06:56+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-10-03T08:05:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6edd5ea5040be04174e829c7fe84573c58114ad3'/>
<id>urn:sha1:6edd5ea5040be04174e829c7fe84573c58114ad3</id>
<content type='text'>
[ Upstream commit e410b4ade83d06a046f6e32b5085997502ba0559 ]

cros_ec_cmd_xfer() uses ec_dev-&gt;lock.  Initialize it.

Otherwise, dmesg shows the following:
&gt; DEBUG_LOCKS_WARN_ON(lock-&gt;magic != lock)
&gt; ...
&gt; Call Trace:
&gt;  ? __mutex_lock
&gt;  ? __warn
&gt;  ? __mutex_lock
&gt;  ...
&gt;  ? cros_ec_cmd_xfer

Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Link: https://lore.kernel.org/r/20231003080504.4011337-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: chromeos_acpi: print hex string for ACPI_TYPE_BUFFER</title>
<updated>2023-09-13T07:43:03+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-08-03T01:12:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a3f6c1447db81028dfa9d01efed5faa30c367547'/>
<id>urn:sha1:a3f6c1447db81028dfa9d01efed5faa30c367547</id>
<content type='text'>
commit 0820debb7d489e9eb1f68b7bb69e6ae210699b3f upstream.

`element-&gt;buffer.pointer` should be binary blob.  `%s` doesn't work
perfect for them.

Print hex string for ACPI_TYPE_BUFFER.  Also update the documentation
to reflect this.

Fixes: 0a4cad9c11ad ("platform/chrome: Add ChromeOS ACPI device driver")
Cc: stable@vger.kernel.org
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20230803011245.3773756-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_typec_switch: Add missing fwnode_handle_put()</title>
<updated>2023-05-11T14:03:16+00:00</updated>
<author>
<name>Liang He</name>
<email>windhl@126.com</email>
</author>
<published>2023-03-22T04:16:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=830d79af9eee9ad0b18074110c547eaa748a3ec1'/>
<id>urn:sha1:830d79af9eee9ad0b18074110c547eaa748a3ec1</id>
<content type='text'>
[ Upstream commit dc70234c408c644505a24362b0f095f713e4697e ]

In cros_typec_register_switches(), we should add fwnode_handle_put()
when break out of the iteration device_for_each_child_node()
as it will automatically increase and decrease the refcounter.

Fixes: affc804c44c8 ("platform/chrome: cros_typec_switch: Add switch driver")
Signed-off-by: Liang He &lt;windhl@126.com&gt;
Link: https://lore.kernel.org/r/20230322041657.1857001-1-windhl@126.com
Signed-off-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl</title>
<updated>2023-03-30T10:49:12+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2023-03-24T01:06:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eab28bfafcd1245a3510df9aa9eb940589956ea6'/>
<id>urn:sha1:eab28bfafcd1245a3510df9aa9eb940589956ea6</id>
<content type='text'>
[ Upstream commit b20cf3f89c56b5f6a38b7f76a8128bf9f291bbd3 ]

It is possible to peep kernel page's data by providing larger `insize`
in struct cros_ec_command[1] when invoking EC host commands.

Fix it by using zeroed memory.

[1]: https://elixir.bootlin.com/linux/v6.2/source/include/linux/platform_data/cros_ec_proto.h#L74

Fixes: eda2e30c6684 ("mfd / platform: cros_ec: Miscellaneous character device to talk with the EC")
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/20230324010658.1082361-1-tzungbi@kernel.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_typec: Update port DP VDO</title>
<updated>2023-03-10T08:32:52+00:00</updated>
<author>
<name>Prashant Malani</name>
<email>pmalani@chromium.org</email>
</author>
<published>2022-12-28T00:45:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ffe7de184cb2e61c169f21c1ef85360683dde65'/>
<id>urn:sha1:8ffe7de184cb2e61c169f21c1ef85360683dde65</id>
<content type='text'>
[ Upstream commit 8d2b28df6c3dc1581d856f52d9f78059ef2a568f ]

The port advertising DP support is a Type-C receptacle. Fix the port's
DisplayPort VDO to reflect this.

Fixes: 1903adae0464 ("platform/chrome: cros_ec_typec: Add bit offset for DP VDO")
Signed-off-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20221228004648.793339-6-pmalani@chromium.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_typec: zero out stale pointers</title>
<updated>2022-12-31T12:32:00+00:00</updated>
<author>
<name>Victor Ding</name>
<email>victording@chromium.org</email>
</author>
<published>2022-12-07T09:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6613f36a2fa5c69e528bccba8b3d831f759dad2f'/>
<id>urn:sha1:6613f36a2fa5c69e528bccba8b3d831f759dad2f</id>
<content type='text'>
[ Upstream commit 9a8aadcf0b459c1257b9477fd6402e1d5952ae07 ]

`cros_typec_get_switch_handles` allocates four pointers when obtaining
type-c switch handles. These pointers are all freed if failing to obtain
any of them; therefore, pointers in `port` become stale. The stale
pointers eventually cause use-after-free or double free in later code
paths. Zeroing out all pointer fields after freeing to eliminate these
stale pointers.

Fixes: f28adb41dab4 ("platform/chrome: cros_ec_typec: Register Type C switches")
Fixes: 1a8912caba02 ("platform/chrome: cros_ec_typec: Get retimer handle")
Signed-off-by: Victor Ding &lt;victording@chromium.org&gt;
Acked-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/20221207093924.v2.1.I1864b6a7ee98824118b93677868d22d3750f439b@changeid
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>platform/chrome: cros_usbpd_notify: Fix error handling in cros_usbpd_notify_init()</title>
<updated>2022-12-31T12:31:57+00:00</updated>
<author>
<name>Yuan Can</name>
<email>yuancan@huawei.com</email>
</author>
<published>2022-11-17T08:08:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=751f12696d797e785d2611099fe9f0569d47556e'/>
<id>urn:sha1:751f12696d797e785d2611099fe9f0569d47556e</id>
<content type='text'>
[ Upstream commit 5a2d96623670155d94aca72c320c0ac27bdc6bd2 ]

The following WARNING message was given when rmmod cros_usbpd_notify:

 Unexpected driver unregister!
 WARNING: CPU: 0 PID: 253 at drivers/base/driver.c:270 driver_unregister+0x8a/0xb0
 Modules linked in: cros_usbpd_notify(-)
 CPU: 0 PID: 253 Comm: rmmod Not tainted 6.1.0-rc3 #24
 ...
 Call Trace:
  &lt;TASK&gt;
  cros_usbpd_notify_exit+0x11/0x1e [cros_usbpd_notify]
  __x64_sys_delete_module+0x3c7/0x570
  ? __ia32_sys_delete_module+0x570/0x570
  ? lock_is_held_type+0xe3/0x140
  ? syscall_enter_from_user_mode+0x17/0x50
  ? rcu_read_lock_sched_held+0xa0/0xd0
  ? syscall_enter_from_user_mode+0x1c/0x50
  do_syscall_64+0x37/0x90
  entry_SYSCALL_64_after_hwframe+0x63/0xcd
 RIP: 0033:0x7f333fe9b1b7

The reason is that the cros_usbpd_notify_init() does not check the return
value of platform_driver_register(), and the cros_usbpd_notify can
install successfully even if platform_driver_register() failed.

Fix by checking the return value of platform_driver_register() and
unregister cros_usbpd_notify_plat_driver when it failed.

Fixes: ec2daf6e33f9 ("platform: chrome: Add cros-usbpd-notify driver")
Signed-off-by: Yuan Can &lt;yuancan@huawei.com&gt;
Reviewed-by: Brian Norris &lt;briannorris@chromium.org&gt;
Link: https://lore.kernel.org/r/20221117080823.77549-1-yuancan@huawei.com
Signed-off-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'tag-chrome-platform-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux</title>
<updated>2022-10-05T17:14:48+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-10-05T17:14:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1c2daf52185bbc91421f0e84e6bf2706bb350cce'/>
<id>urn:sha1:1c2daf52185bbc91421f0e84e6bf2706bb350cce</id>
<content type='text'>
Pull chrome platform updates from Tzung-Bi Shih:
 "cros_ec_proto:
   - Fix protocol failure if EC firmware jumps to RO part

  cros_typec_switch:
   - Add USB Type-C switch driver for mode switches and retimers
   - Integrate to EC for retimers, status update, and mode switches
   - Clean-ups

  cros_ec_typec:
   - Clean-ups
   - Use partner PDOs to register USB PD capabilities

  chromeos_laptop:
   - Fix a double-free

  cros_ec_chardev:
   - Check data length from userland to avoid a memory corruption

  cros_ec:
   - Expose suspend_timeout_ms in debugfs
   - Notify the PM about wake events during resume"

* tag 'tag-chrome-platform-for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: cros_ec: Notify the PM of wake events during resume
  platform/chrome: cros_ec_typec: Register partner PDOs
  platform/chrome: cros_typec_switch: Inline DRV_NAME
  platform/chrome: cros_typec_switch: Use PTR_ERR_OR_ZERO() to simplify
  platform/chrome: cros_typec_switch: Remove impossible condition
  platform/chrome: cros_typec_switch: Add missing newline on printk
  platform/chrome: cros_ec_typec: Correct alt mode index
  platform/chrome: cros_ec_typec: Add bit offset for DP VDO
  platform/chrome: cros_ec: Expose suspend_timeout_ms in debugfs
  platform/chrome: fix memory corruption in ioctl
  platform/chrome: fix double-free in chromeos_laptop_prepare()
  platform/chrome: cros_ec_typec: Get retimer handle
  platform/chrome: cros_ec_typec: Cleanup switch handle return paths
  platform/chrome: cros_typec_switch: Register mode switches
  platform/chrome: cros_typec_switch: Add event check
  platform/chrome: cros_typec_switch: Set EC retimer
  platform/chrome: cros_typec_switch: Add switch driver
  platform/chrome: Add Type-C mux set command definitions
  platform/chrome: cros_ec_proto: Update version on GET_NEXT_EVENT failure
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Notify the PM of wake events during resume</title>
<updated>2022-09-19T02:34:38+00:00</updated>
<author>
<name>Jameson Thies</name>
<email>jthies@google.com</email>
</author>
<published>2022-09-13T20:49:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8edd2752b0aa498b3a61f3caee8f79f7e0567fad'/>
<id>urn:sha1:8edd2752b0aa498b3a61f3caee8f79f7e0567fad</id>
<content type='text'>
cros_ec_handle_event in the cros_ec driver can notify the PM of wake
events. When a device is suspended, cros_ec_handle_event will not check
MKBP events. Instead, received MKBP events are checked during resume by
cros_ec_report_events_during_suspend. But
cros_ec_report_events_during_suspend cannot notify the PM if received
events are wake events, causing wake events to not be reported if
received while the device is suspended.

Update cros_ec_report_events_during_suspend to notify the PM of wake
events during resume by calling pm_wakeup_event.

Signed-off-by: Jameson Thies &lt;jthies@google.com&gt;
Reviewed-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220913204954.2931042-1-jthies@google.com
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_typec: Register partner PDOs</title>
<updated>2022-09-07T18:02:57+00:00</updated>
<author>
<name>Prashant Malani</name>
<email>pmalani@chromium.org</email>
</author>
<published>2022-08-30T20:20:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=348a2e8c93d3ca622cf1b293cd2f597c9db74d9d'/>
<id>urn:sha1:348a2e8c93d3ca622cf1b293cd2f597c9db74d9d</id>
<content type='text'>
The ChromeOS EC exports partner source/sink cap PDOs (Power Data
Objects) to the application processor (AP). Use this information
to register USB PD (Power Delivery) capabilities with the
USB Type-C Power Delivery device class.

Cc: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Reviewed-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20220830202018.1884851-1-pmalani@chromium.org
[pmalani: Remove extra newline nit from original patch]
</content>
</entry>
</feed>
