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=1796526298; b=EjE8pLQLTIaaXs/jhh+wRseWotdJYuFkBNdrIGjJ4lHsGFucE4ek+pqF42LYS146sl6+ i2LfFMPHxxcp8NzyMnPlfSO4lBxku72f5OY0CVuXGqwY9XUtArlEW2ZY5hZJ0ofdg8zGz dAurVlLqWRr2Mv3sz+HdEO5obpMKU7AXpt/024oWU1347lKAMJ6etAGD/oIs7MLSsvam7 DJo6UwXeF1pJresXGY/ExWnSF8GRPdu8q+wf0pTpVQu1giG7nL1DPMU7TPpTdZq3K7I/b FR+mPQdvsxgxs9sQglz5IYj8cLSsTRgi6XVyxXETv4AYrlRcZw6/u0Eb2pdmp5bWXsg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796526298; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=rDq/70w7uir00ZZMF9kztoP8SJiTSoEeZP8mx13nDTs=; b=UIcaCe4TogZOu5cgyu76VSGsaNl9OTYdOeCuo6OTMRwkrTKQnDWVpHt+bmJ5QXKwtGGM YcULQfVTapoEqQOK+TvT3TJMzOtRhR43vvwb+pK38FdVvv/AbZ7fsifmMZQkoWfg74bDF dG61Klr/AU6/a9++v5jkMCYXjKuhLYkLvKnjWM1H1ykqXKDMQDPStkcBrWwZi32FBGkU8 Tx+wjArt+hrkN23S/tFxRI65PkBpZrm4ptYXvVJw8vsmPvtFC/uKUEw7a18GXWdfJsLBI LpzVwA9//9ZIJmLWo400bMCvpWAenMNofvCirzhmh0ksu3QC+G1l4Miu3gbyabTizzw== 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=ZBl9capj; 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 0DFA0606A31F for ; Sun, 6 Dec 2026 03:04:58 +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=ZBl9capj Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB7AD1F0092B; Sun, 6 Dec 2026 03:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796526297; bh=rDq/70w7uir00ZZMF9kztoP8SJiTSoEeZP8mx13nDTs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=ZBl9capjoUDzWefBniXAdJAkJUYDa+bFxaV4fZHIkJkpGbnXcpxKSTHxB+9ZEnGfw Y3J48UZDyDUpZ4UnuNJkW1adJPPfa1YzV9dGBbZCD10HqxOkFS4KDAAyVYWlJc0ery hZVv/R7u+Y0c6SIrNErA3BOfaXrIXWKKqtaXRehJI79M/bzndb9U4EOClbXZ4RqsRq jgeBSJ9kosMrGNAvYLCWjUpvCPZko92ZZcQHkHNxKGSRcAubKLPmPFWdGxzmaCxdHJ dPKq3iCfRFsk45GiLrvzQeWg1MSUJWszLXrXhpuNhJq2aXOgnVBdrbQSLsUT8v0DqO M+//45fE03oCA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 04/12] usb: apple-mfi-fastcharge: Use POWER_SUPPLY_TYPE_USB instead of BATTERY Reply-To: sashiko-reviews@lists.linux.dev To: "Rosen Penev" Cc: linux-usb@vger.kernel.org In-Reply-To: <646eafedd084ed43b2ccc078d9881b52c7121342.1796524906.git.rosenp@gmail.com> References: <646eafedd084ed43b2ccc078d9881b52c7121342.1796524906.git.rosenp@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Dec 2026 03:04:57 +0000 X-Mailing-List: linux-usb@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: - [High] usb: apple-mfi-fastcharge: changing type to USB breaks sysfs/uevent ABI -- commit 0d3db2f7dca0ee3251630abcee5663e509cef35a Author: Rosen Penev usb: apple-mfi-fastcharge: Use POWER_SUPPLY_TYPE_USB instead of BATTERY This commit changes the power_supply_desc type registered by apple-mfi-fastcharge from POWER_SUPPLY_TYPE_BATTERY to POWER_SUPPLY_TYPE_USB. > diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/a= pple-mfi-fastcharge.c > index 9ec4bac603951..63ceec5c2c3fe 100644 > --- a/drivers/usb/misc/apple-mfi-fastcharge.c > +++ b/drivers/usb/misc/apple-mfi-fastcharge.c > @@ -178,7 +178,7 @@ static int mfi_fc_probe(struct usb_device *udev) > if (!battery_desc->name) > return -ENOMEM; > =20 > - battery_desc->type =3D POWER_SUPPLY_TYPE_BATTERY; > + battery_desc->type =3D POWER_SUPPLY_TYPE_USB; > battery_desc->properties =3D apple_mfi_fc_properties; > battery_desc->num_properties =3D ARRAY_SIZE(apple_mfi_fc_properties); > battery_desc->get_property =3D apple_mfi_fc_get_property; [Severity: High] Does changing battery_desc->type to POWER_SUPPLY_TYPE_USB break the userspace ABI? Since commit 249fa8217b84 ("USB: Add driver to control USB fast charge for iOS devices"), this driver has reported "Battery" via sysfs type and POWER_SUPPLY_TYPE uevents. Switching it to "USB" breaks existing userspace power managers and udev rules matching Battery. apple_mfi_fc_get_property() already returns POWER_SUPPLY_SCOPE_DEVICE for POWER_SUPPLY_PROP_SCOPE, which is what power_supply_is_system_battery() and userspace use to avoid treating an attached peripheral as a host battery. POWER_SUPPLY_TYPE_USB also denotes a USB power source (typically exposing online or usb_type), whereas this driver only exposes POWER_SUPPLY_PROP_CHARGE_TYPE and POWER_SUPPLY_PROP_SCOPE, matching other device-scoped peripheral charger drivers such as cros_peripheral_charger. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/cover.1796524906.gi= t.rosenp@gmail.com?part=3D4