From patchwork Mon May 23 13:47:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Steinar H. Gunderson" X-Patchwork-Id: 9131863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B47B60761 for ; Mon, 23 May 2016 13:47:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9374228220 for ; Mon, 23 May 2016 13:47:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8871F28239; Mon, 23 May 2016 13:47:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=2.0 tests=BAYES_00,FAKE_REPLY_C, FREEMAIL_FROM,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF86E28220 for ; Mon, 23 May 2016 13:47:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753312AbcEWNrq (ORCPT ); Mon, 23 May 2016 09:47:46 -0400 Received: from cassarossa.samfundet.no ([193.35.52.29]:52755 "EHLO cassarossa.samfundet.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753251AbcEWNrp (ORCPT ); Mon, 23 May 2016 09:47:45 -0400 Received: from pannekake.samfundet.no ([2001:67c:29f4::50] ident=unknown) by cassarossa.samfundet.no with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b4qCn-00030d-Tf; Mon, 23 May 2016 15:47:38 +0200 Received: from sesse by pannekake.samfundet.no with local (Exim 4.84_2) (envelope-from ) id 1b4qCn-0007Sl-RK; Mon, 23 May 2016 15:47:37 +0200 Date: Mon, 23 May 2016 15:47:37 +0200 From: "Steinar H. Gunderson" To: linux-samsung-soc@vger.kernel.org Cc: 823552@bugs.debian.org, broonie@kernel.org Subject: Re: Endless "supply vcc not found, using dummy regulator" Message-ID: <20160523134737.GA21683@sesse.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160521144308.GA13960@sesse.net> X-Operating-System: Linux 4.4.0 on a x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, May 21, 2016 at 04:43:08PM +0200, Steinar H. Gunderson wrote: > I still have this problem. > > I've noticed that somehow, there's a huge amount of USB PHYs being autodetected; > probably related to this issue. > > sesse@soldroid:~$ ls -ld /sys/devices/platform/usb_phy* | wc -l > 4288 I've tracked this down partially. It has to do with probe deferral; for whatever reason, the vdd33 regulator isn't available when the dwc3 driver comes up, and this causes the probe to defer. For each and every such deferral, these messages are printed by the regulator subsystem as part of things attempted probed before vdd33. I don't understand entirely why it tries 2000+ times before it succeeds, but then I don't understand probe deferral very well to begin with. I also don't know if there's a way to avoid these messages for each time, but it seems this is a common problem: https://lkml.org/lkml/2016/3/16/269 In this case, it's not just an annoyance, though; they're so many that they keep the system from booting unless loglevel is turned down. Cc-ing Mark in case he has any insights (I hope I have the right email address). The reason for the huge amount of PHYs is that the driver doesn't clean them up on failure (including probe deferral), so they leak. This is easy to fix; I'm attaching a small fix below. From 6df2ebcbaae74577d49dbbc41e28d52084a124b0 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 23 May 2016 15:44:37 +0200 Subject: [PATCH 1/1] dwc3-exynos: Clean up phys on probe failure. Otherwise, they would leak, which is especially bad given probe deferral (one could end up with thousands of dead phys after a normal boot) Signed-off-by: Steinar H. Gunderson --- drivers/usb/dwc3/dwc3-exynos.c | 2 ++ 1 file changed, 2 insertions(+) /* Steinar */ diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index dd5cb55..4104ef5 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -202,6 +202,8 @@ err4: err3: regulator_disable(exynos->vdd33); err2: + platform_device_unregister(exynos->usb2_phy); + platform_device_unregister(exynos->usb3_phy); clk_disable_unprepare(exynos->axius_clk); clk_disable_unprepare(exynos->susp_clk); clk_disable_unprepare(exynos->clk);