linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/20] tty: n_gsm: fix missing mux reset on config change at responder
@ 2022-04-14  9:42 D. Starke
  2022-04-14  9:42 ` [PATCH 02/20] tty: n_gsm: fix restart handling via CLD command D. Starke
                   ` (18 more replies)
  0 siblings, 19 replies; 33+ messages in thread
From: D. Starke @ 2022-04-14  9:42 UTC (permalink / raw)
  To: linux-serial, gregkh, jirislaby; +Cc: linux-kernel, Daniel Starke

From: Daniel Starke <daniel.starke@siemens.com>

Currently, only the initiator resets the mux protocol if the user requests
new parameters that are incompatible to those of the current connection.
The responder also needs to reset the multiplexer if the new parameter set
requires this. Otherwise, we end up with an inconsistent parameter set
between initiator and responder.
Revert the old behavior to inform the peer upon an incompatible parameter
set change from the user on the responder side by re-establishing the mux
protocol in such case.

Fixes: 509067bbd264 ("tty: n_gsm: Delete gsm_disconnect when config requester")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
---
 drivers/tty/n_gsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index fa92f727fdf8..3d28ecebd473 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2373,7 +2373,7 @@ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c)
 	 * configuration
 	 */
 
-	if (gsm->initiator && (need_close || need_restart)) {
+	if (need_close || need_restart) {
 		int ret;
 
 		ret = gsm_disconnect(gsm);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 33+ messages in thread
* RE: [PATCH 16/20] tty: n_gsm: fix invalid command/response bit check for UI/UIH frames
@ 2022-04-19  7:10 Starke, Daniel
  2022-04-19  7:26 ` Greg KH
  0 siblings, 1 reply; 33+ messages in thread
From: Starke, Daniel @ 2022-04-19  7:10 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-serial, jirislaby, linux-kernel

> 42:21AM -0700, D. Starke wrote:
> > From: Daniel Starke <daniel.starke@siemens.com>
> > 
> > n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010.
> > See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516
> > The changes from 07.010 to 27.010 are non-functional. Therefore, I 
> > refer to the newer 27.010 here. Chapter 5.4.3.1 states the CR bit in 
> > UI and UIH frames shall always be set 1 by the initiator and 0 by the responder.
> 
> This has nothing to do with the change you made here.
> 
> 
> > Currently, gsm_queue() has a pre-processor gated (excluded) check 
> > which treats all frames that conform to the standard as malformed frames.
> > Remove this optional code to avoid confusion and possible breaking 
> > changes in case that someone includes it.
> 
> Again, nothing to do with the code change.

Including this code (i.e. with #if 1) will treat every correct UI/UIH frame
as invalid, because the cr flag is always set to 1 for those frames
(as mentioned in chapter 5.4.3.1 of the standard). This is obviously wrong.

> > 
> > Fixes: e1eaea46bb40 ("tty: n_gsm line discipline")
> 
> This "fixes" nothing :(

What is the correct way to handle the removal of such dead and obviously
wrong code?

> > Cc: stable@vger.kernel.org
> 
> How is commenting out unused code a stable backport requirement?

True, it does not change the behavior but it fixes a commit which is also
present in the current stable release. I was unsure how to handle this
case. I will remove the backport remark.

> > Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
> > ---
> >  drivers/tty/n_gsm.c | 4 ----
> >  1 file changed, 4 deletions(-)
> > 
> > diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 
> > e9a7d9483c1f..f4ec48c0d6d7 100644
> > --- a/drivers/tty/n_gsm.c
> > +++ b/drivers/tty/n_gsm.c
> > @@ -1896,10 +1896,6 @@ static void gsm_queue(struct gsm_mux *gsm)
> >  	case UI|PF:
> >  	case UIH:
> >  	case UIH|PF:
> > -#if 0
> > -		if (cr)
> > -			goto invalid;
> > -#endif
> 
> All you are doing is cleaning up dead code.  Not a big deal, and not
> worth all the text above to confuse people :(

As mentioned above, this is not only dead but also wrong code. I tried to
elaborate the reason for it being wrong code in the text above.

Best regards,
Daniel Starke

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2022-04-19 10:08 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14  9:42 [PATCH 01/20] tty: n_gsm: fix missing mux reset on config change at responder D. Starke
2022-04-14  9:42 ` [PATCH 02/20] tty: n_gsm: fix restart handling via CLD command D. Starke
2022-04-14  9:42 ` [PATCH 03/20] tty: n_gsm: fix decoupled mux resource D. Starke
2022-04-14  9:42 ` [PATCH 04/20] tty: n_gsm: fix mux cleanup after unregister tty device D. Starke
2022-04-14  9:42 ` [PATCH 05/20] tty: n_gsm: fix wrong signal octet encoding in convergence layer type 2 D. Starke
2022-04-14  9:42 ` [PATCH 06/20] tty: n_gsm: fix frame reception handling D. Starke
2022-04-14  9:42 ` [PATCH 07/20] tty: n_gsm: fix malformed counter for out of frame data D. Starke
2022-04-14  9:42 ` [PATCH 08/20] tty: n_gsm: fix insufficient txframe size D. Starke
2022-04-14  9:42 ` [PATCH 09/20] tty: n_gsm: fix wrong DLCI release order D. Starke
2022-04-14  9:42 ` [PATCH 10/20] tty: n_gsm: fix missing explicit ldisc flush D. Starke
2022-04-14  9:42 ` [PATCH 11/20] tty: n_gsm: fix wrong command retry handling D. Starke
2022-04-14  9:42 ` [PATCH 12/20] tty: n_gsm: fix wrong command frame length field encoding D. Starke
2022-04-14  9:42 ` [PATCH 13/20] tty: n_gsm: fix wrong signal octets encoding in MSC D. Starke
2022-04-14  9:42 ` [PATCH 14/20] tty: n_gsm: fix missing tty wakeup in convergence layer type 2 D. Starke
2022-04-14  9:42 ` [PATCH 15/20] tty: n_gsm: fix missing update of modem controls after DLCI open D. Starke
2022-04-15  6:29   ` Greg KH
2022-04-19  8:07     ` [PATCH v2 " D. Starke
2022-04-19 10:07       ` Greg KH
2022-04-14  9:42 ` [PATCH 16/20] tty: n_gsm: fix invalid command/response bit check for UI/UIH frames D. Starke
2022-04-15  6:31   ` Greg KH
2022-04-19  8:17     ` [PATCH v2 16/20] tty: n_gsm: clean up dead code in gsm_queue() D. Starke
2022-04-19 10:06       ` Greg KH
2022-04-19 10:07       ` Greg KH
2022-04-14  9:42 ` [PATCH 17/20] tty: n_gsm: fix reset fifo race condition D. Starke
2022-04-14  9:42 ` [PATCH 18/20] tty: n_gsm: fix implicit CR bit encoding in address field D. Starke
2022-04-15  6:33   ` Greg KH
2022-04-19  8:19     ` [PATCH v2 18/20] tty: n_gsm: clean up " D. Starke
2022-04-19 10:06       ` Greg KH
2022-04-14  9:42 ` [PATCH 19/20] tty: n_gsm: fix wrong behavior of gsm_carrier_raised() on debug D. Starke
2022-04-15  6:34   ` Greg KH
2022-04-14  9:42 ` [PATCH 20/20] tty: n_gsm: fix incorrect UA handling D. Starke
2022-04-19  7:10 [PATCH 16/20] tty: n_gsm: fix invalid command/response bit check for UI/UIH frames Starke, Daniel
2022-04-19  7:26 ` Greg KH

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).