* how to debug... program hangs while downing for write a rwsem
@ 2022-09-21 11:02 Chan Kim
2022-09-21 11:15 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Chan Kim @ 2022-09-21 11:02 UTC (permalink / raw)
To: kernelnewbies
Hello kernel experts and users,
I'm trying to boot linux-5.10.0-rc5 on our arm64 board (using neoverse-v1
core).
After the shell comes up, when I press enter key at the prompt, it gives me
another prompt.
But when I press enter key again, it stops responding.
After inspecting where the program hangs, I found it hangs in function
tty_set_termios while downing the rwsem.
Please see below where I marked "<===== this line "". (in file
drivers/tty/tty_ioctl.c)
int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
{
struct ktermios old_termios;
struct tty_ldisc *ld;
WARN_ON(tty->driver->type == TTY_DRIVER_TYPE_PTY &&
tty->driver->subtype == PTY_TYPE_MASTER);
/*
* Perform the actual termios internal changes under lock.
*/
/* FIXME: we need to decide on some locking/ordering semantics
for the set_termios notification eventually */
down_write(&tty->termios_rwsem); <====== this
line
old_termios = tty->termios;
tty->termios = *new_termios;
unset_locked_termios(tty, &old_termios);
I have to do some research on tty, line discpline, termios, and rw
semaphores etc. but could anyone give me any suggestion on what can be going
wrong? Or what to check first?
Any suggestion will be really appreciated.
Thank you!
Chan Kim
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to debug... program hangs while downing for write a rwsem
2022-09-21 11:02 how to debug... program hangs while downing for write a rwsem Chan Kim
@ 2022-09-21 11:15 ` Greg KH
2022-09-22 13:17 ` Chan Kim
2022-09-22 13:23 ` Chan Kim
0 siblings, 2 replies; 4+ messages in thread
From: Greg KH @ 2022-09-21 11:15 UTC (permalink / raw)
To: Chan Kim; +Cc: kernelnewbies
On Wed, Sep 21, 2022 at 08:02:50PM +0900, Chan Kim wrote:
> Hello kernel experts and users,
>
> I'm trying to boot linux-5.10.0-rc5 on our arm64 board (using neoverse-v1
> core).
5.10-rc5 is very very very old and obsolete, and not even a real
release. Why are you using that specific kernel version?
At the very least, use a released and supported 5.10.y tree, but even
better, use the latest 5.19.y release.
> After the shell comes up, when I press enter key at the prompt, it gives me
> another prompt.
> But when I press enter key again, it stops responding.
> After inspecting where the program hangs, I found it hangs in function
> tty_set_termios while downing the rwsem.
> Please see below where I marked "<===== this line "". (in file
> drivers/tty/tty_ioctl.c)
>
> int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
> {
> struct ktermios old_termios;
> struct tty_ldisc *ld;
>
> WARN_ON(tty->driver->type == TTY_DRIVER_TYPE_PTY &&
> tty->driver->subtype == PTY_TYPE_MASTER);
> /*
> * Perform the actual termios internal changes under lock.
> */
>
>
> /* FIXME: we need to decide on some locking/ordering semantics
> for the set_termios notification eventually */
> down_write(&tty->termios_rwsem); <====== this
> line
What serial driver are you using that is causing this problem?
thanks,
greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: how to debug... program hangs while downing for write a rwsem
2022-09-21 11:15 ` Greg KH
@ 2022-09-22 13:17 ` Chan Kim
2022-09-22 13:23 ` Chan Kim
1 sibling, 0 replies; 4+ messages in thread
From: Chan Kim @ 2022-09-22 13:17 UTC (permalink / raw)
To: 'Greg KH'; +Cc: kernelnewbies
Hi, Greg K-H,
I found the scheduler isn't working correct.
When I run an application instead of the shell, and when I call sleep()
inside the application, it hangs.
So I have to investigate about the clock settings first(in dts, etc).
(The serial port is 8250 compatible uart that we've been using).
Thank you.
Chan Kim
>-----Original Message-----
>From: Greg KH <greg@kroah.com>
>Sent: Wednesday, September 21, 2022 8:16 PM
>To: Chan Kim <ckim@etri.re.kr>
>Cc: kernelnewbies@kernelnewbies.org
>Subject: Re: how to debug... program hangs while downing for write a rwsem
>
>On Wed, Sep 21, 2022 at 08:02:50PM +0900, Chan Kim wrote:
>> Hello kernel experts and users,
>>
>> I'm trying to boot linux-5.10.0-rc5 on our arm64 board (using
>> neoverse-v1 core).
>
>5.10-rc5 is very very very old and obsolete, and not even a real release.
>Why are you using that specific kernel version?
>
>At the very least, use a released and supported 5.10.y tree, but even
>better, use the latest 5.19.y release.
>
>> After the shell comes up, when I press enter key at the prompt, it
>> gives me another prompt.
>> But when I press enter key again, it stops responding.
>> After inspecting where the program hangs, I found it hangs in function
>> tty_set_termios while downing the rwsem.
>> Please see below where I marked "<===== this line "". (in file
>> drivers/tty/tty_ioctl.c)
>>
>> int tty_set_termios(struct tty_struct *tty, struct ktermios
>> *new_termios) {
>> struct ktermios old_termios;
>> struct tty_ldisc *ld;
>>
>> WARN_ON(tty->driver->type == TTY_DRIVER_TYPE_PTY &&
>> tty->driver->subtype == PTY_TYPE_MASTER);
>> /*
>> * Perform the actual termios internal changes under lock.
>> */
>>
>>
>> /* FIXME: we need to decide on some locking/ordering semantics
>> for the set_termios notification eventually */
>> down_write(&tty->termios_rwsem); <====== this
>> line
>
>What serial driver are you using that is causing this problem?
>
>thanks,
>
>greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: how to debug... program hangs while downing for write a rwsem
2022-09-21 11:15 ` Greg KH
2022-09-22 13:17 ` Chan Kim
@ 2022-09-22 13:23 ` Chan Kim
1 sibling, 0 replies; 4+ messages in thread
From: Chan Kim @ 2022-09-22 13:23 UTC (permalink / raw)
To: 'Greg KH'; +Cc: kernelnewbies
And I am also trying to do the experiment with linux5.15.68.
Somehow linux doesn't start with this new setup and I need some time.
Thank you for the advices.
Chan Kim
>-----Original Message-----
>From: Chan Kim <ckim@etri.re.kr>
>Sent: Thursday, September 22, 2022 10:18 PM
>To: 'Greg KH' <greg@kroah.com>
>Cc: 'kernelnewbies@kernelnewbies.org' <kernelnewbies@kernelnewbies.org>
>Subject: RE: how to debug... program hangs while downing for write a rwsem
>
>Hi, Greg K-H,
>
>I found the scheduler isn't working correct.
>When I run an application instead of the shell, and when I call sleep()
>inside the application, it hangs.
>So I have to investigate about the clock settings first(in dts, etc).
>(The serial port is 8250 compatible uart that we've been using).
>Thank you.
>
>Chan Kim
>
>>-----Original Message-----
>>From: Greg KH <greg@kroah.com>
>>Sent: Wednesday, September 21, 2022 8:16 PM
>>To: Chan Kim <ckim@etri.re.kr>
>>Cc: kernelnewbies@kernelnewbies.org
>>Subject: Re: how to debug... program hangs while downing for write a
>>rwsem
>>
>>On Wed, Sep 21, 2022 at 08:02:50PM +0900, Chan Kim wrote:
>>> Hello kernel experts and users,
>>>
>>> I'm trying to boot linux-5.10.0-rc5 on our arm64 board (using
>>> neoverse-v1 core).
>>
>>5.10-rc5 is very very very old and obsolete, and not even a real release.
>>Why are you using that specific kernel version?
>>
>>At the very least, use a released and supported 5.10.y tree, but even
>>better, use the latest 5.19.y release.
>>
>>> After the shell comes up, when I press enter key at the prompt, it
>>> gives me another prompt.
>>> But when I press enter key again, it stops responding.
>>> After inspecting where the program hangs, I found it hangs in
>>> function tty_set_termios while downing the rwsem.
>>> Please see below where I marked "<===== this line "". (in file
>>> drivers/tty/tty_ioctl.c)
>>>
>>> int tty_set_termios(struct tty_struct *tty, struct ktermios
>>> *new_termios) {
>>> struct ktermios old_termios;
>>> struct tty_ldisc *ld;
>>>
>>> WARN_ON(tty->driver->type == TTY_DRIVER_TYPE_PTY &&
>>> tty->driver->subtype == PTY_TYPE_MASTER);
>>> /*
>>> * Perform the actual termios internal changes under lock.
>>> */
>>>
>>>
>>> /* FIXME: we need to decide on some locking/ordering semantics
>>> for the set_termios notification eventually */
>>> down_write(&tty->termios_rwsem); <====== this
>>> line
>>
>>What serial driver are you using that is causing this problem?
>>
>>thanks,
>>
>>greg k-h
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-22 13:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-21 11:02 how to debug... program hangs while downing for write a rwsem Chan Kim
2022-09-21 11:15 ` Greg KH
2022-09-22 13:17 ` Chan Kim
2022-09-22 13:23 ` Chan Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).