From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc2: Add missing check for dwc2_vbus_supply_init
Date: Fri, 11 Mar 2022 06:12:54 +0000 [thread overview]
Message-ID: <916406bb-9025-a7c1-4894-79a539d767bd@synopsys.com> (raw)
In-Reply-To: <20220310063328.1581166-1-jiasheng@iscas.ac.cn>
On 3/10/2022 10:33 AM, Jiasheng Jiang wrote:
> As the potential failure of the dwc2_vbus_supply_init(),
> it should be better to handle the return value and check
> it.
>
> Fixes: cd7cd0e6cedf ("usb: dwc2: fix unbalanced use of external vbus-supply")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
> ---
> drivers/usb/dwc2/hcd.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index f63a27d11fac..c8786d223dcd 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -3672,7 +3672,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
> hprt0 |= HPRT0_PWR;
> dwc2_writel(hsotg, hprt0, HPRT0);
> if (!pwr)
> - dwc2_vbus_supply_init(hsotg);
> + retval = dwc2_vbus_supply_init(hsotg);
> break;
>
> case USB_PORT_FEAT_RESET:
> @@ -3722,7 +3722,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
> "In host mode, hprt0=%08x\n", hprt0);
> dwc2_writel(hsotg, hprt0, HPRT0);
> if (!pwr)
> - dwc2_vbus_supply_init(hsotg);
> + retval = dwc2_vbus_supply_init(hsotg);
> }
>
> /* Clear reset bit in 10ms (FS/LS) or 50ms (HS) */
> @@ -4523,7 +4523,9 @@ static int _dwc2_hcd_resume(struct usb_hcd *hcd)
>
> /* Enable external vbus supply after resuming the port. */
> spin_unlock_irqrestore(&hsotg->lock, flags);
> - dwc2_vbus_supply_init(hsotg);
> + ret = dwc2_vbus_supply_init(hsotg);
> + if (ret)
> + return ret;
>
> /* Wait for controller to correctly update D+/D- level */
> usleep_range(3000, 5000);
prev parent reply other threads:[~2022-03-11 6:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 6:33 Jiasheng Jiang
2022-03-11 6:12 ` Minas Harutyunyan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=916406bb-9025-a7c1-4894-79a539d767bd@synopsys.com \
--to=minas.harutyunyan@synopsys.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiasheng@iscas.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®