aboutsummaryrefslogtreecommitdiffstats
path: root/tty
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2009-10-26 16:56:47 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-10-26 16:56:47 -0700
commitd93ada0e086cc8b5de957b5dfaeb1247489f1717 (patch)
tree8cf9190742b3f65908582f829ec69e94be4fb77c /tty
parent8900d1017b45890db769237176dec16a05e2fc8b (diff)
downloadpatches-d93ada0e086cc8b5de957b5dfaeb1247489f1717.tar.gz
lots more staging and other patches
Diffstat (limited to 'tty')
-rw-r--r--tty/jsm-adding-eeh-handlers.patch103
-rw-r--r--tty/tty-istallion-kill-off-the-bkl-ioctl.patch56
-rw-r--r--tty/tty-stallion-kill-bkl-ioctl.patch67
3 files changed, 226 insertions, 0 deletions
diff --git a/tty/jsm-adding-eeh-handlers.patch b/tty/jsm-adding-eeh-handlers.patch
new file mode 100644
index 00000000000000..00040304ee04ee
--- /dev/null
+++ b/tty/jsm-adding-eeh-handlers.patch
@@ -0,0 +1,103 @@
+From leitao@linux.vnet.ibm.com Mon Oct 26 16:32:16 2009
+From: Breno Leitao <leitao@linux.vnet.ibm.com>
+Date: Wed, 14 Oct 2009 14:57:51 -0300
+Subject: jsm: adding EEH handlers
+To: Greg KH <greg@kroah.com>
+Message-ID: <4AD6111F.1070207@linux.vnet.ibm.com>
+
+
+Adding EEH handlers for the serial jsm driver. This patch adds
+the PCI error handlers and also register them to be called when
+a error is detected.
+
+Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
+Acked-by: Scott Kilau <scottk@digi.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/serial/jsm/jsm_driver.c | 46 ++++++++++++++++++++++++++++++++++++++++
+ drivers/serial/jsm/jsm_tty.c | 2 -
+ 2 files changed, 47 insertions(+), 1 deletion(-)
+
+--- a/drivers/serial/jsm/jsm_driver.c
++++ b/drivers/serial/jsm/jsm_driver.c
+@@ -48,6 +48,17 @@ struct uart_driver jsm_uart_driver = {
+ .nr = NR_PORTS,
+ };
+
++static pci_ers_result_t jsm_io_error_detected(struct pci_dev *pdev,
++ pci_channel_state_t state);
++static pci_ers_result_t jsm_io_slot_reset(struct pci_dev *pdev);
++static void jsm_io_resume(struct pci_dev *pdev);
++
++static struct pci_error_handlers jsm_err_handler = {
++ .error_detected = jsm_io_error_detected,
++ .slot_reset = jsm_io_slot_reset,
++ .resume = jsm_io_resume,
++};
++
+ int jsm_debug;
+ module_param(jsm_debug, int, 0);
+ MODULE_PARM_DESC(jsm_debug, "Driver debugging level");
+@@ -164,6 +175,7 @@ static int __devinit jsm_probe_one(struc
+ }
+
+ pci_set_drvdata(pdev, brd);
++ pci_save_state(pdev);
+
+ return 0;
+ out_free_irq:
+@@ -222,8 +234,42 @@ static struct pci_driver jsm_driver = {
+ .id_table = jsm_pci_tbl,
+ .probe = jsm_probe_one,
+ .remove = __devexit_p(jsm_remove_one),
++ .err_handler = &jsm_err_handler,
+ };
+
++static pci_ers_result_t jsm_io_error_detected(struct pci_dev *pdev,
++ pci_channel_state_t state)
++{
++ struct jsm_board *brd = pci_get_drvdata(pdev);
++
++ jsm_remove_uart_port(brd);
++
++ return PCI_ERS_RESULT_NEED_RESET;
++}
++
++static pci_ers_result_t jsm_io_slot_reset(struct pci_dev *pdev)
++{
++ int rc;
++
++ rc = pci_enable_device(pdev);
++
++ if (rc)
++ return PCI_ERS_RESULT_DISCONNECT;
++
++ pci_set_master(pdev);
++
++ return PCI_ERS_RESULT_RECOVERED;
++}
++
++static void jsm_io_resume(struct pci_dev *pdev)
++{
++ struct jsm_board *brd = pci_get_drvdata(pdev);
++
++ pci_restore_state(pdev);
++
++ jsm_uart_port_init(brd);
++}
++
+ static int __init jsm_init_module(void)
+ {
+ int rc;
+--- a/drivers/serial/jsm/jsm_tty.c
++++ b/drivers/serial/jsm/jsm_tty.c
+@@ -430,7 +430,7 @@ int __devinit jsm_tty_init(struct jsm_bo
+ return 0;
+ }
+
+-int __devinit jsm_uart_port_init(struct jsm_board *brd)
++int jsm_uart_port_init(struct jsm_board *brd)
+ {
+ int i;
+ unsigned int line;
diff --git a/tty/tty-istallion-kill-off-the-bkl-ioctl.patch b/tty/tty-istallion-kill-off-the-bkl-ioctl.patch
new file mode 100644
index 00000000000000..02684b31da8c13
--- /dev/null
+++ b/tty/tty-istallion-kill-off-the-bkl-ioctl.patch
@@ -0,0 +1,56 @@
+From alan@linux.intel.com Mon Oct 26 16:28:24 2009
+From: Alan Cox <alan@linux.intel.com>
+Date: Tue, 13 Oct 2009 16:34:06 +0100
+Subject: tty: istallion: Kill off the BKL ioctl
+To: greg@kroah.com
+Message-ID: <20091013153404.23616.23577.stgit@localhost.localdomain>
+
+
+Fairly trivial as the BKL push down into the methods has already been done.
+
+Signed-off-by: Alan Cox <alan@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/char/istallion.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/char/istallion.c
++++ b/drivers/char/istallion.c
+@@ -621,7 +621,7 @@ static int stli_brdinit(struct stlibrd *
+ static int stli_startbrd(struct stlibrd *brdp);
+ static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp);
+ static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp);
+-static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg);
++static long stli_memioctl(struct file *fp, unsigned int cmd, unsigned long arg);
+ static void stli_brdpoll(struct stlibrd *brdp, cdkhdr_t __iomem *hdrp);
+ static void stli_poll(unsigned long arg);
+ static int stli_hostcmd(struct stlibrd *brdp, struct stliport *portp);
+@@ -704,7 +704,7 @@ static const struct file_operations stli
+ .owner = THIS_MODULE,
+ .read = stli_memread,
+ .write = stli_memwrite,
+- .ioctl = stli_memioctl,
++ .unlocked_ioctl = stli_memioctl,
+ };
+
+ /*****************************************************************************/
+@@ -4311,7 +4311,7 @@ static int stli_getbrdstruct(struct stli
+ * reset it, and start/stop it.
+ */
+
+-static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg)
++static long stli_memioctl(struct file *fp, unsigned int cmd, unsigned long arg)
+ {
+ struct stlibrd *brdp;
+ int brdnr, rc, done;
+@@ -4356,7 +4356,7 @@ static int stli_memioctl(struct inode *i
+ * Now handle the board specific ioctls. These all depend on the
+ * minor number of the device they were called from.
+ */
+- brdnr = iminor(ip);
++ brdnr = iminor(fp->f_dentry->d_inode);
+ if (brdnr >= STL_MAXBRDS)
+ return -ENODEV;
+ brdp = stli_brds[brdnr];
diff --git a/tty/tty-stallion-kill-bkl-ioctl.patch b/tty/tty-stallion-kill-bkl-ioctl.patch
new file mode 100644
index 00000000000000..8142dba4ec01f1
--- /dev/null
+++ b/tty/tty-stallion-kill-bkl-ioctl.patch
@@ -0,0 +1,67 @@
+From alan@linux.intel.com Mon Oct 26 16:28:37 2009
+From: Alan Cox <alan@linux.intel.com>
+Date: Tue, 13 Oct 2009 16:34:15 +0100
+Subject: tty: stallion: kill BKL ioctl
+To: greg@kroah.com
+Message-ID: <20091013153412.23616.92702.stgit@localhost.localdomain>
+
+
+Signed-off-by: Alan Cox <alan@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/char/stallion.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/char/stallion.c
++++ b/drivers/char/stallion.c
+@@ -407,7 +407,7 @@ static unsigned int stl_baudrates[] = {
+ * Declare all those functions in this driver!
+ */
+
+-static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg);
++static long stl_memioctl(struct file *fp, unsigned int cmd, unsigned long arg);
+ static int stl_brdinit(struct stlbrd *brdp);
+ static int stl_getportstats(struct tty_struct *tty, struct stlport *portp, comstats_t __user *cp);
+ static int stl_clrportstats(struct stlport *portp, comstats_t __user *cp);
+@@ -607,7 +607,7 @@ static unsigned int sc26198_baudtable[]
+ */
+ static const struct file_operations stl_fsiomem = {
+ .owner = THIS_MODULE,
+- .ioctl = stl_memioctl,
++ .unlocked_ioctl = stl_memioctl,
+ };
+
+ static struct class *stallion_class;
+@@ -2486,18 +2486,19 @@ static int stl_getbrdstruct(struct stlbr
+ * collection.
+ */
+
+-static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg)
++static long stl_memioctl(struct file *fp, unsigned int cmd, unsigned long arg)
+ {
+ int brdnr, rc;
+ void __user *argp = (void __user *)arg;
+
+- pr_debug("stl_memioctl(ip=%p,fp=%p,cmd=%x,arg=%lx)\n", ip, fp, cmd,arg);
++ pr_debug("stl_memioctl(fp=%p,cmd=%x,arg=%lx)\n", fp, cmd,arg);
+
+- brdnr = iminor(ip);
++ brdnr = iminor(fp->f_dentry->d_inode);
+ if (brdnr >= STL_MAXBRDS)
+ return -ENODEV;
+ rc = 0;
+
++ lock_kernel();
+ switch (cmd) {
+ case COM_GETPORTSTATS:
+ rc = stl_getportstats(NULL, NULL, argp);
+@@ -2518,7 +2519,7 @@ static int stl_memioctl(struct inode *ip
+ rc = -ENOIOCTLCMD;
+ break;
+ }
+-
++ unlock_kernel();
+ return rc;
+ }
+