From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22031C4332F for ; Mon, 19 Dec 2022 15:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232319AbiLSPMy (ORCPT ); Mon, 19 Dec 2022 10:12:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232299AbiLSPMx (ORCPT ); Mon, 19 Dec 2022 10:12:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A55EC6351 for ; Mon, 19 Dec 2022 07:12:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 418DA60FE8 for ; Mon, 19 Dec 2022 15:12:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B4B6C433EF; Mon, 19 Dec 2022 15:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1671462771; bh=Kazsfaz7w1aPjQ5xis9CIVyecM3VcaNih+cWHcQTXPA=; h=Subject:To:Cc:From:Date:From; b=uCiqQvZa/VOWaMmw3RgTECSdY4eef24pA4/hJ0PHO+RRrJZ/nxtjW4HeMv6q2PnhT BRaO3sLYJhQZ2HCGIJy5wOyv4yS16YHiXW+woWzpihTugmxT1RKwqbSQQxcDlEDFh/ H0Wqkgal5lHyays8C0Szp3I35psdZjCuEiV/tvU0= Subject: FAILED: patch "[PATCH] usb: musb: remove extra check in musb_gadget_vbus_draw" failed to apply to 6.1-stable tree To: ivo.g.dimitrov.75@gmail.com, gregkh@linuxfoundation.org, stable@kernel.org Cc: From: Date: Mon, 19 Dec 2022 16:12:48 +0100 Message-ID: <1671462768144122@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 6.1-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 . 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") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ecec4b20d29c3d6922dafe7d2555254a454272d2 Mon Sep 17 00:00:00 2001 From: Ivaylo Dimitrov 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 Fixes: a9081a008f84 ("usb: phy: Add USB charger support") Cc: stable Signed-off-by: Ivaylo Dimitrov Link: https://lore.kernel.org/r/1669400475-4762-1-git-send-email-ivo.g.dimitrov.75@gmail.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 6cb9514ef340..31c44325e828 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -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); }