xhci: dbgtty: fix device unregister: fixup typo
PATCH 1/1 xhci: dbgtty: fix device unregister: fixup typo
From: Łukasz Bartosik <[email protected]>
When DbC is disconnected then xhci_dbc_tty_unregister_device() is called. However if there is any user space process blocked on write to DbC terminal device then it will never be signalled and thus stay blocked indefinitely.
This fix adds a tty_vhangup() call in xhci_dbc_tty_unregister_device(). The tty_vhangup() wakes up any blocked writers and causes subsequent write attempts to DbC terminal device to fail.
Fix typo indifinitely->indefinitely
--
2.52.0.460.gd25c4c69ec-goog
Greg Kroah-Hartman
maintainerQuoted 11 lines · Łukasz Bartosik
From: Łukasz Bartosik <[email protected]>
When DbC is disconnected then
xhci_dbc_tty_unregister_device()is called. However if there is any user space process blocked on write to DbC terminal device then it will never be signalled and thus stay blocked indefinitely.This fix adds a
tty_vhangup()call inxhci_dbc_tty_unregister_device(). Thetty_vhangup()wakes up any blocked writers and causes subsequent write attempts to DbC terminal device to fail.
Quoted 9 lines
Fixes dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")Signed-off-by Łukasz Bartosik <[email protected]>Fix typo
indifinitely->indefinitely--
2.52.0.460.gd25c4c69ec-goog
I see no patch here :(
Quoted 17 lines · Greg Kroah-Hartman
Quoted 15 lines · Łukasz Bartosik
From: Łukasz Bartosik <[email protected]>
When DbC is disconnected then
xhci_dbc_tty_unregister_device()is called. However if there is any user space process blocked on write to DbC terminal device then it will never be signalled and thus stay blocked indefinitely.This fix adds a
tty_vhangup()call inxhci_dbc_tty_unregister_device(). Thetty_vhangup()wakes up any blocked writers and causes subsequent write attempts to DbC terminal device to fail.Fixes dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")Signed-off-by Łukasz Bartosik <[email protected]>
Quoted 7 lines
Quoted 5 lines
Fix typo
indifinitely->indefinitely--
2.52.0.460.gd25c4c69ec-googI see no patch here :(
Hi Greg,
The typo I fixed was in the commit message indifinitely->indefinitely.
Would you please elaborate what is your expectation for a fixup in this case ?
Thanks,
Łukasz
Quoted 25 lines · Łukasz Bartosik
Quoted 23 lines · Greg Kroah-Hartman
Quoted 20 lines · Łukasz Bartosik
From: Łukasz Bartosik <[email protected]>
When DbC is disconnected then
xhci_dbc_tty_unregister_device()is called. However if there is any user space process blocked on write to DbC terminal device then it will never be signalled and thus stay blocked indefinitely.This fix adds a
tty_vhangup()call inxhci_dbc_tty_unregister_device(). Thetty_vhangup()wakes up any blocked writers and causes subsequent write attempts to DbC terminal device to fail.Fixes dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")Signed-off-by Łukasz Bartosik <[email protected]>Fix typo
indifinitely->indefinitely--
2.52.0.460.gd25c4c69ec-goog
Quoted 8 lines
Quoted 1 line
I see no patch here :(
Hi Greg,
The typo I fixed was in the commit message
indifinitely->indefinitely.Would you please elaborate what is your expectation for a fixup in this case ?
A fixup patch is just a new patch that is applied on top of the first.
If the typo was in the commit message then it can't be helped.
I still think we need a fixup patch for the missing null check
- tty_vhangup(port->port.tty);
+ if (port->port.tty)
+ tty_vhangup(port->port.tty);
or just use tty_port_tty_vhangup()
Remember to add Jiri Slaby and stable to CC, and a new Fixes tag
Thanks
Mathias
Quoted 29 lines · Mathias Nyman
Quoted 27 lines · Łukasz Bartosik
Quoted 24 lines · Greg Kroah-Hartman
Quoted 11 lines · Łukasz Bartosik
From: Łukasz Bartosik <[email protected]>
When DbC is disconnected then
xhci_dbc_tty_unregister_device()is called. However if there is any user space process blocked on write to DbC terminal device then it will never be signalled and thus stay blocked indefinitely.This fix adds a
tty_vhangup()call inxhci_dbc_tty_unregister_device(). Thetty_vhangup()wakes up any blocked writers and causes subsequent write attempts to DbC terminal device to fail.Quoted 9 lines
Fixes dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")Signed-off-by Łukasz Bartosik <[email protected]>Fix typo
indifinitely->indefinitely--
2.52.0.460.gd25c4c69ec-googI see no patch here :(
Quoted 9 lines
Quoted 6 lines
Hi Greg,
The typo I fixed was in the commit message
indifinitely->indefinitely.Would you please elaborate what is your expectation for a fixup in this case ?
A fixup patch is just a new patch that is applied on top of the first.
Thank you for the clarification.
Quoted 2 lines
If the typo was in the commit message then it can't be helped.
:(
Quoted 8 lines
I still think we need a fixup patch for the missing null check
(quoted diff) +2
-1- tty_vhangup(port->port.tty); + if (port->port.tty) + tty_vhangup(port->port.tty);or just use
tty_port_tty_vhangup()
IMHO it looks good because tty_vhangup calls two functions inside:
1) tty_debug_hangup - which handles the case when tty is null
2) __tty_hangup - which also checks tty for null
Thanks,
Łukasz
Quoted 7 lines
Remember to add Jiri Slaby and stable to CC, and a new Fixes tag
Fixes 1f73b8b56cf3 ("xhci: dbgtty: fix device unregister")Thanks
Mathias
Quoted 6 lines · Łukasz Bartosik
Quoted 6 lines
I still think we need a fixup patch for the missing null check
(quoted diff) +2
-1- tty_vhangup(port->port.tty); + if (port->port.tty) + tty_vhangup(port->port.tty);
Quoted 6 lines
Quoted 2 lines
or just use
tty_port_tty_vhangup()IMHO it looks good because
tty_vhangupcalls two functions inside:
1)tty_debug_hangup- which handles the case when tty is null
2)__tty_hangup- which also checks tty for null
Is it still good when someone closes the TTY right after the "if (!tty)" checks?
thanks,
Signature · 2 lines
js suse labs
Quoted 11 lines · Jiri Slaby
Quoted 9 lines · Łukasz Bartosik
Quoted 8 lines
I still think we need a fixup patch for the missing null check
(quoted diff) +2
-1- tty_vhangup(port->port.tty); + if (port->port.tty) + tty_vhangup(port->port.tty);or just use
tty_port_tty_vhangup()
Quoted 7 lines
Quoted 3 lines
IMHO it looks good because
tty_vhangupcalls two functions inside:
1)tty_debug_hangup- which handles the case when tty is null
2)__tty_hangup- which also checks tty for nullIs it still good when someone closes the TTY right after the "if (!tty)" checks?
Hi Jiri,
Will putting tty_vhangup around get and put reference as follows suffice:
tty = tty_port_tty_get(port);
if (tty) {
tty_vhangup(tty);
tty_kref_put(tty);
}Thanks,
Łukasz
Quoted 4 lines
thanks,
--
js
suse labs
Quoted 21 lines · Łukasz Bartosik
Quoted 11 lines · Jiri Slaby
Quoted 9 lines · Łukasz Bartosik
Quoted 8 lines
I still think we need a fixup patch for the missing null check
(quoted diff) +2
-1- tty_vhangup(port->port.tty); + if (port->port.tty) + tty_vhangup(port->port.tty);or just use
tty_port_tty_vhangup()Quoted 7 lines
Quoted 3 lines
IMHO it looks good because
tty_vhangupcalls two functions inside:
1)tty_debug_hangup- which handles the case when tty is null
2)__tty_hangup- which also checks tty for nullIs it still good when someone closes the TTY right after the "if (!tty)" checks?
Quoted 9 lines
Hi Jiri,
Will putting
tty_vhanguparound get and put reference as follows suffice:
tty =tty_port_tty_get(port);if (tty) { tty_vhangup(tty); tty_kref_put(tty); }
Ah I missed what already Mathias pointed out to me in the comment
https://lore.kernel.org/all/[email protected]/
that there is a helper tty_port_tty_vhangup which takes care of the locking as well.
I will send a fixup which switches tty_vhangup -> tty_port_tty_vhangup.
Thanks,
Łukasz
Quoted 7 lines
Thanks,
ŁukaszQuoted 4 lines
thanks,
--
js
suse labs
Quoted 33 lines · Łukasz Bartosik
Quoted 21 lines · Łukasz Bartosik
Quoted 11 lines · Jiri Slaby
Quoted 9 lines · Łukasz Bartosik
Quoted 8 lines
I still think we need a fixup patch for the missing null check
(quoted diff) +2
-1- tty_vhangup(port->port.tty); + if (port->port.tty) + tty_vhangup(port->port.tty);or just use
tty_port_tty_vhangup()Quoted 7 lines
Quoted 3 lines
IMHO it looks good because
tty_vhangupcalls two functions inside:
1)tty_debug_hangup- which handles the case when tty is null
2)__tty_hangup- which also checks tty for nullIs it still good when someone closes the TTY right after the "if (!tty)" checks?
Quoted 9 lines
Hi Jiri,
Will putting
tty_vhanguparound get and put reference as follows suffice:
tty =tty_port_tty_get(port);if (tty) { tty_vhangup(tty); tty_kref_put(tty); }
Quoted 7 lines
Ah I missed what already Mathias pointed out to me in the comment
https://lore.kernel.org/all/[email protected]/
that there is a helpertty_port_tty_vhangupwhich takes care of the locking as well.I will send a fixup which switches
tty_vhangup->tty_port_tty_vhangup.
I sent the fixup
https://lore.kernel.org/linux-usb/[email protected]/T/
Thank you,
Łukasz
Quoted 10 lines
Thanks,
ŁukaszQuoted 7 lines
Thanks,
ŁukaszQuoted 4 lines
thanks,
--
js
suse labs
Greg Kroah-Hartman
maintainerQuoted 25 lines · Łukasz Bartosik
Quoted 23 lines · Greg Kroah-Hartman
Quoted 20 lines · Łukasz Bartosik
From: Łukasz Bartosik <[email protected]>
When DbC is disconnected then
xhci_dbc_tty_unregister_device()is called. However if there is any user space process blocked on write to DbC terminal device then it will never be signalled and thus stay blocked indefinitely.This fix adds a
tty_vhangup()call inxhci_dbc_tty_unregister_device(). Thetty_vhangup()wakes up any blocked writers and causes subsequent write attempts to DbC terminal device to fail.Fixes dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")Signed-off-by Łukasz Bartosik <[email protected]>Fix typo
indifinitely->indefinitely--
2.52.0.460.gd25c4c69ec-goog
Quoted 7 lines
Quoted 1 line
I see no patch here :(
Hi Greg,
The typo I fixed was in the commit message
indifinitely->indefinitely.Would you please elaborate what is your expectation for a fixup in this case ?
Ah, I thought it was a change to the diff. We can't change changelogs after they are in the tree, sorry.
thanks,
greg k-h