<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/power, branch v6.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2023-11-04T02:00:42Z</updated>
<entry>
<title>Merge tag 'usb-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb</title>
<updated>2023-11-04T02:00:42Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-11-04T02:00:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c40c1c6adab90ee4660caf03722b3a3ec67767b'/>
<id>urn:sha1:2c40c1c6adab90ee4660caf03722b3a3ec67767b</id>
<content type='text'>
Pull USB/Thunderbolt updates from Greg KH:
 "Here is the "big" set of USB and Thunderbolt changes for 6.7-rc1.
  Nothing really major in here, just lots of constant development for
  new hardware. Included in here are:

   - Thunderbolt (i.e. USB4) fixes for reported issues and support for
     new hardware types and devices

   - USB typec additions of new drivers and cleanups for some existing
     ones

   - xhci cleanups and expanded tracing support and some platform
     specific updates

   - USB "La Jolla Cove Adapter (LJCA)" support added, and the gpio,
     spi, and i2c drivers for that type of device (all acked by the
     respective subsystem maintainers.)

   - lots of USB gadget driver updates and cleanups

   - new USB dwc3 platforms supported, as well as other dwc3 fixes and
     cleanups

   - USB chipidea driver updates

   - other smaller driver cleanups and additions, full details in the
     shortlog

  All of these have been in the linux-next tree for a while with no
  reported problems"

* tag 'usb-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (167 commits)
  usb: gadget: uvc: Add missing initialization of ssp config descriptor
  usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility
  usb: raw-gadget: report suspend, resume, reset, and disconnect events
  usb: raw-gadget: don't disable device if usb_ep_queue fails
  usb: raw-gadget: properly handle interrupted requests
  usb:cdnsp: remove TRB_FLUSH_ENDPOINT command
  usb: gadget: aspeed_udc: Convert to platform remove callback returning void
  dt-bindings: usb: fsa4480: Add compatible for OCP96011
  usb: typec: fsa4480: Add support to swap SBU orientation
  dt-bindings: usb: fsa4480: Add data-lanes property to endpoint
  usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm()
  Revert "dt-bindings: usb: Add bindings for multiport properties on DWC3 controller"
  Revert "dt-bindings: usb: qcom,dwc3: Add bindings for SC8280 Multiport"
  thunderbolt: Fix one kernel-doc comment
  usb: gadget: f_ncm: Always set current gadget in ncm_bind()
  usb: core: Remove duplicated check in usb_hub_create_port_device
  usb: typec: tcpm: Add additional checks for contaminant
  arm64: dts: rockchip: rk3588s: Add USB3 host controller
  usb: dwc3: add optional PHY interface clocks
  dt-bindings: usb: add rk3588 compatible to rockchip,dwc3
  ...
</content>
</entry>
<entry>
<title>power: reset: vexpress: Use device_get_match_data()</title>
<updated>2023-10-20T22:57:55Z</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2023-10-09T17:29:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=469d31745b9fb3a87424b311abb7cb530611404f'/>
<id>urn:sha1:469d31745b9fb3a87424b311abb7cb530611404f</id>
<content type='text'>
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Acked-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Link: https://lore.kernel.org/r/20231009172923.2457844-19-robh@kernel.org
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>Merge power-supply fixes for 6.6 cycle</title>
<updated>2023-10-20T22:55:43Z</updated>
<author>
<name>Sebastian Reichel</name>
<email>sebastian.reichel@collabora.com</email>
</author>
<published>2023-10-20T22:55:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e186bd1ac2f984f525b319924cfb0e197051ba47'/>
<id>urn:sha1:e186bd1ac2f984f525b319924cfb0e197051ba47</id>
<content type='text'>
Merge power-supply fixes for the 6.6 cycle, so that changes
to the vexpress driver apply cleanly.

Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: surface-charger: replace deprecated strncpy with strscpy</title>
<updated>2023-10-20T22:37:41Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-20T19:46:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=afc88dfda013970bb1e214b331e99adca2f98312'/>
<id>urn:sha1:afc88dfda013970bb1e214b331e99adca2f98312</id>
<content type='text'>
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect ac-&gt;name to be NUL-terminated based on its usage with format
strings:

surface_charger.c:
190: ac-&gt;psy_desc.name = ac-&gt;name;

...

power_supply_core.c:
174: dev_dbg(&amp;psy-&gt;dev, "%s: Found supply : %s\n",
175:   psy-&gt;desc-&gt;name, epsy-&gt;desc-&gt;name);

Moreover, NUL-padding is not required as ac is already zero-allocated
before being passed to spwr_ac_init():

surface_charger.c:
240: ac = devm_kzalloc(&amp;sdev-&gt;dev, sizeof(*ac), GFP_KERNEL);
241: if (!ac)
242:   return -ENOMEM;
243:
244: spwr_ac_init(ac, sdev, p-&gt;registry, p-&gt;name);

... this means any future NUL-byte assignments (like the ones that
strncpy() does) are redundant.

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Let's also opt for the more idiomatic strscpy() usage of:
(dest, src, sizeof(dest))

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-surface_charger-c-v1-1-93ddbf668e10@google.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: surface_battery: replace deprecated strncpy with strscpy</title>
<updated>2023-10-20T22:33:02Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-20T19:39:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81f07d2b0c4db3b6e53d90419db915c75beb6326'/>
<id>urn:sha1:81f07d2b0c4db3b6e53d90419db915c75beb6326</id>
<content type='text'>
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect bat-&gt;name to be NUL-terminated based on its usage with
strcmp():

power_supply_core.c:
445: return strcmp(psy-&gt;desc-&gt;name, name) == 0;

... and also by the manual `... - 1` for the length argument of the
original strncpy() invocation.

Furthermore, no NUL-padding is needed as bat is zero-allocated before
calling spwr_battery_init():
826: bat = devm_kzalloc(&amp;sdev-&gt;dev, sizeof(*bat), GFP_KERNEL);
827: if (!bat)
828:   return -ENOMEM;
829:
830: spwr_battery_init(bat, sdev, p-&gt;registry, p-&gt;name);

... this means any further NUL-byte assignments (like the ones that
strncpy() does) are redundant.

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Let's also opt to use the more idiomatic strscpy() usage of:
(dest, src, sizeof(dest)).

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-surface_battery-c-v2-1-29ed16b2caf1@google.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: charger-manager: replace deprecated strncpy with strscpy</title>
<updated>2023-10-20T22:32:31Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-20T19:21:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e1402bd297a3477c16eca4c1e4094372237f40a7'/>
<id>urn:sha1:e1402bd297a3477c16eca4c1e4094372237f40a7</id>
<content type='text'>
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect cm-&gt;psy_name_buf to be NUL-terminated based on its usage with
format strings:
1522: cm-&gt;charger_psy_desc.name = cm-&gt;psy_name_buf;
...
1587: dev_err(&amp;pdev-&gt;dev, "Cannot register charger-manager with name \"%s\"\n",
1587:   cm-&gt;charger_psy_desc.name);

Moreover, NUL-padding is not required as `cm` is already zero-allocated
and thus any future NUL-byte assignments (like what strncpy() will do)
are redundant:
1437: cm = devm_kzalloc(&amp;pdev-&gt;dev, sizeof(*cm), GFP_KERNEL);

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Let's also opt for the more idiomatic strscpy() usage of:
strscpy(dest, src, sizeof(dest)).

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-charger-manager-c-v1-1-698f73bcad2a@google.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: bq25980: replace deprecated strncpy with strscpy</title>
<updated>2023-10-20T22:29:30Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-20T19:11:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=afb0379b0f6657b9f626d23c3bb00b4e8823bd2d'/>
<id>urn:sha1:afb0379b0f6657b9f626d23c3bb00b4e8823bd2d</id>
<content type='text'>
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect bq-&gt;model_name to be NUL-terminated based on its usage with
sysfs_emit and format strings:

val-&gt;strval is assigned to bq-&gt;model_name in
bq25980_get_charger_property():
|       val-&gt;strval = bq-&gt;model_name;

... then in power_supply_sysfs.c we use value.strval with a format string:
|       ret = sysfs_emit(buf, "%s\n", value.strval);

we assigned value.strval via:
|       ret = power_supply_get_property(psy, psp, &amp;value);
... which invokes psy-&gt;desc-&gt;get_property():
|       return psy-&gt;desc-&gt;get_property(psy, psp, val);

with bq25980_get_charger_property():
|       static const struct power_supply_desc bq25980_power_supply_desc = {
...
|       	.get_property = bq25980_get_charger_property,

Moreover, no NUL-padding is required as bq is zero-allocated in
bq25980_charger.c:
|       bq = devm_kzalloc(dev, sizeof(*bq), GFP_KERNEL);

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Let's also opt to use the more idiomatic strscpy() usage of (dest, src,
sizeof(dest)) as this more closely ties the destination buffer and the
length.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com/
Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq2515x_charger-c-v1-1-46664c6edf78@google.com/
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq25980_charger-c-v1-1-7b93be54537b@google.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: bq256xx: replace deprecated strncpy with strscpy</title>
<updated>2023-10-20T22:28:13Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-20T19:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=056a75599f5e676d497bbf9b29157877f542e56b'/>
<id>urn:sha1:056a75599f5e676d497bbf9b29157877f542e56b</id>
<content type='text'>
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect bq-&gt;model_name to be NUL-terminated based on its usage with
sysfs_emit and format strings:

val-&gt;strval is assigned to bq-&gt;model_name in
bq256xx_get_charger_property():
|       val-&gt;strval = bq-&gt;model_name;

... then in power_supply_sysfs.c we use value.strval with a format string:
|       ret = sysfs_emit(buf, "%s\n", value.strval);

we assigned value.strval via:
|       ret = power_supply_get_property(psy, psp, &amp;value);
... which invokes psy-&gt;desc-&gt;get_property():
|       return psy-&gt;desc-&gt;get_property(psy, psp, val);

with bq256xx_get_charger_property():
|       static const struct power_supply_desc bq256xx_power_supply_desc = {
...
|       	.get_property = bq256xx_get_charger_property,

Moreover, no NUL-padding is required as bq is zero-allocated in
bq256xx_charger.c:
|       bq = devm_kzalloc(dev, sizeof(*bq), GFP_KERNEL);

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Let's also opt to use the more idiomatic strscpy() usage of (dest, src,
sizeof(dest)) as this more closely ties the destination buffer and the
length.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com/
Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq2515x_charger-c-v1-1-46664c6edf78@google.com/
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq256xx_charger-c-v1-1-2fad856124f9@google.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: bq2515x: replace deprecated strncpy with strscpy</title>
<updated>2023-10-20T22:26:51Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-20T18:59:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e3c2af5d49bb96ad460ef6aa873975fb0f7c7f17'/>
<id>urn:sha1:e3c2af5d49bb96ad460ef6aa873975fb0f7c7f17</id>
<content type='text'>
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect bq2515x-&gt;model_name to be NUL-terminated based on its usage with
sysfs_emit and format strings:

val-&gt;strval is assigned to bq2515x-&gt;model_name in
bq2515x_mains_get_property():
|       val-&gt;strval = bq2515x-&gt;model_name;

... then in power_supply_sysfs.c we use value.strval with a format string:
|       ret = sysfs_emit(buf, "%s\n", value.strval);

we assigned value.strval via:
|       ret = power_supply_get_property(psy, psp, &amp;value);
... which invokes psy-&gt;desc-&gt;get_property():
|       return psy-&gt;desc-&gt;get_property(psy, psp, val);

with bq2515x_mains_get_property():
|       static const struct power_supply_desc bq2515x_mains_desc = {
...
|       	.get_property		= bq2515x_mains_get_property,

Moreover, no NUL-padding is required as bq2515x is zero-allocated in
bq2515x_charger.c:
|       bq2515x = devm_kzalloc(dev, sizeof(*bq2515x), GFP_KERNEL);

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Let's also opt to use the more idiomatic strscpy() usage of (dest, src,
sizeof(dest)) as this more closely ties the destination buffer and the
length.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com/
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq2515x_charger-c-v1-1-46664c6edf78@google.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
<entry>
<title>power: supply: bq24190_charger: replace deprecated strncpy with strscpy</title>
<updated>2023-10-20T22:15:17Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-20T18:14:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0009b8bed98bd5d59449af48781703df261c247'/>
<id>urn:sha1:b0009b8bed98bd5d59449af48781703df261c247</id>
<content type='text'>
strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect bdi-&gt;model_name to be NUL-terminated based on its usage with
sysfs_emit and format strings:

val-&gt;strval is assigned to bdi-&gt;model_name in
bq24190_charger_get_property():
1186 | val-&gt;strval = bdi-&gt;model_name;

... then in power_supply_sysfs.c we use value.strval with a format string:
311  | ret = sysfs_emit(buf, "%s\n", value.strval);

we assigned value.strval via:
285  | ret = power_supply_get_property(psy, psp, &amp;value);
... which invokes psy-&gt;desc-&gt;get_property():
1210 | return psy-&gt;desc-&gt;get_property(psy, psp, val);

with bq24190_charger_get_property():
1320 | static const struct power_supply_desc bq24190_charger_desc = {
...
1325 | 	.get_property		= bq24190_charger_get_property,

Moreover, no NUL-padding is required as bdi is zero-allocated in
bq24190_charger.c:
1798 | bdi = devm_kzalloc(dev, sizeof(*bdi), GFP_KERNEL);

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com
Signed-off-by: Sebastian Reichel &lt;sebastian.reichel@collabora.com&gt;
</content>
</entry>
</feed>
