usb: Remove ehci_reset call from ehci_run

Remove the ehci_reset() call done in the ehci_run() routine of the
USB EHCI host controller driver and add an ehci_reset() call to the
probe processing of all EHCI platform drivers that do not already call
ehci_reset().

The call to ehci_reset() from ehci_run() was problematic for several
platform drivers, and unnecessary for others.  This change moves the
decision to call ehci_reset() at driver startup to the platform
driver code.

Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
This commit is contained in:
Geoff Levand 2011-11-22 18:04:45 -08:00
Родитель 5611cc4572
Коммит 876e0df902
7 изменённых файлов: 12 добавлений и 10 удалений

Просмотреть файл

@ -23,6 +23,7 @@ static int au1xxx_ehci_setup(struct usb_hcd *hcd)
int ret = ehci_init(hcd); int ret = ehci_init(hcd);
ehci->need_io_watchdog = 0; ehci->need_io_watchdog = 0;
ehci_reset(ehci);
return ret; return ret;
} }

Просмотреть файл

@ -677,22 +677,13 @@ static int ehci_init(struct usb_hcd *hcd)
static int ehci_run (struct usb_hcd *hcd) static int ehci_run (struct usb_hcd *hcd)
{ {
struct ehci_hcd *ehci = hcd_to_ehci (hcd); struct ehci_hcd *ehci = hcd_to_ehci (hcd);
int retval;
u32 temp; u32 temp;
u32 hcc_params; u32 hcc_params;
hcd->uses_new_polling = 1; hcd->uses_new_polling = 1;
/* EHCI spec section 4.1 */ /* EHCI spec section 4.1 */
/*
* TDI driver does the ehci_reset in their reset callback.
* Don't reset here, because configuration settings will
* vanish.
*/
if (!ehci_is_TDI(ehci) && (retval = ehci_reset(ehci)) != 0) {
ehci_mem_cleanup(ehci);
return retval;
}
ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list); ehci_writel(ehci, ehci->periodic_dma, &ehci->regs->frame_list);
ehci_writel(ehci, (u32)ehci->async->qh_dma, &ehci->regs->async_next); ehci_writel(ehci, (u32)ehci->async->qh_dma, &ehci->regs->async_next);

Просмотреть файл

@ -155,6 +155,8 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev)
/* cache this readonly data; minimize chip reads */ /* cache this readonly data; minimize chip reads */
ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
ehci_reset(ehci);
ret = usb_add_hcd(hcd, irq, IRQF_SHARED); ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (ret) { if (ret) {
dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret); dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret);

Просмотреть файл

@ -228,6 +228,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
/* cache this readonly data; minimize chip reads */ /* cache this readonly data; minimize chip reads */
omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params); omap_ehci->hcs_params = readl(&omap_ehci->caps->hcs_params);
ehci_reset(omap_ehci);
ret = usb_add_hcd(hcd, irq, IRQF_SHARED); ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (ret) { if (ret) {
dev_err(dev, "failed to add hcd with err %d\n", ret); dev_err(dev, "failed to add hcd with err %d\n", ret);

Просмотреть файл

@ -136,6 +136,8 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev)
/* cache this readonly data; minimize chip reads */ /* cache this readonly data; minimize chip reads */
ehci->hcs_params = readl(&ehci->caps->hcs_params); ehci->hcs_params = readl(&ehci->caps->hcs_params);
ehci_reset(ehci);
err = usb_add_hcd(hcd, irq, IRQF_SHARED); err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to add USB HCD\n"); dev_err(&pdev->dev, "Failed to add USB HCD\n");

Просмотреть файл

@ -132,6 +132,8 @@ static int vt8500_ehci_drv_probe(struct platform_device *pdev)
ehci_port_power(ehci, 1); ehci_port_power(ehci, 1);
ehci_reset(ehci);
ret = usb_add_hcd(hcd, pdev->resource[1].start, ret = usb_add_hcd(hcd, pdev->resource[1].start,
IRQF_SHARED); IRQF_SHARED);
if (ret == 0) { if (ret == 0) {

Просмотреть файл

@ -78,6 +78,8 @@ static int __devinit usb_w90x900_probe(const struct hc_driver *driver,
if (irq < 0) if (irq < 0)
goto err4; goto err4;
ehci_reset(ehci);
retval = usb_add_hcd(hcd, irq, IRQF_SHARED); retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (retval != 0) if (retval != 0)
goto err4; goto err4;