Received: from mail.onstor.com ([66.201.51.107]) by onstor-exch02.onstor.net with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 15 Oct 2008 14:35:27 -0700
Received: from chiesmta2-2.messageone.com ([216.203.30.55]) by mail.onstor.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 15 Oct 2008 14:35:27 -0700
Received: from ftp.linux-mips.org (ftp.linux-mips.org [213.58.128.207])
	by chiesmta2-2.messageone.com (8.13.8/8.13.8) with ESMTP id m9FLZOU3005751
	for <andy.sharp@onstor.com>; Wed, 15 Oct 2008 16:35:26 -0500
Received: from localhost.localdomain ([127.0.0.1]:57740 "EHLO
	ftp.linux-mips.org") by ftp.linux-mips.org with ESMTP
	id S21578440AbYJOVez (ORCPT <rfc822;andy.sharp@onstor.com>);
	Wed, 15 Oct 2008 22:34:55 +0100
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 15 Oct 2008 22:34:38 +0100 (BST)
Received: from mail3.caviumnetworks.com ([12.108.191.235]:36692 "EHLO
	mail3.caviumnetworks.com") by ftp.linux-mips.org with ESMTP
	id S21581036AbYJOSfN (ORCPT <rfc822;linux-mips@linux-mips.org>);
	Wed, 15 Oct 2008 19:35:13 +0100
Received: from exch4.caveonetworks.com (Not Verified[192.168.16.23]) by mail3.caviumnetworks.com with MailMarshal (v6,2,2,3503)
	id <B48f61f880000>; Wed, 15 Oct 2008 12:51:20 -0400
Received: from exch4.caveonetworks.com ([192.168.16.23]) by exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 15 Oct 2008 09:51:19 -0700
Received: from dd1.caveonetworks.com ([64.169.86.201]) by exch4.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 15 Oct 2008 09:51:19 -0700
Message-ID: <48F61F86.5020108@caviumnetworks.com>
Date: 	Wed, 15 Oct 2008 09:51:18 -0700
From: David Daney <ddaney@caviumnetworks.com>
User-Agent: Thunderbird 2.0.0.16 (X11/20080723)
MIME-Version: 1.0
To: linux-serial@vger.kernel.org
CC: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
        "Paoletti, Tomaso" <Tomaso.Paoletti@caviumnetworks.com>
Subject: [PATCH] 8250: Don't clobber spinlocks in 8250.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 15 Oct 2008 16:51:19.0047 (UTC) FILETIME=[3EF68970:01C92EE6]
X-archive-position: 20769
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: ddaney@caviumnetworks.com
Precedence: bulk
X-list: 	linux-mips
X-MessageOne-Virus-Version: vendor=fsecure engine=4.65.7161:2.4.4,1.2.40,4.0.164 definitions=2008-10-15_09:2008-10-10,2008-10-15,2008-10-15 signatures=0
X-MessageOne-Virus-Scanned: Clean
X-MessageOne-Envelope-Sender: linux-mips-bounce@linux-mips.org
X-MessageOne-Spam-Details: rule=m773emszm_notspam policy=m773emszm score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=3.1.0-0805090000 definitions=main-0810150142
X-MessageOne-Spam-Score: 0
X-MessageOne-Spam-Bar: 
Return-Path: linux-mips-bounce@linux-mips.org

Don't clobber spinlocks in 8250.

In serial8250_isa_init_ports(), the port's lock is initialized.  We
should not overwrite it.  Only copy in the fields we need.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
---
 drivers/serial/8250.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index d3ca7d3..da65fea 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2699,12 +2699,24 @@ static struct uart_driver serial8250_reg = {
  */
 int __init early_serial_setup(struct uart_port *port)
 {
+	struct uart_port *p;
+
 	if (port->line >= ARRAY_SIZE(serial8250_ports))
 		return -ENODEV;
 
 	serial8250_isa_init_ports();
-	serial8250_ports[port->line].port	= *port;
-	serial8250_ports[port->line].port.ops	= &serial8250_pops;
+	p = &serial8250_ports[port->line].port;
+	p->iobase       = port->iobase;
+	p->membase      = port->membase;
+	p->irq          = port->irq;
+	p->uartclk      = port->uartclk;
+	p->fifosize     = port->fifosize;
+	p->regshift     = port->regshift;
+	p->iotype       = port->iotype;
+	p->flags        = port->flags;
+	p->mapbase      = port->mapbase;
+	p->private_data = port->private_data;
+	p->ops		= &serial8250_pops;
 	return 0;
 }
 

