Skip to contentSkip to conversation

Small fixes for rc2

PATCH In review Alan Cox 2 participants 6 messages Apr 14, 2009

Subsystems (6)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

cover Small fixes for rc2

---

Alan Cox (3):
parport: Fix various uses of parport_pc
tty: Fix leak in ti-usb
cdc-acm: Fix long standing abuse of tty->low_latency

Tony Breeds (1):
parport_pc: Fix build failure drivers/parport/parport_pc.c for powerpc

 arch/powerpc/include/asm/parport.h    |    2 +-
 arch/sparc/include/asm/parport.h      |    5 +++--
 drivers/parisc/superio.c              |    3 ++-
 drivers/usb/class/cdc-acm.c           |    4 ----
 drivers/usb/serial/ti_usb_3410_5052.c |   26 ++++++++++++++------------
 5 files changed, 20 insertions(+), 20 deletions(-)

--
"And the nice thing is you don't need to be able to type, because every
possible keystroke does {something} for/to you. Anything from point out off-by-one errors to perform a sex change on your gerbil."
-- Bill Davidsen describing emacs

author
#1 lore raw

PATCH 1/4 cdc-acm: Fix long standing abuse of tty->low_latency

ACM sets the low latency flag but calls the flip buffer routines from IRQ context which isn't permitted (and as of 2.6.29 causes a warning hence this one was caught)

Fortunatelt ACM doesn't need to set this flag in the first place as it only set it to work around problems in ancient (pre tty flip rewrite) kernels.

---

 drivers/usb/class/cdc-acm.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
drivers/usb/class/cdc-acm.c +0 -4
index 869d47c..0a69c09 100644
@@ -546,10 +546,6 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 	tty->driver_data = acm;
 	acm->tty = tty;
 
-	/* force low_latency on so that our tty_push actually forces the data through,
-	   otherwise it is scheduled, and with high data rates data can get lost. */
-	tty->low_latency = 1;
-
 	if (usb_autopm_get_interface(acm->control) < 0)
 		goto early_bail;
 	else
#2 lore raw

Re: [PATCH 1/4] cdc-acm: Fix long standing abuse of tty->low_latency

Am Dienstag 14 April 2009 15:57:36 schrieb Alan Cox:

Quoted 6 lines

ACM sets the low latency flag but calls the flip buffer routines from IRQ context which isn't permitted (and as of 2.6.29 causes a warning hence this one was caught)

Fortunatelt ACM doesn't need to set this flag in the first place as it only set it to work around problems in ancient (pre tty flip rewrite) kernels.

Very well, I am going to kill these in the USB serial drivers.

Regards
Oliver

author
#3 lore raw

PATCH 2/4 tty: Fix leak in ti-usb

In reply to Alan Cox

If the ti-usb adapter returns an zero data length frame (which happens) then we leak a kref. Found by Christoph Mair <[email protected]> who proposed a patch. The patch here is different as Christoph's patch didn't work for the case where tty = NULL and data arrived but Christoph did all the hard work chasing it down.

---

 drivers/usb/serial/ti_usb_3410_5052.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
drivers/usb/serial/ti_usb_3410_5052.c +14 -12
index 2620bf6..9c4c700 100644
@@ -1215,20 +1215,22 @@ static void ti_bulk_in_callback(struct urb *urb)
 	}
 
 	tty = tty_port_tty_get(&port->port);
-	if (tty && urb->actual_length) {
-		usb_serial_debug_data(debug, dev, __func__,
-			urb->actual_length, urb->transfer_buffer);
-
-		if (!tport->tp_is_open)
-			dbg("%s - port closed, dropping data", __func__);
-		else
-			ti_recv(&urb->dev->dev, tty,
+	if (tty) {
+		if (urb->actual_length) {
+			usb_serial_debug_data(debug, dev, __func__,
+				urb->actual_length, urb->transfer_buffer);
+
+			if (!tport->tp_is_open)
+				dbg("%s - port closed, dropping data",
+					__func__);
+			else
+				ti_recv(&urb->dev->dev, tty,
 						urb->transfer_buffer,
 						urb->actual_length);
-
-		spin_lock(&tport->tp_lock);
-		tport->tp_icount.rx += urb->actual_length;
-		spin_unlock(&tport->tp_lock);
+			spin_lock(&tport->tp_lock);
+			tport->tp_icount.rx += urb->actual_length;
+			spin_unlock(&tport->tp_lock);
+		}
 		tty_kref_put(tty);
 	}
 
author
#4 lore raw

PATCH 3/4 parport: Fix various uses of parport_pc

In reply to Alan Cox

These got overlooked first time around.

---

 arch/sparc/include/asm/parport.h |    5 +++--
 drivers/parisc/superio.c         |    3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)
arch/sparc/include/asm/parport.h +3 -2
index dff3f02..ff9ead6 100644
@@ -117,7 +117,7 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
 	if (!strcmp(parent->name, "dma")) {
 		p = parport_pc_probe_port(base, base + 0x400,
 					  op->irqs[0], PARPORT_DMA_NOFIFO,
-					  op->dev.parent->parent);
+					  op->dev.parent->parent, 0);
 		if (!p)
 			return -ENOMEM;
 		dev_set_drvdata(&op->dev, p);
@@ -168,7 +168,8 @@ static int __devinit ecpp_probe(struct of_device *op, const struct of_device_id
 	p = parport_pc_probe_port(base, base + 0x400,
 				  op->irqs[0],
 				  slot,
-				  op->dev.parent);
+				  op->dev.parent,
+				  0);
 	err = -ENOMEM;
 	if (!p)
 		goto out_disable_irq;
drivers/parisc/superio.c +2 -1
index 4fa3bb2..33e5ade 100644
@@ -434,7 +434,8 @@ static void __init superio_parport_init(void)
 			0 /*base_hi*/,
 			PAR_IRQ, 
 			PARPORT_DMA_NONE /* dma */,
-			NULL /*struct pci_dev* */) )
+			NULL /*struct pci_dev* */),
+			0 /* shared irq flags */ )
 
 		printk(KERN_WARNING PFX "Probing parallel port failed.\n");
 #endif	/* CONFIG_PARPORT_PC */
author
#5 lore raw

PATCH 4/4 parport_pc: Fix build failure drivers/parport/parport_pc.c for powerpc

In reply to Alan Cox

From: Tony Breeds <[email protected]>

In commit 51dcdfec6a274afc1c6fce180d582add9ff512c0 (parport: Use the PCI IRQ if offered) parport_pc_probe_port() gained an irqflags arg. This isn't being supplied on powerpc. This patch make powerpc fallback to the old behaviour, that is using "0" for irqflags.

Fixes build failure:
In file included from drivers/parport/parport_pc.c:68:
arch/powerpc/include/asm/parport.h: In function 'parport_pc_find_nonpci_ports':
arch/powerpc/include/asm/parport.h:32: error: too few arguments to function 'parport_pc_probe_port' arch/powerpc/include/asm/parport.h:32: error: too few arguments to function 'parport_pc_probe_port' arch/powerpc/include/asm/parport.h:32: error: too few arguments to function 'parport_pc_probe_port' make[3]: *** [drivers/parport/parport_pc.o] Error 1

---

 arch/powerpc/include/asm/parport.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/parport.h +1 -1
index 414c50e..94942d6 100644
@@ -29,7 +29,7 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
 		prop = of_get_property(np, "interrupts", NULL);
 		if (!prop)
 			continue;
-		if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
+		if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL, 0) != NULL)
 			count++;
 	}
 	return count;