FAILED: patch "[PATCH] usb: musb: remove extra check in musb_gadget_vbus_draw" failed to apply to 5.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Possible dependencies:
ecec4b20d29c ("usb: musb: remove extra check in musb_gadget_vbus_draw") a6d45ea063f0 ("usb: musb: Allow running without CONFIG_USB_PHY")21acc656a06e ("usb: musb: Add and use inline functions musb_{get,set}_state") df561f6688fe ("treewide: Use fallthrough pseudo-keyword")37711e5e2325 ("Merge tag 'nfs-for-5.9-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ecec4b20d29c3d6922dafe7d2555254a454272d2 Mon Sep 17 00:00:00 2001
From: Ivaylo Dimitrov <[email protected]>
Date: Fri, 25 Nov 2022 20:21:15 +0200
Subject: [PATCH] usb: musb: remove extra check in musb_gadget_vbus_draw
The checks for musb->xceiv and musb->xceiv->set_power duplicate those in usb_phy_set_power(), so there is no need of them. Moreover, not calling usb_phy_set_power() results in usb_phy_set_charger_current() not being called, so current USB config max current is not propagated through USB charger framework and charger drivers may try to draw more current than allowed or possible.
Fix that by removing those extra checks and calling usb_phy_set_power() directly.
Tested on Motorola Droid4 and Nokia N900
drivers/usb/musb/musb_gadget.c +0 -2
@@ -1630,8 +1630,6 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) {struct musb *musb =gadget_to_musb (gadget); -if (!musb->xceiv || !musb->xceiv->set_power) -return -EOPNOTSUPP ;return usb_phy_set_power (musb->xceiv, mA); }