* [PATCH 1/4] cdc-acm: Fix long standing abuse of tty->low_latency
2009-04-14 13:57 [PATCH 0/4] Small fixes for rc2 Alan Cox
@ 2009-04-14 13:57 ` Alan Cox
2009-04-14 14:18 ` Oliver Neukum
2009-04-14 13:58 ` [PATCH 2/4] tty: Fix leak in ti-usb Alan Cox
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2009-04-14 13:57 UTC (permalink / raw)
To: torvalds, linux-kernel
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.
Reported-by: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
drivers/usb/class/cdc-acm.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 869d47c..0a69c09 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -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
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/4] cdc-acm: Fix long standing abuse of tty->low_latency
2009-04-14 13:57 ` [PATCH 1/4] cdc-acm: Fix long standing abuse of tty->low_latency Alan Cox
@ 2009-04-14 14:18 ` Oliver Neukum
0 siblings, 0 replies; 6+ messages in thread
From: Oliver Neukum @ 2009-04-14 14:18 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-usb, linux-kernel
Am Dienstag 14 April 2009 15:57:36 schrieb Alan Cox:
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] tty: Fix leak in ti-usb
2009-04-14 13:57 [PATCH 0/4] Small fixes for rc2 Alan Cox
2009-04-14 13:57 ` [PATCH 1/4] cdc-acm: Fix long standing abuse of tty->low_latency Alan Cox
@ 2009-04-14 13:58 ` Alan Cox
2009-04-14 13:58 ` [PATCH 3/4] parport: Fix various uses of parport_pc Alan Cox
2009-04-14 13:58 ` [PATCH 4/4] parport_pc: Fix build failure drivers/parport/parport_pc.c for powerpc Alan Cox
3 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2009-04-14 13:58 UTC (permalink / raw)
To: torvalds, linux-kernel
If the ti-usb adapter returns an zero data length frame (which happens) then
we leak a kref. Found by Christoph Mair <christoph.mair@gmail.com> 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.
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/usb/serial/ti_usb_3410_5052.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 2620bf6..9c4c700 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -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);
}
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 3/4] parport: Fix various uses of parport_pc
2009-04-14 13:57 [PATCH 0/4] Small fixes for rc2 Alan Cox
2009-04-14 13:57 ` [PATCH 1/4] cdc-acm: Fix long standing abuse of tty->low_latency Alan Cox
2009-04-14 13:58 ` [PATCH 2/4] tty: Fix leak in ti-usb Alan Cox
@ 2009-04-14 13:58 ` Alan Cox
2009-04-14 13:58 ` [PATCH 4/4] parport_pc: Fix build failure drivers/parport/parport_pc.c for powerpc Alan Cox
3 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2009-04-14 13:58 UTC (permalink / raw)
To: torvalds, linux-kernel
These got overlooked first time around.
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
arch/sparc/include/asm/parport.h | 5 +++--
drivers/parisc/superio.c | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h
index dff3f02..ff9ead6 100644
--- a/arch/sparc/include/asm/parport.h
+++ b/arch/sparc/include/asm/parport.h
@@ -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;
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 4fa3bb2..33e5ade 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -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 */
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 4/4] parport_pc: Fix build failure drivers/parport/parport_pc.c for powerpc
2009-04-14 13:57 [PATCH 0/4] Small fixes for rc2 Alan Cox
` (2 preceding siblings ...)
2009-04-14 13:58 ` [PATCH 3/4] parport: Fix various uses of parport_pc Alan Cox
@ 2009-04-14 13:58 ` Alan Cox
3 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2009-04-14 13:58 UTC (permalink / raw)
To: torvalds, linux-kernel
From: Tony Breeds <tony@bakeyournoodle.com>
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
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
arch/powerpc/include/asm/parport.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/parport.h b/arch/powerpc/include/asm/parport.h
index 414c50e..94942d6 100644
--- a/arch/powerpc/include/asm/parport.h
+++ b/arch/powerpc/include/asm/parport.h
@@ -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;
^ permalink raw reply [flat|nested] 6+ messages in thread