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 5062DC433EF for ; Thu, 7 Apr 2022 07:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242285AbiDGHs7 (ORCPT ); Thu, 7 Apr 2022 03:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241974AbiDGHsv (ORCPT ); Thu, 7 Apr 2022 03:48:51 -0400 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F903E5E20; Thu, 7 Apr 2022 00:46:50 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id a6so9168997ejk.0; Thu, 07 Apr 2022 00:46:50 -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=n9ByRjCgN7UyNGlvzfT7jWJ7BAn1HisGnqSo99JqgB8=; b=XJs4dPrHM6T6XT+3sAWKgHKTdRlIHtB1qbtbBQbeCeYm2lgKMG1ROFoYXmGcw/WejB Ysl+qdc70+4y+QbaesP5knS1DOhJrJOlt+V6wlPCPaWZ6UruMvUZX/ybUkGu7MbAH9gO RUJHkCyULKRhhC02oe4s+yqFZY6OosBNEKVyNcm4q3DAxdPde5wCrPz9X6MU8LeHqMaM UVzLa5pFwnQEggEFLBwmWUBPDncgKGIi3hUF/o/yXc7b5ezYPBjmN379uUZYjTLwmf8i SBSisOQvvZYjrmu2ozpGHYwwN/8WhvvyxknnQyozQ7kNrZw97z4XPUtApT6eVofj3QMt eq8g== X-Gm-Message-State: AOAM533eL05j4KpO3Fc80HI6yQjxaJv0Nl2s/iqwfRO0Kf4OWxR26Zdt rdiuOG7EKNSgl82UN6eUrXk= X-Google-Smtp-Source: ABdhPJzv09r1vMw4Ze8r90GmCwPXjqCMtbVGmOmg1d166H3EkJmoklQuCS2wRak5XhZI0Cgz8VQy4g== X-Received: by 2002:a17:906:37cd:b0:6e0:bdb6:f309 with SMTP id o13-20020a17090637cd00b006e0bdb6f309mr12180762ejc.394.1649317608706; Thu, 07 Apr 2022 00:46:48 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id lj20-20020a170906f9d400b006e7f1e1f4a0sm4232922ejb.60.2022.04.07.00.46.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 00:46:47 -0700 (PDT) Message-ID: Date: Thu, 7 Apr 2022 09:46:46 +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 v3 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Content-Language: en-US To: Jaewon Kim , Krzysztof Kozlowski , Greg Kroah-Hartman , Alim Akhtar , linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Chanho Park References: <20220407071619.102249-1-jaewon02.kim@samsung.com> <20220407071619.102249-2-jaewon02.kim@samsung.com> From: Jiri Slaby In-Reply-To: <20220407071619.102249-2-jaewon02.kim@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07. 04. 22, 9:16, 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. From the patch POV: Reviewed-by: Jiri Slaby But given this is a v3 with no version changelog below "---", you've just kicked the Greg's bot to wake up :P. > 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..8af5aceb9f4e 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 = true; > > /* not possible to xmit on unconfigured port */ > if (!s3c24xx_port_configured(ucon)) > return; > > + if (cons_uart->sysrq) > + locked = false; > + else if (oops_in_progress) > + locked = spin_trylock_irqsave(&cons_uart->lock, flags); > + else > + spin_lock_irqsave(&cons_uart->lock, flags); > + > uart_console_write(cons_uart, s, count, s3c24xx_serial_console_putchar); > + > + if (locked) > + spin_unlock_irqrestore(&cons_uart->lock, flags); > } > > /* Shouldn't be __init, as it can be instantiated from other module */ -- js suse labs 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 EDB30C433F5 for ; Thu, 7 Apr 2022 07:48:13 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HWVzcmUFiCv5r5Nd53peF8z48ADk0EG0kudyanCHVHQ=; b=UDQH8RBD5qsfii M4+h4PHW+vEgsfEldpVX7e/FNyVjUPYHbUA1+LEdUF/FdmzYsmCuWGy1iV6l8Rpdojot7vzhkysVW PBjRlgMkDEznJiMdY6Z+1YutccdzUPZfuI99NSmzPeZbwDaHajQS+huEyfyz0XIWrO4zUM5l2zw00 GZUm/rqGNgycM/4qBGrnU6cjDIS2yt2TKudhR8X7YWbj235m3PZKlcZGOm8+dWvIc+lcGq/GXrUAP k+NR7NxX1RGS8P9+q5C1bSx59wHTizOZOTkiL0ydl2KWA3CWTRAeaZXdaHzMb1xO5Vdh1lM4Loj3Z BiqJc1B97D1A+/zpMD4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncMr6-00A5ed-6S; Thu, 07 Apr 2022 07:47:01 +0000 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncMqx-00A5a3-QQ for linux-arm-kernel@lists.infradead.org; Thu, 07 Apr 2022 07:46:53 +0000 Received: by mail-ej1-f48.google.com with SMTP id n6so8982609ejc.13 for ; Thu, 07 Apr 2022 00:46:50 -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=n9ByRjCgN7UyNGlvzfT7jWJ7BAn1HisGnqSo99JqgB8=; b=5tUu4K9WoQeXwr7resv+DizOt/UpPOc1kquJsCV2bFZr9eSLMUHpPdnBIEVkBkLJdy N8n6+nNIloKBv4aM2bBwdjfm5uh9JdnFfRs6V9ruAwT9hpHe9LCMEHkf2V8GJxQ3nOvW Ngv5XzFGQZ5kzpJvRdYTlS004z4Mxp8/N5Ks7Lt4fAm2kdckMcYDbFSAedUnLEfU1qlK LQqwo0RrN3dD3ZxtMhu2lY5zkp2eNgogkudA4KlL0lqkSHfgT7ZPkPbMB1tDXW6IZ5sb WNX5JruGWpkJO4fdMMkHaEcvrPxYGesfuRaxeSQ7rEbHa7S8OpNW/uF2IG6tk5WRPEYy 6bZw== X-Gm-Message-State: AOAM530nA0pB5FL0z6uq0/Genikf8WHygpfmV9IB0ikXfSlVYuQojFZ8 USyTQeW8Kjt8X6oHnyumiAPi6b1zK+bc5A== X-Google-Smtp-Source: ABdhPJzv09r1vMw4Ze8r90GmCwPXjqCMtbVGmOmg1d166H3EkJmoklQuCS2wRak5XhZI0Cgz8VQy4g== X-Received: by 2002:a17:906:37cd:b0:6e0:bdb6:f309 with SMTP id o13-20020a17090637cd00b006e0bdb6f309mr12180762ejc.394.1649317608706; Thu, 07 Apr 2022 00:46:48 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id lj20-20020a170906f9d400b006e7f1e1f4a0sm4232922ejb.60.2022.04.07.00.46.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 00:46:47 -0700 (PDT) Message-ID: Date: Thu, 7 Apr 2022 09:46:46 +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 v3 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Content-Language: en-US To: Jaewon Kim , Krzysztof Kozlowski , Greg Kroah-Hartman , Alim Akhtar , linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Chanho Park References: <20220407071619.102249-1-jaewon02.kim@samsung.com> <20220407071619.102249-2-jaewon02.kim@samsung.com> From: Jiri Slaby In-Reply-To: <20220407071619.102249-2-jaewon02.kim@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220407_004651_916353_2B0957DB X-CRM114-Status: GOOD ( 19.51 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07. 04. 22, 9:16, 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. From the patch POV: Reviewed-by: Jiri Slaby But given this is a v3 with no version changelog below "---", you've just kicked the Greg's bot to wake up :P. > 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..8af5aceb9f4e 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 = true; > > /* not possible to xmit on unconfigured port */ > if (!s3c24xx_port_configured(ucon)) > return; > > + if (cons_uart->sysrq) > + locked = false; > + else if (oops_in_progress) > + locked = spin_trylock_irqsave(&cons_uart->lock, flags); > + else > + spin_lock_irqsave(&cons_uart->lock, flags); > + > uart_console_write(cons_uart, s, count, s3c24xx_serial_console_putchar); > + > + if (locked) > + spin_unlock_irqrestore(&cons_uart->lock, flags); > } > > /* Shouldn't be __init, as it can be instantiated from other module */ -- js suse labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel