Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1037519pxb; Wed, 6 Apr 2022 07:15:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJqGiFoQaEvRJ9fWlut2/dFG4tRHw45gxMia2++9h2mifab/pXp0HwEC25ekDFaTh0cdWA X-Received: by 2002:a17:902:d505:b0:154:76c2:f7bb with SMTP id b5-20020a170902d50500b0015476c2f7bbmr8729159plg.83.1649254539515; Wed, 06 Apr 2022 07:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649254539; cv=none; d=google.com; s=arc-20160816; b=OpIcNhWj6iN7eMsAMJky+kHtY+D0tNPh1CL+COWi2vnRVnNgdWVBKHYiytQjYB3gdi B6GkcLcr145V30vHyf87bLHSxLwQFK9L+3TOlGL0RHrzwHg/DVvBjeJMWXfKw2h5owf7 sr8woeEppGJzUcX+k5Ptt/c4fCGVZvJ09zewB+9atentfxOZuq1iATsEt1dsNtbHP6/o RfZILtiGD9n1qRYNfbf6+BRspTU1zBCOQ2jLBl1n/oE0Cay5E4WOo5kYQV3ezwMtzx39 JLxYCQTgnzywsdEwskq1xrgedWnwZTVHvUzosxhaAEWif4UxW6b/lNKUHaUHIwYxuJEj JGfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cQ50F7QKkbbIzpt7mAkT/e2x5BBpKL6g2v8m2ftonW4=; b=LnzuS9iZTWEWe2yoWkRvbyzJ/llgzq+rmnA6tZyiMd88ZWH7SOulj0+qsKAORMUsfG sTZsvqL7bhw16cuQgs/HzQIHg4fZLhDmUq9JPTqKUqNUNhfC+KSQzNIu3h0NiTbe2qgM Q6FTdP3GAHp024n3B3x9txN2IG/Of2HvoobUIUGT6+3JgYGEkXe2v5QYJUBDgh+oxWZ3 9eAJXAGL5XzffrH1gXUhU7XPy25Px6hcOH+VYIdbT7f2eCfhXUOH5YtNdJZUVQyWiulh WqtUsX6n25+WtGmq/VpojO9aMhQJo48VgdpBltjL2WJZFTcA8jJPfyYjQ5eULRL2ssje C4ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dmHURPUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y21-20020a056a00191500b004fa3a8dffc8si16964996pfi.127.2022.04.06.07.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:15:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dmHURPUr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DAE7B469EC9; Wed, 6 Apr 2022 05:02:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233217AbiDFLdy (ORCPT + 99 others); Wed, 6 Apr 2022 07:33:54 -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> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 :)