Hans de Goede
bf6e4ee5c4
phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered
...
The power_supply frame-work is not really designed for there to be
long living in kernel references to power_supply devices.
Specifically unregistering a power_supply while some other code has
a reference to it triggers a WARN in power_supply_unregister():
WARN_ON(atomic_dec_return(&psy->use_cnt));
Folllowed by the power_supply still getting removed and the
backing data freed anyway, leaving the tusb1210 charger-detect code
with a dangling reference, resulting in a crash the next time
tusb1210_get_online() is called.
Fix this by only holding the reference in tusb1210_get_online()
freeing it at the end of the function. Note this still leaves
a theoretical race window, but it avoids the issue when manually
rmmod-ing the charger chip driver during development.
Fixes: 48969a5623 ("phy: ti: tusb1210: Add charger detection")
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Link: https://lore.kernel.org/r/20240406140821.18624-1-hdegoede@redhat.com
Signed-off-by: Vinod Koul <vkoul@kernel.org >
2024-04-12 16:57:19 +05:30
..
2024-03-13 18:34:05 -07:00
2024-03-21 13:21:31 -07:00
2024-03-22 10:41:13 -07:00
2024-03-21 13:21:31 -07:00
2024-03-19 12:06:54 +01:00
2024-03-07 20:36:32 -08:00
2024-03-12 17:37:54 +02:00
2024-03-21 13:34:15 -07:00
2024-03-22 12:46:07 -07:00
2024-03-21 12:44:10 -07:00
2024-03-21 13:21:31 -07:00
2024-03-07 11:53:30 -07:00
2024-03-07 21:52:03 +00:00
2024-03-21 13:21:31 -07:00
2024-03-19 11:57:26 -07:00
2024-03-23 14:42:45 -07:00
2024-03-21 13:21:31 -07:00
2024-03-22 10:41:13 -07:00
2024-03-22 10:41:13 -07:00
2024-03-15 14:46:54 -07:00
2024-03-18 15:11:44 -07:00
2024-03-15 11:58:32 -07:00
2024-03-07 20:37:04 +00:00
2024-03-15 12:25:13 -07:00
2024-03-11 20:38:36 -07:00
2024-03-11 18:14:06 -07:00
2024-03-21 21:20:18 +09:00
2024-03-24 13:54:06 -07:00
2024-03-21 13:21:31 -07:00
2024-03-14 10:22:26 -07:00
2024-03-21 19:04:31 -07:00
2024-03-21 13:21:31 -07:00
2024-03-14 09:56:15 -07:00
2024-02-25 19:05:45 +01:00
2024-03-21 10:01:02 -07:00
2024-03-14 18:03:09 -07:00
2024-03-05 20:01:14 -08:00
2024-02-27 11:26:45 +00:00
2024-03-20 09:45:04 +01:00
2024-03-05 21:25:18 +01:00
2024-03-21 13:21:31 -07:00
2024-03-18 15:34:03 -07:00
2024-03-21 12:44:10 -07:00
2024-03-06 14:03:31 +00:00
2024-03-24 10:45:31 -07:00
2024-03-07 20:32:47 +00:00
2024-03-18 21:09:02 +01:00
2024-03-07 20:26:24 -08:00
2024-03-14 18:03:09 -07:00
2024-03-15 17:53:48 -07:00
2024-03-13 12:23:36 -07:00
2024-03-07 20:38:15 +00:00
2024-03-22 12:34:26 -07:00
2024-03-18 17:30:46 +00:00
2024-03-21 13:21:31 -07:00
2024-03-13 10:59:28 -07:00
2024-03-21 12:44:10 -07:00
2024-03-23 08:43:21 -07:00
2024-03-18 17:30:46 +00:00
2024-03-07 20:32:38 +00:00
2024-03-21 15:09:29 -07:00
2024-03-23 08:43:21 -07:00
2024-03-15 11:58:32 -07:00
2024-03-21 13:23:07 -06:00
2024-03-07 20:21:53 +00:00
2024-03-21 13:34:15 -07:00
2024-03-11 10:39:24 +05:30
2024-03-08 10:00:07 +01:00
2024-03-07 21:50:06 +00:00
2024-03-14 10:58:27 -07:00
2024-03-10 09:07:00 +01:00
2024-03-22 10:41:13 -07:00
2024-04-12 16:57:19 +05:30
2024-03-16 11:24:51 -07:00
2024-03-21 13:21:31 -07:00
2024-03-13 11:33:10 -07:00
2024-03-14 10:19:48 -07:00
2024-03-13 20:45:54 +01:00
2024-03-07 21:51:39 +00:00
2024-03-12 17:44:08 -07:00
2024-03-04 11:45:22 +01:00
2024-03-11 18:14:06 -07:00
2024-03-22 09:52:37 -07:00
2024-03-21 10:37:39 -07:00
2024-03-21 17:16:46 -07:00
2024-03-19 11:38:27 -07:00
2024-03-15 12:47:21 -07:00
2024-03-22 13:31:07 -07:00
2024-03-21 15:18:18 -07:00
2024-03-07 20:21:39 +00:00
2024-03-21 14:50:39 -07:00
2024-03-15 12:22:52 -07:00
2024-03-22 09:57:00 -07:00
2024-03-21 13:03:44 -07:00
2024-03-16 16:31:12 -07:00
2024-03-12 10:35:24 -07:00
2024-03-13 20:35:48 +01:00
2024-03-21 12:35:20 -07:00
2024-03-21 12:44:10 -07:00
2024-03-16 16:31:12 -07:00
2024-03-07 21:52:59 +00:00
2024-03-21 12:35:20 -07:00
2024-03-19 02:45:51 -04:00
2024-03-15 13:21:13 -07:00
2024-03-19 08:57:39 -07:00
2024-03-22 10:09:08 -07:00
2024-03-09 11:37:18 +01:00
2024-03-19 03:19:22 -04:00
2024-03-17 12:06:10 -07:00
2024-03-19 08:48:09 -07:00
2024-03-07 08:48:10 +00:00