From patchwork Tue Jun 5 23:00:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mats Karrman X-Patchwork-Id: 10449419 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 B40BB60375 for ; Tue, 5 Jun 2018 23:00:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DC9428892 for ; Tue, 5 Jun 2018 23:00:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90266297D7; Tue, 5 Jun 2018 23:00:30 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 1F60328892 for ; Tue, 5 Jun 2018 23:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932070AbeFEXA2 (ORCPT ); Tue, 5 Jun 2018 19:00:28 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35537 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752365AbeFEXA1 (ORCPT ); Tue, 5 Jun 2018 19:00:27 -0400 Received: by mail-lf0-f68.google.com with SMTP id y72-v6so6137386lfd.2 for ; Tue, 05 Jun 2018 16:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=QhC/PCm7t69/6YIi/dgGhUY/6eJNVsIQ6BqRRR+7yEo=; b=l9/iDWqZcIhYwESkB0tvGKviujViYvz/5Thu7jY/v01fvQegdSgkavhxhPYRjidmZC i6jMYiirtBLACe23+cwYSfZmLp0qmUez08aT3Nl/A/jcgVdlacF6D5rvk/pulKdnTSes xaSToLXjCqkZPnCPOe0hcpCNjTxxGzoTg4Z/Yzxe7yESHtc/4PzRk6dHLiFzAUjSpgrJ uLuRdJAnWxOelIFGtHuqrjyt5ugCPvkFLtpkEgZPOqYAnunOm5lHcyUHwbkSxZQCvVfK 8F5gXlvqH5iumlp6dRiDfmhJ/ByElilMlVc72hRR7OUla9AZdf1HnbIltVhwTbiT10LO odZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=QhC/PCm7t69/6YIi/dgGhUY/6eJNVsIQ6BqRRR+7yEo=; b=jKBihtbN5Ya+tOIC4xoyxVHgwb4tWyrw1Jcy6ujaYvYGZcm38b3w0hEQEii06pSYGR wD0Q+QrCO7Jni2r1hf4RwHPpuGbcQY53yXZf839iL1E7IMg9FeHn2xvUBhsuMcfxVcAq y0AcgZnu0VGxI+lEqMSFZksXaEf/wGfXaBv9ZcvJcZim3Jyr5kcoGjOJm5btr5vIaexy MlaHoNkHIDQZYrUSRGwd/dmarUn1nRvLeCr3wF6edr399llD78w0BtXfoAhZRiO6C8fa i/H26fy6HaDS1fA0E8/wa1W/uE43+AmTuU/0GKUlwoJ1JbYmFxUqypeWNeSd2AMSeCKO WYKw== X-Gm-Message-State: APt69E0oTTR9tOOAo29d/4XiKXSiqoD9ulnylXlJJodCR80wnrUZLMtF OnOONtnVHko5pHRnTu2Qsvuk08O8 X-Google-Smtp-Source: ADUXVKKi0Tf+dO899s7M+XaJeWucluLUNJDKFW7y2pfhdXRUhupqqHiDiqKGQATCK4T78fW2TxzsCQ== X-Received: by 2002:a19:5c94:: with SMTP id u20-v6mr266989lfi.138.1528239626191; Tue, 05 Jun 2018 16:00:26 -0700 (PDT) Received: from [192.168.1.232] ([195.84.96.49]) by smtp.gmail.com with ESMTPSA id r81-v6sm10512475lja.36.2018.06.05.16.00.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 16:00:25 -0700 (PDT) Subject: Re: Regression caused by: usb: add a flag to skip PHY initialization to struct usb_hcd To: Peter Chen , "martin.blumenstingl@googlemail.com" Cc: "gregkh@linuxfoundation.org" , "linux-usb@vger.kernel.org" References: <40b5381f-3e91-d430-e449-eb9f0fcc1379@gmail.com> <2fb2a0eb-e523-189d-10d0-0847c75d3c3b@gmail.com> <7ea44325-7ae8-7824-ce96-365aaadd5d8e@gmail.com> <2915ea64-13ee-67ce-b7bd-a3ed16cabe0b@gmail.com> From: Mats Karrman Message-ID: Date: Wed, 6 Jun 2018 01:00:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2018-06-05 02:54, Peter Chen wrote: > >>>> And this is what the "decompiled" device tree entry for the USB >>>> controller and phy look like: >>>> >>>>             usb@2184200 { >>>>                compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; >>>>                 reg = <0x2184200 0x200>; >>>>                 interrupts = <0x0 0x28 0x4>; >>>>                 clocks = <0x4 0xa2>; >>>>                 fsl,usbphy = <0x2c>; >>>>                 fsl,usbmisc = <0x29 0x1>; >>>>                 dr_mode = "host"; >>>>                 ahb-burst-config = <0x0>; >>>>                 tx-burst-size-dword = <0x10>; >>>>                 rx-burst-size-dword = <0x10>; >>>>                 status = "okay"; >>>>                 disable-over-current; >>>>                 vbus-supply = <0x2d>; >>>>             }; >>>> >>>>             usbphy@20ca000 { >>>>                 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; >>>>                 reg = <0x20ca000 0x1000>; >>>>                 interrupts = <0x0 0x2d 0x4>; >>>>                 clocks = <0x4 0xb7>; >>>>                 fsl,anatop = <0x2>; >>>>                 phandle = <0x2c>; >>>>             }; >>>> >>>> So, using deprecated? "fsl,usbphy" instead of "phys", in case that matters. >>>> >>> It is ok. >>> >>> Check two things: >>> - ci->usb_phy is non-NULL, and ci->phy is NULL >> That is correct >> >>> - phy_roothub is NULL at the functions of drivers/usb/core/phy.c >> I put a trace at the beginning of each of the functions of that file but none of them is >> ever called. >> > It is so strange. Please double confirm your git bisect is correct, if it is, try to find which > line causes your regression. Bisect confirmed. Admittedly without really understanding everything that is going on, I put back the deleted lines from this patch chunk and it started working again: Without a value in hcd->usb_phy, the call to usb_phy_notify_disconnect() in hub_port_connect() (usb/core/hub.c) never fires but that is only part of the problem. Hope this helps. BR // Mats diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 19d60ed..af45aa32 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c @@ -124,10 +124,8 @@ static int host_start(struct ci_hdrc *ci)         hcd->power_budget = ci->platdata->power_budget;         hcd->tpl_support = ci->platdata->tpl_support; -       if (ci->phy) -               hcd->phy = ci->phy; -       else -               hcd->usb_phy = ci->usb_phy; +       if (ci->phy || ci->usb_phy) +               hcd->skip_phy_initialization = 1;         ehci = hcd_to_ehci(hcd);        ehci->caps = ci->hw_bank.cap;