[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4a63b73-5fc9-33da-abd5-771b2f3813f6@gmail.com>
Date: Wed, 16 Dec 2020 18:56:30 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Peter Chen <peter.chen@....com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Stern <stern@...land.harvard.edu>,
Felipe Balbi <balbi@...nel.org>,
Matt Merhar <mattmerhar@...tonmail.com>,
Nicolas Chauvet <kwizart@...il.com>,
Peter Geis <pgwipeout@...il.com>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 5/8] usb: chipidea: tegra: Support host mode
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.
Powered by blists - more mailing lists