From: Stephen Warren <swarren@wwwdotorg.org>
To: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: host: tegra: Reset Tegra USB controller before init
Date: Mon, 04 Mar 2013 09:55:44 -0700 [thread overview]
Message-ID: <5134D210.3060405@wwwdotorg.org> (raw)
In-Reply-To: <D958900912E20642BCBC71664EFECE3E6E4F7216C0@BGMAIL02.nvidia.com>
On 03/04/2013 12:55 AM, Venu Byravarasu wrote:
> Stephen Warren wrote at Thursday, February 28, 2013 11:47 PM:
>> On 02/27/2013 11:36 PM, Venu Byravarasu wrote:
>>> To clear any configurations made by U-Boot on Tegra USB controller,
>>> reset it before init in probe.
>>
>>> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
>>
>>> @@ -691,6 +692,10 @@ static int tegra_ehci_probe(struct platform_device
>> *pdev)
>>> if (err)
>>> goto fail_clk;
>>>
>>> + tegra_periph_reset_assert(tegra->clk);
>>> + udelay(1);
>>> + tegra_periph_reset_deassert(tegra->clk);
>>
>> I think this patch might cause unintended consequences.
>>
>> When the Tegra PHY code is converted to a driver (i.e. has its own
>> probe), the initial order of execution of the PHY and EHCI driver probes
>> will not be guaranteed.
>>
>> In particular, since the EHCI probe will attempt to "find" the PHY
>> device, and defer the EHCI probe until it can do so, this guarantees
>> that the PHY's probe() will have completed before EHCI's probe()
>> completes (although EHCI's probe may start running first some number of
>> times, and be retried with -EPROBE_DEFERRED for a variety of reasons).
>>
>> Now, if the PHY driver's probe() actually touches HW and sets up some
>> registers, isn't this reset call going to trash any of that register
>> setup? Or, will PHY probe() not touch registers, but only do so during
>> the standard PHY open/init "op"/API calls?
>
> Yes, PHY driver probe does not touch any registers. It just sets up the PHY API hooks.
> These APIs will be called from ehci-tegra.c as part of ehci tegra probe function, after
> getting PHY handle, which in turn happens after issuing above reset.
>
> Thanks to Stephen & Alan, for the review comments.
OK, in that case I have no objection to this patch.
I'd like to hold off on applying this though; I suspect I'll want to
take the Tegra USB patches through the Tegra tree rather than the USB
tree again for the 3.10 kernel cycle. I think I may have screwed the
pooch on the DT binding I set up for the USB controller clocks, and
fixing this may require some Tegra DT changes, which would be easiest
taken through the Tegra tree, and so to reduce conflicts in the USB
code, taking the rest through there migth just be easiest.
Alan, Greg, if you're OK with this patch now, or for any revised
version, an Ack so I can take it through the Tegra tree would be great,
thanks.
next prev parent reply other threads:[~2013-03-04 16:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-28 6:36 [PATCH] usb: host: tegra: Reset Tegra USB controller before init Venu Byravarasu
2013-02-28 15:09 ` Alan Stern
2013-02-28 18:10 ` Stephen Warren
2013-02-28 18:16 ` Stephen Warren
2013-02-28 18:52 ` Alan Stern
2013-02-28 19:11 ` Stephen Warren
2013-03-04 7:55 ` Venu Byravarasu
2013-03-04 16:55 ` Stephen Warren [this message]
2013-03-04 17:38 ` Alan Stern
2013-03-05 0:34 ` gregkh
2013-04-02 7:12 ` Venu Byravarasu
2013-04-02 15:31 ` Stephen Warren
2013-04-03 10:48 ` Venu Byravarasu
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=5134D210.3060405@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=vbyravarasu@nvidia.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