From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76F75C433F5 for ; Wed, 6 Apr 2022 08:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1khi22vnkpxOdOz0MLpL1uP5V7sU/H3Xeyos3zPCjm8=; b=fYUVO9Exf8P3M/ sWlJCDWDe0aSKraFNExfIRW0GGGfKvIauJKCm+rjxvppaMOBRV28B5ocMtqfbmPujmQaImTCUXr8j iqhw8tTliZMUosjK6Ha/RozeElQ2t2BcKvu8OTw6wHrDFI3OMfLN5Q7Q/9xeZjkS6KVZsUgbUgZgG LMnt1nHuZa1hWH9H84uwYeskecch2W8CYqvQfHJoWcRyysHaL/mH1DZY0eujh+0OxlAbWmNyDgxYc FBJDVhaE4cSy8td1mrAPoQiKrDfR4YWIR1146iSbfxrqmhqEu41DqZfFdILOjHWfuNKeTePl/dB4s Nj6oB5cRCBhE5eiky7dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc0vy-004ffO-Mw; Wed, 06 Apr 2022 08:22:35 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nc0vH-004fN5-RY for linux-arm-kernel@lists.infradead.org; Wed, 06 Apr 2022 08:21:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 32D1FB82176; Wed, 6 Apr 2022 08:21:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E835C385A1; Wed, 6 Apr 2022 08:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649233308; bh=m02B52PlbTGkHsglDWYkbPf87t6nOSAI6SsL2u6s9WU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dmHURPUrahNYrn7D2K0tE4AfQoQwL9KCcwOVFz4YF8tjyg7IESCEUUr0Xt/EbQcxA aE98Em+gCM0thhr269/aiLBr8phAStBLl9zuDH1mD1TDm5MeHozKdsrEtWq+Mu9hzY qh6zzKhJscn44zJUQmNlYDuqfCwIEoHorKnVKwqg= Date: Wed, 6 Apr 2022 10:21:45 +0200 From: Greg Kroah-Hartman To: Jaewon Kim Cc: Krzysztof Kozlowski , Alim Akhtar , Jiri Slaby , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Chanho Park Subject: Re: [PATCH 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Message-ID: References: <20220406082216.11206-1-jaewon02.kim@samsung.com> <20220406082216.11206-2-jaewon02.kim@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220406082216.11206-2-jaewon02.kim@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220406_012152_064317_2E11A180 X-CRM114-Status: GOOD ( 16.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 06, 2022 at 05:22:16PM +0900, Jaewon Kim wrote: > The console_write and IRQ handler can run concurrently. > Problems may occurs console_write is continuously executed while > the IRQ handler is running. > > Signed-off-by: Jaewon Kim > --- > drivers/tty/serial/samsung_tty.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index e1585fbae909..9db479d728b5 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -2480,12 +2480,24 @@ s3c24xx_serial_console_write(struct console *co, const char *s, > unsigned int count) > { > unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); > + unsigned long flags; > + bool locked = 1; "1" is not a boolean :) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40697C433F5 for ; Wed, 6 Apr 2022 11:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236968AbiDFLdz (ORCPT ); Wed, 6 Apr 2022 07:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236750AbiDFLcu (ORCPT ); Wed, 6 Apr 2022 07:32:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB2B1BB820; Wed, 6 Apr 2022 01:21:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 16FCDB81FB7; Wed, 6 Apr 2022 08:21:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E835C385A1; Wed, 6 Apr 2022 08:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649233308; bh=m02B52PlbTGkHsglDWYkbPf87t6nOSAI6SsL2u6s9WU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dmHURPUrahNYrn7D2K0tE4AfQoQwL9KCcwOVFz4YF8tjyg7IESCEUUr0Xt/EbQcxA aE98Em+gCM0thhr269/aiLBr8phAStBLl9zuDH1mD1TDm5MeHozKdsrEtWq+Mu9hzY qh6zzKhJscn44zJUQmNlYDuqfCwIEoHorKnVKwqg= Date: Wed, 6 Apr 2022 10:21:45 +0200 From: Greg Kroah-Hartman To: Jaewon Kim Cc: Krzysztof Kozlowski , Alim Akhtar , Jiri Slaby , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Chanho Park Subject: Re: [PATCH 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Message-ID: References: <20220406082216.11206-1-jaewon02.kim@samsung.com> <20220406082216.11206-2-jaewon02.kim@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220406082216.11206-2-jaewon02.kim@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 06, 2022 at 05:22:16PM +0900, Jaewon Kim wrote: > The console_write and IRQ handler can run concurrently. > Problems may occurs console_write is continuously executed while > the IRQ handler is running. > > Signed-off-by: Jaewon Kim > --- > drivers/tty/serial/samsung_tty.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index e1585fbae909..9db479d728b5 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -2480,12 +2480,24 @@ s3c24xx_serial_console_write(struct console *co, const char *s, > unsigned int count) > { > unsigned int ucon = rd_regl(cons_uart, S3C2410_UCON); > + unsigned long flags; > + bool locked = 1; "1" is not a boolean :)