TTY/serial driver fixes for .39
Subsystems (3)
PATCH 1/1 TTY/serial driver fixes for .39
Here are some small tty/serial fixes for the .39 tree.
It also includes a parport patch, as it seems relevant to the serial drivers (resource conflict) and there's not a parport maintainer tree anywhere that I know of.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/tty-2.6.git/ tty-linus
All of these patches have been in the -mm and -next trees for a while.
Patches will be sent to the linux-serial mailing list, if anyone wants to see them.
thanks,
greg k-h
------------
drivers/parport/parport_pc.c | 8 +++----- drivers/tty/n_gsm.c | 8 ++++++-- drivers/tty/serial/imx.c | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-)
---------------
Mikhail Kshevetskiy (1):
tty/n_gsm: fix bug in CRC calculation for gsm1 mode
Niels de Vos (1):
parport_pc.c: correctly release the requested region for the IT887x
Uwe Kleine-König (1):
serial/imx: read cts state only after acking cts change irq
PATCH 1/3 parport_pc.c: correctly release the requested region for the IT887x
From: Niels de Vos <[email protected]>
Replace release_resource() by release_region() and also fix the inconsistency in the size of the requested/released region.
The size of the resource should be 32, not 0x8 like it was corrected in commit e7c310c36e5fdf1b83a459e5db167bfbd86137db already.
--- drivers/parport/parport_pc.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/parport/parport_pc.c +3 -5
@@ -2550,7 +2550,6 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, const struct parport_pc_via_data *via) {short inta_addr[6 ] = {0x2A0 ,0x2C0 ,0x220 ,0x240 ,0x1E0 }; -struct resource *base_res;u32 ite8872set;u32 ite8872_lpt, ite8872_lpthi;u8 ite8872_irq, type;
@@ -2561,8 +2560,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,/* make sure which one chip */ for (i =0 ; i <5 ; i++) { - base_res =request_region (inta_addr[i],32 ,"it887x" ); -if (base_res) { +if (request_region (inta_addr[i],32 ,"it887x" )) {int test;pci_write_config_dword (pdev,0x60 ,0xe5000000 | inta_addr[i]);
@@ -2571,7 +2569,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, test =inb (inta_addr[i]);if (test !=0xff )break ; -release_region (inta_addr[i],0x8 ); +release_region (inta_addr[i],32 ); } }if (i >=5 ) {
@@ -2635,7 +2633,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,/* * Release the resource so that parport_pc_probe_port can get it. */ -release_resource (base_res); +release_region (inta_addr[i],32 );if (parport_pc_probe_port (ite8872_lpt, ite8872_lpthi, irq,PARPORT_DMA_NONE , &pdev->dev,0 )) { printk(KERN_INFO
Signature · 1 line
1.7.4.2
PATCH 2/3 serial/imx: read cts state only after acking cts change irq
From: Uwe Kleine-König <[email protected]>
If cts changes between reading the level at the cts input (USR1_RTSS) and acking the irq (USR1_RTSD) the last edge doesn't generate an irq and uart_handle_cts_change is called with a outdated value for cts.
The race was introduced by commit
ceca629 ([ARM] 2971/1: i.MX uart handle rts irq)
--- drivers/tty/serial/imx.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/tty/serial/imx.c +2 -1
@@ -382,12 +382,13 @@ static void imx_start_tx(struct uart_port *port)static irqreturn_t imx_rtsint (int irq,void *dev_id) {struct imx_port *sport = dev_id; -unsigned int val =readl (sport->port.membase +USR1 ) &USR1_RTSS ; +unsigned int val;unsigned long flags;spin_lock_irqsave (&sport->port.lock, flags);writel (USR1_RTSD , sport->port.membase +USR1 ); + val =readl (sport->port.membase +USR1 ) &USR1_RTSS ;uart_handle_cts_change (&sport->port, !!val);wake_up_interruptible (&sport->port.state->port.delta_msr_wait);
Signature · 6 lines
1.7.4.2 _______________________________________________ stable mailing list [email protected] http://linux.kernel.org/mailman/listinfo/stable
PATCH 3/3 tty/n_gsm: fix bug in CRC calculation for gsm1 mode
In reply to Greg Kroah-HartmanFrom: Mikhail Kshevetskiy <[email protected]>
Problem description:
gsm_queue() calculate a CRC for arrived frames. As a last step of CRC calculation it call
gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs);
This work perfectly for the case of GSM0 mode as gsm->received_fcs contain the last piece of data required to generate final CRC.
gsm->received_fcs is not used for GSM1 mode. Thus we put an additional byte to CRC calculation. As result we get a wrong CRC and reject incoming frame.
--- drivers/tty/n_gsm.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/tty/n_gsm.c +6 -2
@@ -1658,8 +1658,12 @@ static void gsm_queue(struct gsm_mux *gsm)if ((gsm->control & ~PF ) ==UI ) gsm->fcs =gsm_fcs_add_block (gsm->fcs, gsm->buf, gsm->len); -/* generate final CRC with received FCS */ - gsm->fcs =gsm_fcs_add (gsm->fcs, gsm->received_fcs); +if (gsm->encoding ==0 ){ +/* WARNING: gsm->received_fcs is used for gsm->encoding = 0 only. +In this case it contain the last piece of data +required to generate final CRC */ + gsm->fcs =gsm_fcs_add (gsm->fcs, gsm->received_fcs); + }if (gsm->fcs !=GOOD_FCS ) { gsm->bad_fcs++;if (debug &4 )
Signature · 1 line
1.7.4.2