usb: musb: remove extra check in musb_gadget_vbus_draw

Message ID 1668416387-24984-1-git-send-email-ivo.g.dimitrov.75@gmail.com
State New
Headers
Series usb: musb: remove extra check in musb_gadget_vbus_draw |

Commit Message

Ivaylo Dimitrov Nov. 14, 2022, 8:59 a.m. UTC
  The check for musb->xceiv->set_power duplicates the check done in
usb_phy_set_power(). Moreover, not calling usb_phy_set_power() results in
current USB config max current not being propagated through usb_charger FW

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 drivers/usb/musb/musb_gadget.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Greg KH Nov. 22, 2022, 4:11 p.m. UTC | #1
On Mon, Nov 14, 2022 at 10:59:47AM +0200, Ivaylo Dimitrov wrote:
> The check for musb->xceiv->set_power duplicates the check done in
> usb_phy_set_power(). Moreover, not calling usb_phy_set_power() results in
> current USB config max current not being propagated through usb_charger FW

What does "FW" mean here?

> 
> Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> ---
>  drivers/usb/musb/musb_gadget.c | 2 --
>  1 file changed, 2 deletions(-)

And is this a bugfix?  If so, what commit id does it fix?  Should it go
to stable kernels?  What hardware was this tested on that this solved a
problem for?

Please fix this and send a v2.

thanks,

greg k-h
  
Tony Lindgren Nov. 23, 2022, 7:12 a.m. UTC | #2
* Greg KH <gregkh@linuxfoundation.org> [221122 16:01]:
> On Mon, Nov 14, 2022 at 10:59:47AM +0200, Ivaylo Dimitrov wrote:
> > The check for musb->xceiv->set_power duplicates the check done in
> > usb_phy_set_power(). Moreover, not calling usb_phy_set_power() results in
> > current USB config max current not being propagated through usb_charger FW
> 
> What does "FW" mean here?
> 
> > 
> > Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> > ---
> >  drivers/usb/musb/musb_gadget.c | 2 --
> >  1 file changed, 2 deletions(-)
> 
> And is this a bugfix?  If so, what commit id does it fix?  Should it go
> to stable kernels?  What hardware was this tested on that this solved a
> problem for?
> 
> Please fix this and send a v2.

Ivaylo please also test with the musb phy changes in Linux next that might
affect this patch.

Regards,

Tony
  

Patch

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 6704a62..ba20272d 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1628,8 +1628,6 @@  static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
 {
 	struct musb	*musb = gadget_to_musb(gadget);
 
-	if (!musb->xceiv->set_power)
-		return -EOPNOTSUPP;
 	return usb_phy_set_power(musb->xceiv, mA);
 }