From: Dmitry Osipenko <digetx@gmail.com>
To: Peter Chen <peter.chen@nxp.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
Felipe Balbi <balbi@kernel.org>,
Matt Merhar <mattmerhar@protonmail.com>,
Nicolas Chauvet <kwizart@gmail.com>,
Peter Geis <pgwipeout@gmail.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 5/8] usb: chipidea: tegra: Support host mode
Date: Wed, 16 Dec 2020 18:56:30 +0300 [thread overview]
Message-ID: <e4a63b73-5fc9-33da-abd5-771b2f3813f6@gmail.com> (raw)
In-Reply-To: <DBBPR04MB79794F5CC440279AF94A48448BC50@DBBPR04MB7979.eurprd04.prod.outlook.com>
16.12.2020 12:32, Peter Chen пишет:
>> ...
>>>> +static int tegra_usb_internal_port_reset(struct ehci_hcd *ehci,
>>>> + u32 __iomem *portsc_reg,
>>>> + unsigned long *flags)
>>>> +{
>>>> + u32 saved_usbintr, temp;
>>>> + unsigned int i, tries;
>>>> + int retval = 0;
>>>> +
>>>> + saved_usbintr = ehci_readl(ehci, &ehci->regs->intr_enable);
>>>> + /* disable USB interrupt */
>>>> + ehci_writel(ehci, 0, &ehci->regs->intr_enable);
>>>> + spin_unlock_irqrestore(&ehci->lock, *flags);
>>>> +
>>>> + /*
>>>> + * Here we have to do Port Reset at most twice for
>>>> + * Port Enable bit to be set.
>>>> + */
>>>> + for (i = 0; i < 2; i++) {
>>>> + temp = ehci_readl(ehci, portsc_reg);
>>>> + temp |= PORT_RESET;
>>>> + ehci_writel(ehci, temp, portsc_reg);
>>>> + mdelay(10);
>>> Needs accurate delay? How about usleep_range?
>> To be hones I don't know for sure whether hub_control() could be used from
>> interrupt context. This mdelay is borrowed from the older ehci-tegra driver.
>>
>> Are you suggesting that it should be safe to sleep here?
>>
> I see msleep is called at tegra_ehci_hub_control at ehci-tegra.c.
> .hub_control is not called at interrupt context.
>
Alright, I'll change to use msleep() in v2, thanks.
next prev parent reply other threads:[~2020-12-16 15:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 20:21 [PATCH v1 0/8] Support Runtime PM and host mode by Tegra ChipIdea USB driver Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 1/8] usb: phy: tegra: Add delay after power up Dmitry Osipenko
2020-12-16 8:51 ` Sergei Shtylyov
2020-12-16 9:09 ` Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 2/8] usb: phy: tegra: Support waking up from a low power mode Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 3/8] usb: chipidea: tegra: Remove MODULE_ALIAS Dmitry Osipenko
2020-12-16 17:58 ` Thierry Reding
2020-12-16 18:06 ` Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 4/8] usb: chipidea: tegra: Rename UDC to USB Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 5/8] usb: chipidea: tegra: Support host mode Dmitry Osipenko
2020-12-16 6:08 ` Peter Chen
2020-12-16 9:07 ` Dmitry Osipenko
2020-12-16 9:22 ` Dmitry Osipenko
2020-12-16 9:32 ` Peter Chen
2020-12-16 9:53 ` Dmitry Osipenko
2020-12-16 15:56 ` Dmitry Osipenko [this message]
2020-12-15 20:21 ` [PATCH v1 6/8] usb: chipidea: tegra: Support runtime PM Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 7/8] usb: host: ehci-tegra: Remove the driver Dmitry Osipenko
2020-12-16 16:45 ` Alan Stern
2020-12-16 17:09 ` Dmitry Osipenko
2020-12-16 17:22 ` Alan Stern
2020-12-16 17:28 ` Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 8/8] ARM: tegra_defconfig: Enable USB_CHIPIDEA and remove USB_EHCI_TEGRA Dmitry Osipenko
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=e4a63b73-5fc9-33da-abd5-771b2f3813f6@gmail.com \
--to=digetx@gmail.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jonathanh@nvidia.com \
--cc=kwizart@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mattmerhar@protonmail.com \
--cc=peter.chen@nxp.com \
--cc=pgwipeout@gmail.com \
--cc=stern@rowland.harvard.edu \
--cc=thierry.reding@gmail.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
Powered by JetHome