From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753797Ab1A0IzY (ORCPT ); Thu, 27 Jan 2011 03:55:24 -0500 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:60133 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338Ab1A0IzX (ORCPT ); Thu, 27 Jan 2011 03:55:23 -0500 Date: Thu, 27 Jan 2011 08:54:38 +0000 From: Russell King - ARM Linux To: Saravana Kannan Cc: Colin Cross , Lorenzo Pieralisi , Vincent Guittot , linux-sh , Ben Herrenschmidt , Sascha Hauer , linux-kernel , Ben Dooks , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Jeremy Kerr , linux-arm-kernel , Richard Zhao Subject: Re: Locking in the clk API Message-ID: <20110127085438.GA25239@n2100.arm.linux.org.uk> References: <201101111016.42819.jeremy.kerr@canonical.com> <20110111091607.GI12552@n2100.arm.linux.org.uk> <201101111744.59712.jeremy.kerr@canonical.com> <20110111103929.GN24920@pengutronix.de> <4D386ABF.9060908@fluff.org> <20110120190822.GK6335@n2100.arm.linux.org.uk> <4D3932B4.8010904@codeaurora.org> <20110121094042.GD13235@n2100.arm.linux.org.uk> <4D40F5CC.6080809@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D40F5CC.6080809@codeaurora.org> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2011 at 08:34:20PM -0800, Saravana Kannan wrote: > I'm not too familiar with serial/tty, does anyone know if the > .set_termios needs to be atmoic? If not, we could just change > cpm_uart/cpm_uart_core.c to use mutex instead of spinlock. The locking is there to protect against the interrupt handler accessing the port->* stuff (which seems to have been forgotten by the cpm driver). I don't see any reason why clk_set_rate() needs to be under the spinlock there - we need the reprogramming of the baud rate within the spinlock on 8250 because of DLAB bit hiding the data registers. It's also a good idea that it _is_ within the spinlock along with uart_update_timeout() to ensure timeouts and the baud rate are updated together.