<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/platform/chrome, branch v6.1.2</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.2</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.2'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-12-31T12:32:00+00:00</updated>
<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>
<entry>
<title>platform/chrome: cros_typec_switch: Inline DRV_NAME</title>
<updated>2022-09-01T02:15:34+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2022-08-30T22:58:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=20dfb74783093e863228d511f7e6a8db8ee39e18'/>
<id>urn:sha1:20dfb74783093e863228d511f7e6a8db8ee39e18</id>
<content type='text'>
This macro is only used one place, let's inline it instead to save a
line or two.

Cc: Prashant Malani &lt;pmalani@chromium.org&gt;
Cc: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@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/20220830225831.2362403-5-swboyd@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_typec_switch: Use PTR_ERR_OR_ZERO() to simplify</title>
<updated>2022-09-01T02:15:34+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2022-08-30T22:58:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dc22a33e35859835b09cff11f445928af0197808'/>
<id>urn:sha1:dc22a33e35859835b09cff11f445928af0197808</id>
<content type='text'>
Use the standard error pointer macro to shorten the code and simplify.

Cc: Prashant Malani &lt;pmalani@chromium.org&gt;
Cc: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@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/20220830225831.2362403-4-swboyd@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_typec_switch: Remove impossible condition</title>
<updated>2022-09-01T02:15:34+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2022-08-30T22:58:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bbb5fb85cf48757a18870aaeedf6936d5c1f1ead'/>
<id>urn:sha1:bbb5fb85cf48757a18870aaeedf6936d5c1f1ead</id>
<content type='text'>
The type of 'index' is unsigned long long, which can't possibly be less
than zero. Remove the impossible check.

Cc: Prashant Malani &lt;pmalani@chromium.org&gt;
Cc: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Signed-off-by: Stephen Boyd &lt;swboyd@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/20220830225831.2362403-3-swboyd@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_typec_switch: Add missing newline on printk</title>
<updated>2022-09-01T02:15:34+00:00</updated>
<author>
<name>Stephen Boyd</name>
<email>swboyd@chromium.org</email>
</author>
<published>2022-08-30T22:58:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8dab6a5939199a5dcf0731eb2dce757837575633'/>
<id>urn:sha1:8dab6a5939199a5dcf0731eb2dce757837575633</id>
<content type='text'>
We need a newline here to ensure the next printk starts fresh.

Cc: Prashant Malani &lt;pmalani@chromium.org&gt;
Cc: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Fixes: affc804c44c8 ("platform/chrome: cros_typec_switch: Add switch driver")
Signed-off-by: Stephen Boyd &lt;swboyd@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/20220830225831.2362403-2-swboyd@chromium.org
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_typec: Correct alt mode index</title>
<updated>2022-08-26T22:34:02+00:00</updated>
<author>
<name>Prashant Malani</name>
<email>pmalani@chromium.org</email>
</author>
<published>2022-08-19T19:08:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e477663e396f48c5cfc5f2d75d4b514f409516a'/>
<id>urn:sha1:4e477663e396f48c5cfc5f2d75d4b514f409516a</id>
<content type='text'>
Alt mode indices used by USB PD (Power Delivery) start with 1, not 0.

Update the alt mdoe registration code to factor this in to the alt mode
descriptor.

Fixes: de0f49487db3 ("platform/chrome: cros_ec_typec: Register partner altmodes")
Signed-off-by: Prashant Malani &lt;pmalani@chromium.org&gt;
Acked-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Reviewed-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
Link: https://lore.kernel.org/r/20220819190807.1275937-3-pmalani@chromium.org
</content>
</entry>
</feed>
