linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pch_uart: Add MSI support
@ 2011-06-22  9:50 Alexander Stein
  2011-06-23  0:14 ` Tomoya MORINAGA
  2011-06-23  0:34 ` [PATCH] pch_uart: Add MSI support Roland Dreier
  0 siblings, 2 replies; 13+ messages in thread
From: Alexander Stein @ 2011-06-22  9:50 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-serial, linux-kernel, Tomoya MORINAGA, Alexander Stein

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
 drivers/tty/serial/pch_uart.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 4652109..9db9773 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -234,6 +234,7 @@ struct eg20t_port {
 	int				tx_dma_use;
 	void				*rx_buf_virt;
 	dma_addr_t			rx_buf_dma;
+	int				use_msi;
 };
 
 /**
@@ -1429,6 +1430,12 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 		goto init_port_hal_free;
 	}
 
+	ret = pci_enable_msi(pdev);
+	if (ret)
+		priv->use_msi = 0;
+	else
+		priv->use_msi = 1;
+
 	iobase = pci_resource_start(pdev, 0);
 	mapbase = pci_resource_start(pdev, 1);
 	priv->mapbase = mapbase;
@@ -1485,6 +1492,9 @@ static void pch_uart_pci_remove(struct pci_dev *pdev)
 	struct eg20t_port *priv;
 
 	priv = (struct eg20t_port *)pci_get_drvdata(pdev);
+
+	if (priv->use_msi)
+		pci_disable_msi(pdev);
 	pch_uart_exit_port(priv);
 	pci_disable_device(pdev);
 	kfree(priv);
@@ -1568,6 +1578,8 @@ static int __devinit pch_uart_pci_probe(struct pci_dev *pdev,
 	return ret;
 
 probe_disable_device:
+	if (priv->use_msi)
+		pci_disable_msi(pdev);
 	pci_disable_device(pdev);
 probe_error:
 	return ret;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-07-22 12:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-22  9:50 [PATCH] pch_uart: Add MSI support Alexander Stein
2011-06-23  0:14 ` Tomoya MORINAGA
2011-06-23  7:00   ` [PATCH v2] " Alexander Stein
2011-06-23  7:16     ` Clemens Ladisch
2011-06-23  7:37       ` Alexander Stein
2011-07-01 22:32     ` Greg KH
2011-07-04  6:58       ` [PATCH v3] " Alexander Stein
2011-07-22 12:39         ` Tomoya MORINAGA
2011-07-19  4:15   ` serial/pch_uart: AT command behavior Tomoya MORINAGA
2011-07-19  9:06     ` Alan Cox
2011-07-20  0:14       ` Tomoya MORINAGA
2011-07-20 12:49         ` Alan Cox
2011-06-23  0:34 ` [PATCH] pch_uart: Add MSI support Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).