From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796091235; b=Y5NC5puMz/ifJVg8C4ctMrng3t1cMQ2jnZrrgATMhbz5s80dctX/6uYAM7n7Fuij1Onm OZlQFUjy7im7e4NnplAxXntdLAMv1Jo5il0ozgHj4QaWnTNbOWO6y538gIzPxhliFAfgU gsuwQRXsd7Ja/kcGsacAwXMZMOpfqBFmjuSuh3RSMLGFjprmA6ykEteDX4TAQrdNFEkVH jeWAtHbAhNhcQh/cK+JCouls2zq4CF7+IO6sXgVYkIyHdTgwrarFOr7Fy87LEYzmVEzcD rQGAxndCsznAkNCwYU76VswXapdGeGdd3+qKdeitruOko2M8VS5l+RsPc9bBwLkEtnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796091235; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=YS/Z2EUC4j0DIJDtW6vcgZDd04gfO67CQTKkpEtzBpk=; b=rBnkxLT1//KqEhtY9hE0crvsTDvUGyraaMGr6zaraHLxT+H8y3/veq/hL5/ypQ/X8sdU bgKk9Gj7z4nw56b9LDMYAkXLHH6YRZBztfa9ri4TgwBb/T0oZZbMPTzpCSW0Qhxq1dZ6u XQIsHIlzzdJb+c0kCXJpgxD0OeY7CjcZm8WqUVRyklJiHd0qM2Dr30G8yNXT5uIZjyr6n LFvtYS1fRp7Vmc/sWSsAv7+A4bhb08vl2fxljw9miBGAgyZUY2o8+yFvhXC458umYBPxU 7EjWfDK8dYZbB877CrzD+lsBbq8HPiSIngDlEstDjO/zbXhiIkfNlncahYwlLl/N1uQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KpXOP1T1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF229606A680 for ; Tue, 1 Dec 2026 02:13:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KpXOP1T1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ED641F00898; Tue, 1 Dec 2026 02:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796091235; bh=YS/Z2EUC4j0DIJDtW6vcgZDd04gfO67CQTKkpEtzBpk=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=KpXOP1T10e3e3khSnvWsxaWCf80Y4wDpow29jxd0GsOcV4UgQcWE1jdyXzTNXjavy 2iXdwmhHedFiQdVtrL8wvZjfSPH8L84xA4aFazlffNjTlObnquMsBGEv4TX93xocxb yZZerLqozoRC8h5pdj/RzyPm5tZayESOrrDqt3v5NXiwRHgOkvV+6oOiIeQlJJQccG 6aDqbjAu62dGlN8FU5MtC9i1nCEtVNzj0fsm0tSYSIlWVLITecI+aFBfX1HVxwwXig NsEZU8vjgSWkLZYv41hudiwchdKhRz+jrRoRSwK5v9BjyG6bn3JV+TLyGboZoL//4d ftURYCSOUq49w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/2] HID: sony: fix battery name clash between RB4 PS5 guitars Reply-To: sashiko-reviews@lists.linux.dev To: "Sanjay Govind" , linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com In-Reply-To: <20261201020704.3545243-4-sanjay.govind9@gmail.com> References: <20261201020704.3545243-2-sanjay.govind9@gmail.com> <20261201020704.3545243-4-sanjay.govind9@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 02:13:54 +0000 X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] HID: sony: unallocated device_id for non-Sixaxis/RB4 battery fallback -- commit 30d3bc106b009d88edc842d4c79b13a204b65426 Author: Sanjay Govind HID: sony: fix battery name clash between RB4 PS5 guitars This commit allocates a device ID for Rock Band 4 PS5 guitars and appends it to the battery power supply name when sc->mac_address is all zeros. > diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c > index 7a25f5acce884..1f1152575ae4e 100644 > --- a/drivers/hid/hid-sony.c > +++ b/drivers/hid/hid-sony.c [ ... ] > @@ -1906,13 +1907,21 @@ static int sony_battery_get_property(struct power= _supply *psy, > =20 > static int sony_battery_probe(struct sony_sc *sc, int append_dev_id) > { > - const char *battery_str_fmt =3D append_dev_id ? > - "sony_controller_battery_%pMR_%i" : > - "sony_controller_battery_%pMR"; > struct power_supply_config psy_cfg =3D { .drv_data =3D sc, }; > struct hid_device *hdev =3D sc->hdev; > + const char *battery_str_fmt; > int ret; > =20 > + /* > + * Devices without a MAC address, such as Rock Band 4 PS5 guitars, > + * would all get the same name, so use the device ID to tell them > + * apart. > + */ > + if (append_dev_id || is_zero_ether_addr(sc->mac_address)) > + battery_str_fmt =3D "sony_controller_battery_%pMR_%i"; > + else > + battery_str_fmt =3D "sony_controller_battery_%pMR"; > + > /* > * Set the default battery level to 100% to avoid low battery warnings > * if the battery is polled before the first device report is received. > @@ -2085,10 +2094,10 @@ static int sony_set_device_id(struct sony_sc *sc) > int ret; > =20 > /* > - * Only Sixaxis controllers get an id. > - * All others are set to -1. > + * Only Sixaxis controllers, and Rock Band 4 PS5 guitars which need it > + * to name their battery, get an id. All others are set to -1. > */ > - if (sc->quirks & SIXAXIS_CONTROLLER) { > + if (sc->quirks & (SIXAXIS_CONTROLLER | RB4_GUITAR_PS5)) { > ret =3D ida_alloc(&sony_device_id_allocator, GFP_KERNEL); > if (ret < 0) { > sc->device_id =3D -1; [Severity: Medium] Should sony_set_device_id() allocate an ID for all SONY_BATTERY_SUPPORT devices instead of only SIXAXIS_CONTROLLER | RB4_GUITAR_PS5? MOTION_CONTROLLER_BT and NAVIGATION_CONTROLLER also register a battery, and if sony_get_bt_devaddr() cannot parse a MAC address from hdev->uniq in sony_check_add(), probe continues with sc->mac_address left all zeros and sc->device_id set to -1. sony_battery_probe() will then register "sony_controller_battery_00:00:00:00:00:00_-1", and connecting a second such controller will fail in devm_power_supply_register() with -EEXIST. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201020704.3545= 243-2-sanjay.govind9@gmail.com?part=3D2