Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1058707pxb; Wed, 6 Apr 2022 07:46:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4B02YQXwWdHzcUkvMZ4raPknhIfcOWvBiB8hya6U2IpZqKibqfNN93x5bPZcOqGmodSXq X-Received: by 2002:a17:90a:8e82:b0:1ca:81fb:180d with SMTP id f2-20020a17090a8e8200b001ca81fb180dmr10273949pjo.137.1649256405326; Wed, 06 Apr 2022 07:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649256405; cv=none; d=google.com; s=arc-20160816; b=kubPA0BL5cdW2U/L/NwIGuSpVGDOJScGDGel2BVmEAazqktjd/xmio+HWCukEak/7O NtEJErVPQgRr/YJ0vPKEK/SvtqXQHIWtBH9+0/vuPG53x9+oUywcFlavmcW5GoEvqeV7 EGMZsNEN/s93LeFJki7lJGitLBDtgxH+OfLHSK18P4Z2ycSLEbs9pXBl6RhM3fIYZu0c A/C0gk6t4HqpJsi5zr9bqG1wAmMS6nC1dTkAtQNxCHB8vwnRMAaQm6YTBpl3KlH4gQN0 Hz8q2mI/CdtUuNhNsW+z+PCNUyFuml5QiJCQUMURLpyNQqlQHUCVIVqNG7l/52tFKqXh Ue1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:thread-index :content-language:content-transfer-encoding:mime-version:message-id :date:subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=c54J3bp3plJLsFTEsC6S4PiShdQ+U2ETlWezGJ5k9AU=; b=ue70I7v0H+C9OSqu+xmdwGP4tbtVnufMEG1DZ05AUYXmSHOwc7bj0DylFDYKvEm2u+ WdFGIeshKHuX5EU+7NAncovalHIVoKZh17M31MbjB46n28JkzmbfRSpL56oK6bOBMlDW pKeHpk2sE7hLWM6E8Cl58RBUmVng1e8w7ddSbqrjm6RL+3ImiOLNwU/qCXXwAR2vLJ/+ SiZHNTSziTLbW5f7B/TCfI42+lAeXDLuy97/qvy+ez3d/Ai5P1pKv2DPrBxsiGdbebr6 Gic2BC4pk7y6X0HfMEUy9a0M/i7iJr0VTkF2jMCV3dPzKPp3+KS6bX8n4wJlNRx/GZAC Gt3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="GgTfNlu/"; 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=samsung.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j34-20020a634a62000000b00398ebebcaa8si13825002pgl.261.2022.04.06.07.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:46:45 -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=@samsung.com header.s=mail20170921 header.b="GgTfNlu/"; 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=samsung.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9E3012DCC99; Wed, 6 Apr 2022 05:48:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232124AbiDFMi3 (ORCPT + 99 others); Wed, 6 Apr 2022 08:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232338AbiDFMhm (ORCPT ); Wed, 6 Apr 2022 08:37:42 -0400 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CE6E44099C for ; Wed, 6 Apr 2022 01:39:19 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220406083917epoutp0495958e598f2470045cc0ec855b997c16~jQej7dhA92115321153epoutp04X for ; Wed, 6 Apr 2022 08:39:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220406083917epoutp0495958e598f2470045cc0ec855b997c16~jQej7dhA92115321153epoutp04X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1649234357; bh=c54J3bp3plJLsFTEsC6S4PiShdQ+U2ETlWezGJ5k9AU=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=GgTfNlu/DqsW/v+kbvyZhMvnMFBp5HWny63eXhyVnqMLhKd3js+qYF4bNEfrZ/8iS bEp+IuGhQD6P7HdWvt9cni8OkC7PMITCDWx3HPvQurjl7rFTAYp2vDxTP97PFBjN2O ldpuBFkdyWLlso/B45mIxtzs7n1gzItl8zjVeBzY= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20220406083916epcas2p30ee3bd4de04a7094344cb5b8d505cf97~jQejeaHxI1105711057epcas2p3L; Wed, 6 Apr 2022 08:39:16 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.88]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4KYHxG5LbKz4x9QP; Wed, 6 Apr 2022 08:39:14 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 7D.73.25540.1B15D426; Wed, 6 Apr 2022 17:39:13 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20220406083912epcas2p4aa5946cfaf84e6bac9c56dd25e1dedba~jQefHh_or1577715777epcas2p4a; Wed, 6 Apr 2022 08:39:12 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220406083912epsmtrp26b4cbfbb2728036861c67c2a23586fa8~jQefDrx8S0804408044epsmtrp2T; Wed, 6 Apr 2022 08:39:12 +0000 (GMT) X-AuditID: b6c32a47-831ff700000063c4-3b-624d51b12991 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id AE.2E.03370.0B15D426; Wed, 6 Apr 2022 17:39:12 +0900 (KST) Received: from KORCO006858 (unknown [10.229.18.72]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220406083912epsmtip27e9c3fce16ef8727cfd6495a3dde8d86~jQee38F521809018090epsmtip2r; Wed, 6 Apr 2022 08:39:12 +0000 (GMT) From: "Jaewon Kim" To: "'Greg Kroah-Hartman'" Cc: "'Krzysztof Kozlowski'" , "'Alim Akhtar'" , "'Jiri Slaby'" , , , , , "'Chanho Park'" In-Reply-To: Subject: RE: [PATCH 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Date: Wed, 6 Apr 2022 17:39:11 +0900 Message-ID: <042701d84991$ca50d410$5ef27c30$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: ko Thread-Index: AQKAReulhVQQuLhL7TJZSLDDSdoOSgMPy/dDAfNn9KQCezrJxqtWoyVQ X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHJsWRmVeSWpSXmKPExsWy7bCmme7GQN8kg7l93BYP5m1js7i8X9ui efF6Not3c2Uszp/fwG6x6fE1VovLu+awWcw4v4/J4sziXnYHTo9NqzrZPPbPXcPusXlJvUff llWMHp83yQWwR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AAA== X-CMS-MailID: 20220406083912epcas2p4aa5946cfaf84e6bac9c56dd25e1dedba X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220406081823epcas2p2f7afa27e2402c4fc02c9bee5972bed4f References: <20220406082216.11206-1-jaewon02.kim@samsung.com> <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 Hello On 22. 4. 6. 17:21, Greg Kroah-Hartman wrote: > 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 :) return value of spin_trylock() is 1 or 0. It seems better to keep it as an int than to change it to bool. I will return it to int. Thanks Jaewon Kim