| .. | .. |
|---|
| 653 | 653 | if ((lsr & UART_LSR_OE) && up->overrun_backoff_time_ms > 0) { |
|---|
| 654 | 654 | unsigned long delay; |
|---|
| 655 | 655 | |
|---|
| 656 | + /* Synchronize UART_IER access against the console. */ |
|---|
| 657 | + spin_lock(&port->lock); |
|---|
| 656 | 658 | up->ier = port->serial_in(port, UART_IER); |
|---|
| 657 | 659 | if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { |
|---|
| 658 | 660 | port->ops->stop_rx(port); |
|---|
| .. | .. |
|---|
| 662 | 664 | */ |
|---|
| 663 | 665 | cancel_delayed_work(&up->overrun_backoff); |
|---|
| 664 | 666 | } |
|---|
| 667 | + spin_unlock(&port->lock); |
|---|
| 665 | 668 | |
|---|
| 666 | 669 | delay = msecs_to_jiffies(up->overrun_backoff_time_ms); |
|---|
| 667 | 670 | schedule_delayed_work(&up->overrun_backoff, delay); |
|---|
| .. | .. |
|---|
| 1469 | 1472 | err: |
|---|
| 1470 | 1473 | pm_runtime_dont_use_autosuspend(&pdev->dev); |
|---|
| 1471 | 1474 | pm_runtime_put_sync(&pdev->dev); |
|---|
| 1475 | + flush_work(&priv->qos_work); |
|---|
| 1472 | 1476 | pm_runtime_disable(&pdev->dev); |
|---|
| 1477 | + cpu_latency_qos_remove_request(&priv->pm_qos_request); |
|---|
| 1473 | 1478 | return ret; |
|---|
| 1474 | 1479 | } |
|---|
| 1475 | 1480 | |
|---|
| .. | .. |
|---|
| 1516 | 1521 | { |
|---|
| 1517 | 1522 | struct omap8250_priv *priv = dev_get_drvdata(dev); |
|---|
| 1518 | 1523 | struct uart_8250_port *up = serial8250_get_port(priv->line); |
|---|
| 1524 | + int err; |
|---|
| 1519 | 1525 | |
|---|
| 1520 | 1526 | serial8250_suspend_port(priv->line); |
|---|
| 1521 | 1527 | |
|---|
| 1522 | | - pm_runtime_get_sync(dev); |
|---|
| 1528 | + err = pm_runtime_resume_and_get(dev); |
|---|
| 1529 | + if (err) |
|---|
| 1530 | + return err; |
|---|
| 1523 | 1531 | if (!device_may_wakeup(dev)) |
|---|
| 1524 | 1532 | priv->wer = 0; |
|---|
| 1525 | 1533 | serial_out(up, UART_OMAP_WER, priv->wer); |
|---|
| 1526 | | - pm_runtime_mark_last_busy(dev); |
|---|
| 1527 | | - pm_runtime_put_autosuspend(dev); |
|---|
| 1528 | | - |
|---|
| 1534 | + err = pm_runtime_force_suspend(dev); |
|---|
| 1529 | 1535 | flush_work(&priv->qos_work); |
|---|
| 1530 | | - return 0; |
|---|
| 1536 | + |
|---|
| 1537 | + return err; |
|---|
| 1531 | 1538 | } |
|---|
| 1532 | 1539 | |
|---|
| 1533 | 1540 | static int omap8250_resume(struct device *dev) |
|---|
| 1534 | 1541 | { |
|---|
| 1535 | 1542 | struct omap8250_priv *priv = dev_get_drvdata(dev); |
|---|
| 1543 | + int err; |
|---|
| 1536 | 1544 | |
|---|
| 1545 | + err = pm_runtime_force_resume(dev); |
|---|
| 1546 | + if (err) |
|---|
| 1547 | + return err; |
|---|
| 1537 | 1548 | serial8250_resume_port(priv->line); |
|---|
| 1549 | + /* Paired with pm_runtime_resume_and_get() in omap8250_suspend() */ |
|---|
| 1550 | + pm_runtime_mark_last_busy(dev); |
|---|
| 1551 | + pm_runtime_put_autosuspend(dev); |
|---|
| 1552 | + |
|---|
| 1538 | 1553 | return 0; |
|---|
| 1539 | 1554 | } |
|---|
| 1540 | 1555 | #else |
|---|