public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Jaewon Kim <jaewon02.kim@samsung.com>,
	'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>
Cc: 'Krzysztof Kozlowski' <krzk@kernel.org>,
	'Alim Akhtar' <alim.akhtar@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	'Chanho Park' <chanho61.park@samsung.com>
Subject: Re: [PATCH 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write
Date: Wed, 6 Apr 2022 11:48:56 +0200	[thread overview]
Message-ID: <98c359ba-9563-3da0-d968-ae40cee9d45f@kernel.org> (raw)
In-Reply-To: <042701d84991$ca50d410$5ef27c30$@samsung.com>

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 <jaewon02.kim@samsung.com>
>>> ---
>>>   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

  reply	other threads:[~2022-04-06 13:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220406081823epcas2p3789ef3ac3956e4713dd1b55c8a49fb05@epcas2p3.samsung.com>
2022-04-06  8:22 ` [PATCH v2 0/1] tty: serial: samsung: add spin_lock in console_write Jaewon Kim
2022-04-06  8:22   ` [PATCH 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Jaewon Kim
2022-04-06  8:21     ` Greg Kroah-Hartman
2022-04-06  8:39       ` Jaewon Kim
2022-04-06  9:48         ` Jiri Slaby [this message]
2022-04-06 11:19           ` Jaewon Kim
2022-04-06 11:21             ` Jiri Slaby
     [not found] <CGME20220405033448epcas2p397080e15c54369d24eaf94c2a27bd06c@epcas2p3.samsung.com>
2022-04-05  3:38 ` [PATCH 0/1] tty: serial: samsung: add spin_lock in console_write Jaewon Kim
2022-04-05  3:38   ` [PATCH 1/1] tty: serial: samsung: add spin_lock for interrupt and console_write Jaewon Kim
2022-04-05  5:01     ` Greg Kroah-Hartman
2022-04-05  6:40       ` Jaewon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98c359ba-9563-3da0-d968-ae40cee9d45f@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=chanho61.park@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaewon02.kim@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox