From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: "Steinar H. Gunderson" <sesse@google.com>
Cc: broonie@debian.org, linux-samsung-soc@vger.kernel.org,
823552@bugs.debian.org, balbi@kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH] dwc3-exynos: Fix deferred probing storm.
Date: Wed, 25 May 2016 09:54:36 +0200 [thread overview]
Message-ID: <57455A3C.4010707@samsung.com> (raw)
In-Reply-To: <E1b5Hwn-0005Be-UA@pannekake.samfundet.no>
On 05/24/2016 08:13 PM, Steinar H. Gunderson wrote:
> dwc3-exynos has two problems during init if the regulators are slow
> to come up (for instance if the I2C bus driver is not on the initramfs)
> and return probe deferral. First, every time this happens, the driver
> leaks the USB phys created; they need to be deallocated on error.
>
> Second, since the phy devices are created before the regulators fail,
> this means that there's a new device to re-trigger deferred probing,
> which causes it to essentially go into a busy loop of re-probing the
> device until the regulators come up.
>
> Move the phy creation to after the regulators have succeeded, and also
> fix cleanup on failure. On my ODROID XU4 system (with Debian's initramfs
> which doesn't contain the I2C driver), this reduces the number of probe
> attempts (for each of the two controllers) from more than 2000 to eight.
>
> Reported-by: Steinar H. Gunderson <sgunderson@bigfoot.com>
> Signed-off-by: Steinar H. Gunderson <sesse@google.com>
This is the same person so no need for "Reported-by". The reported-by is
used if someone else submits patch after your bug report.
Please (when resubmitting or applying) add following tags:
Fixes: d720f057fda4 ("usb: dwc3: exynos: add nop transceiver support")
Cc: <stable@vger.kernel.org>
This will help downstream (like Debian) using stable kernels.
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Best regards,
Krzysztof
> ---
> drivers/usb/dwc3/dwc3-exynos.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
> index dd5cb55..2f1fb7e 100644
> --- a/drivers/usb/dwc3/dwc3-exynos.c
> +++ b/drivers/usb/dwc3/dwc3-exynos.c
> @@ -128,12 +128,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, exynos);
>
> - ret = dwc3_exynos_register_phys(exynos);
> - if (ret) {
> - dev_err(dev, "couldn't register PHYs\n");
> - return ret;
> - }
> -
> exynos->dev = dev;
>
> exynos->clk = devm_clk_get(dev, "usbdrd30");
> @@ -183,20 +177,29 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
> goto err3;
> }
>
> + ret = dwc3_exynos_register_phys(exynos);
> + if (ret) {
> + dev_err(dev, "couldn't register PHYs\n");
> + goto err4;
> + }
> +
> if (node) {
> ret = of_platform_populate(node, NULL, NULL, dev);
> if (ret) {
> dev_err(dev, "failed to add dwc3 core\n");
> - goto err4;
> + goto err5;
> }
> } else {
> dev_err(dev, "no device node, failed to add dwc3 core\n");
> ret = -ENODEV;
> - goto err4;
> + goto err5;
> }
>
> return 0;
>
> +err5:
> + platform_device_unregister(exynos->usb2_phy);
> + platform_device_unregister(exynos->usb3_phy);
> err4:
> regulator_disable(exynos->vdd10);
> err3:
>
next prev parent reply other threads:[~2016-05-25 7:54 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160515173900.GC21194@sesse.net>
2016-05-21 14:43 ` Endless "supply vcc not found, using dummy regulator" Steinar H. Gunderson
2016-05-23 13:47 ` Steinar H. Gunderson
2016-05-23 14:40 ` Steinar H. Gunderson
2016-05-23 16:24 ` Mark Brown
2016-05-23 17:06 ` Steinar H. Gunderson
2016-05-23 17:46 ` Steinar H. Gunderson
2016-05-23 18:56 ` Mark Brown
2016-05-23 18:44 ` Mark Brown
2016-05-24 15:06 ` Krzysztof Kozlowski
2016-05-24 15:26 ` Steinar H. Gunderson
2016-05-24 15:45 ` Mark Brown
2016-05-24 15:53 ` Krzysztof Kozlowski
2016-05-24 16:44 ` Steinar H. Gunderson
[not found] ` <574478FE.4070800-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-05-24 19:24 ` [PATCH] " Steinar H. Gunderson
2016-05-24 18:13 ` [PATCH] dwc3-exynos: Fix deferred probing storm Steinar H. Gunderson
2016-05-25 7:54 ` Krzysztof Kozlowski [this message]
2016-05-27 9:53 ` Vivek Gautam
2016-05-27 11:46 ` Steinar H. Gunderson
2016-05-27 13:13 ` Krzysztof Kozlowski
[not found] ` <5748480D.8000501-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-05-27 13:12 ` Felipe Balbi
[not found] ` <87bn3rprtw.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-05-27 13:25 ` Steinar H. Gunderson
2016-05-27 13:26 ` Felipe Balbi
2016-05-30 17:46 ` Steinar H. Gunderson
2016-05-24 18:13 ` [PATCH v2] " Steinar H. Gunderson
2016-05-25 12:16 ` [PATCH] Re: Endless "supply vcc not found, using dummy regulator" Anand Moon
2016-05-25 17:52 ` Steinar H. Gunderson
2016-05-26 12:57 ` Steinar H. Gunderson
[not found] ` <20160526125757.GA23797-gdzBep0Ce9heoWH0uzbU5w@public.gmane.org>
2016-05-27 9:32 ` Vivek Gautam
[not found] ` <CAFp+6iE_QW0BDO-Z1Ce5zrUJiToWD_8UtnCFnfKLeaYyys7U8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-27 9:39 ` Steinar H. Gunderson
[not found] ` <20160527093919.GA34987-gdzBep0Ce9heoWH0uzbU5w@public.gmane.org>
2016-05-27 9:43 ` Vivek Gautam
2016-05-24 15:39 ` Mark Brown
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=57455A3C.4010707@samsung.com \
--to=k.kozlowski@samsung.com \
--cc=823552@bugs.debian.org \
--cc=balbi@kernel.org \
--cc=broonie@debian.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sesse@google.com \
/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