Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1075256pxb; Wed, 6 Apr 2022 08:08:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJPKGDijrXRxR/KRY6NULy3WxUVwbQy8rSgEOaErNayD1+8R96SFDyg8rqvVn7w4q6MQKB X-Received: by 2002:a17:902:da88:b0:156:2b13:81c5 with SMTP id j8-20020a170902da8800b001562b1381c5mr9047563plx.138.1649257724533; Wed, 06 Apr 2022 08:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649257724; cv=none; d=google.com; s=arc-20160816; b=QoDZxCBrd9kWKzlhYNIZ1Suy/e4Y+KVAvuPnSZrNnrJc8qlJl8HvMOiHlbyxnxOW8E OthcPtEEIAyj/hvKlXcddSuCOuXJ1EZw/9JuksC9H9K1mZIVIOuJK6fMWb+g7QNhxcjs mnj4zqH3ClGG2JU0J6GMVeVUMsiLvi7u0hCKoIjjaDPG8b4DrHr/PtdEY2j5ZigIRi2Z yw9mQL5T0OX4APAL0Mla8fKlMCduZUjDQSnW6kWAQlsiLbi73KLrvZAgehbLR7Cpfy6U UuU0jfBvq7F5fkMm+7xIS3LX0mSuK6Xf+gL8AF4Efjl/HmyAPhM+gX6ys8ccR17iKAGX vYKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=PO8bgVYc+6yq/GV1chIgW+khCSDiG15QhmYnAA0FTmY=; b=FFshoLrMiaA2vFjtzwJbjE3qVT7WU95JwvE0li+CXcLy4GdrVO5JSH18BPHfJTDCpu 6lNytiBu2JA42ttj5RvkpiK24QxX5VzKpdEjG4vQKLqqi+UsdmWvBv3AD71+fHyP3Yuc LyQ14ZamHMS9eo6bZMFODwZvjHxpuKQG3O0Xtih9HMwdp4HqJJ6YzIy9uWGDABxHcngf kNVSy7m7pwU7HtMcvzHlxlVOtGMx3yJEUX2JIe/Tb6hsR7eH+BPC274kcEItYV6io/0t OIUKxFnyoA/EZox83LJzGaoc1M75YCpI9fwx2hhFKBwsS6xXuedqC37V2bQK+EZXjy0J SrUA== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z3-20020aa78883000000b004fa3a8e0097si18110596pfe.334.2022.04.06.08.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:08:44 -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; 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=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 22C8457420F; Wed, 6 Apr 2022 06:14:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231775AbiDFNOq (ORCPT + 99 others); Wed, 6 Apr 2022 09:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233719AbiDFNMy (ORCPT ); Wed, 6 Apr 2022 09:12:54 -0400 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1685F90BE; Wed, 6 Apr 2022 02:50:19 -0700 (PDT) Received: by mail-ed1-f54.google.com with SMTP id g20so1932702edw.6; Wed, 06 Apr 2022 02:50:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=PO8bgVYc+6yq/GV1chIgW+khCSDiG15QhmYnAA0FTmY=; b=jJY4a1XyPEMAt4EXBRXTFwKg733D9QCnjp+tvaRH5ix3czCPMdBiaFhGrl6pXlKB/9 pIgnjxa8JfFVfQAwgIa+yBy47KMzwTPmkxQnuQvzyrn+oEZQxnluyC4h/IPHa7c4z2NR rCTvZe15XxY1xU7J16/Cyfwek8+3rskF/9+/Y7ujEb9T748yip38DNllJ7bxo5hEoyaS vDkrYzSsQy274lfuHEItbgQ1lc4RQtexBjLz75X6JcBPnvEMSKR+KAUAHnR7/qEwx0ny e8YLXLYjEoATiKiQJu1bMgT4Jl5h3FA2TZ/bv7Ga4xThOfLL+0tskUwvOT+0sY0JCjeW OhaA== X-Gm-Message-State: AOAM532vz4Dw9LxDqYjIgDKvXTV7NrhizPwW7qr1CpZnTk1DayB8jxj+ XlFzVyBFD+jgT/b/jPUVL70= X-Received: by 2002:a50:ed0b:0:b0:41c:cf60:a882 with SMTP id j11-20020a50ed0b000000b0041ccf60a882mr7956124eds.12.1649238539608; Wed, 06 Apr 2022 02:48:59 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id sb15-20020a1709076d8f00b006dfe4cda58fsm6356961ejc.95.2022.04.06.02.48.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Apr 2022 02:48:59 -0700 (PDT) Message-ID: <98c359ba-9563-3da0-d968-ae40cee9d45f@kernel.org> Date: Wed, 6 Apr 2022 11:48:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Content-Language: en-US To: Jaewon Kim , 'Greg Kroah-Hartman' Cc: 'Krzysztof Kozlowski' , 'Alim Akhtar' , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, 'Chanho Park' References: <20220406082216.11206-1-jaewon02.kim@samsung.com> <20220406082216.11206-2-jaewon02.kim@samsung.com> <042701d84991$ca50d410$5ef27c30$@samsung.com> From: Jiri Slaby In-Reply-To: <042701d84991$ca50d410$5ef27c30$@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 06. 04. 22, 10:39, Jaewon Kim wrote: > 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. Hi, no, do not that. Simply use bool/true/false. thanks, -- js suse labs