Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18318974ybl; Thu, 2 Jan 2020 23:26:34 -0800 (PST) X-Google-Smtp-Source: APXvYqx3Z53/wdqbJ8F4Qslls8ZG5sLgC2FR96mGZqZYDd+LE2YCsafc6ar0dISsjCbhTY+7tvVv X-Received: by 2002:a9d:7cd0:: with SMTP id r16mr101009574otn.50.1578036394131; Thu, 02 Jan 2020 23:26:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578036394; cv=none; d=google.com; s=arc-20160816; b=TditR94iEvaxmCLQRxBCVUxjd4e47u3QfGnFLNJlaWpKGv31JmSi7vykaraKxPtxIW ZPGRqfueN7rvvk6YWUPRWJ8OHZwE0u5Ivu/yrVqRkjAZ35P1CtwNgF4ur9RYMIyMRFHc DrFQp0XXQmL4aYp87ITTtI0avSasEkij/zsEszfRZllJF9d6r5FQs1ncPh/djrjS4dFo FTBGHC9zJZKA1YKlJbIjYIStuAFytwEYvc8CQ1zgWFOXuEPxcHNlEIv4UKbyaccC+4as v20krOY5r/zc6XiIskoRXXihUIuqL2sygmAVyCFszFGl1cQXTAqBUc3/t1RoSVkjkKE6 xUeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eZz/oQKOsYokV/9baeT4qtMsehd8sEdSFqHBIeSzZX0=; b=sQm7I+8lpO6fh5CYWrzP+fXsg3toc4rondVF83DR3dI/m/2ioOf4cNRKWem82OQgK8 XvSjjf8FDwE5Ot8awJ/oGdOJMkHO+tfk1Ihv4d/YMJZWguRJo9aEPzEb/Y3I0lt/kWAo QUmQh4kMB+Ym3eJ+mEVXH+ygNiJiKeBpF1LdqmZXVjmJC+nojiF6hzn+C3GPup+/OKRb Wo3/U5di156MUQf9uL2QoNsmmD/lDCp/LCl8bZBs/rixBKiuJqXBl74tVzJjDcZG57ve D8nnYOgJXc3UHiTGv7Hf9KzDt6X1IgovNmA19Ysbmz8OX5x49rRF3/yoZhMdGDxxyV0l /Cvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=N2xLPdFB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 128si21529783oih.78.2020.01.02.23.26.21; Thu, 02 Jan 2020 23:26:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=N2xLPdFB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726739AbgACHZm (ORCPT + 99 others); Fri, 3 Jan 2020 02:25:42 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:42383 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbgACHZm (ORCPT ); Fri, 3 Jan 2020 02:25:42 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 47pxJf6qxmz7s; Fri, 3 Jan 2020 08:25:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1578036339; bh=01dE5Uj2UX6Z3xkoH4ovrHrnnZMZ0qsgpPflyJoviKk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N2xLPdFB7kkCfcrgZqjz286M4Iq2z2R0bQRr2/j2GroNvf2U1wd814qwT24QmYTsK wtaalcj/wRagy+2bqMZogxgtMskLYpXndjpv4m8npeG3DMrRFU1rPnh3wmowiVo4Ou 0xQTSVD6iaFUGeiSfOR7qjhuL5FJ9zqUoOYydPfLX6wXI93/0W1xQeB8CtV/z7yaxW qM8FlTiLHeAtcRALqEFsX+IqGkj6s/Rv0nNR3hhYvlUUmpwtYbOLjwXRHgZDwDhjm5 Zf5TYIJPES8884u6RB2erVtdPji6I9QiTT0evrg/3Ms7WSe3qF17uIEvZYToyfFR+N 0/vREuSglWQdw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.101.4 at mail Date: Fri, 3 Jan 2020 08:25:36 +0100 From: =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= To: Dmitry Osipenko Cc: Peter Chen , Rob Herring , Greg Kroah-Hartman , Thierry Reding , Jonathan Hunter , Felipe Balbi , "devicetree@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 10/10] usb: chipidea: tegra: Add USB_TEGRA_PHY module to driver's dependencies Message-ID: <20200103072536.GA14228@qmqm.qmqm.pl> References: <20191220015238.9228-1-digetx@gmail.com> <20191220015238.9228-11-digetx@gmail.com> <20191220035650.GC19921@b29397-desktop> <20191223213234.GA28786@qmqm.qmqm.pl> <7174833f-8325-7fb4-d190-78ba4bed0cbb@gmail.com> <20191230210259.GD24135@qmqm.qmqm.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 02, 2020 at 06:17:47PM +0300, Dmitry Osipenko wrote: > 31.12.2019 00:02, Michał Mirosław пишет: > > On Tue, Dec 24, 2019 at 07:21:05AM +0300, Dmitry Osipenko wrote: > >> 24.12.2019 00:32, Michał Mirosław пишет: > >>> On Fri, Dec 20, 2019 at 07:31:08AM +0300, Dmitry Osipenko wrote: > >>>> 20.12.2019 06:56, Peter Chen пишет: > >>>>> On 19-12-20 04:52:38, Dmitry Osipenko wrote: > >>> [...] > >>>>>> --- a/drivers/usb/chipidea/ci_hdrc_tegra.c > >>>>>> +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c > >>>>>> @@ -53,6 +53,12 @@ static int tegra_udc_probe(struct platform_device *pdev) > >>>>>> struct tegra_udc *udc; > >>>>>> int err; > >>>>>> > >>>>>> + if (IS_MODULE(CONFIG_USB_TEGRA_PHY)) { > >>>>>> + err = request_module("phy_tegra_usb"); > >>>>>> + if (err) > >>>>>> + return err; > >>>>>> + } > >>>>>> + > >>>>> > >>>>> Why you do this dependency, if this controller driver can't > >>>>> get USB PHY, it should return error. What's the return value > >>>>> after calling below: > >>>>> > >>>>> udc->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); > >>>> > >>>> It returns -EPROBE_DEFER when phy_tegra_usb isn't loaded. > >>> > >>> How are other driver modules autoloaded? Isn't there an appropriate > >>> MODALIAS or MODULE_DEVICE_TABLE in there? > >> > >> Hello Michał, > >> > >> The phy_tegra_usb module is fine by itself, it's getting autoloaded. > >> > >> The problem is that ci_hdrc_tegra module depends on the phy_tegra_usb > >> module and thus the PHY module should be loaded before the CI module, > >> otherwise CI driver fails with the EPROBE_DEFER. > > > > Why, then, is CI driver not being probed again after PHY driver loads? > > EPROBE_DEFER is what should cause driver core to re-probe a device after > > other devices appear (PHY in this case). > > CI driver is getting re-probed just fine if PHY's driver module is > loaded manually after loading the CI's module. This patch removes this > necessity to manually load PHY's module. > > This is just a minor convenience change that brings the CI's driver > loading behaviour on par with the behaviour of loading Tegra's EHCI > driver module. I fully understand the goal, but what I'm missing is that why this doesn't work out of the box? If the PHY module is autoloaded, and so is CI driver, and (as I understand) the driver's probe() correctly returns EPROBE_DEFER when PHY is not probed yet, then I guess that means bug somewhere else and the patch just covers it up. Best Regards, Michał Mirosław