Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3013277rwb; Mon, 15 Aug 2022 16:09:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR4C7bk1i+H8vf4QIxOk5jIAWVDHf/CNCK43PEV8lsaWN+7G4HSXFXuSHvp5P+K4wLOjuoxW X-Received: by 2002:a17:907:9619:b0:730:8ebb:9e45 with SMTP id gb25-20020a170907961900b007308ebb9e45mr12043349ejc.628.1660604940579; Mon, 15 Aug 2022 16:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604940; cv=none; d=google.com; s=arc-20160816; b=c1QI0AzQtb8Ut/wcdltOtm8tfu0VhSQHyXXoWyEWNTh2Pu3ja3hlaMAoEdh5+HoZXN b/sdPzauU0gI+/YpI3V4Hw3A+JvktBrjvDqO4owp3870Z+/vcMvU3lPNT9YOedXO8tok VSQj3tJmJkLT8DDwvEWsslUtVL7DT26+k7j+yu0mFmOboVZnA5yT5TZ1hRkZZbOCPXd6 87G6iZt/jqSS9xUOsvSRoJUhC+zmEhtGyBytKQFpaGYHRh95YBfVtJqO2zedaa9DSCP0 LVI2cxuWp6RTxhJ/lgfOnNoc6JniiCWv/9akGs2stdWxD6rkMruJoA3jJOLFvKxqmruB SqOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/5y2y2YteCUAGASlEL6/ViSL7MjE7OTOwR6grPYsktI=; b=bS5t4mdHkA3VfvLGzerUNy2jULNId+X4/qjHhhcQSHbsmr5h9mlVjQ5WNlU/oiVl2s /P3o9PBtmWPPZA6t8IHSWIowdvtpqZOozQ5DBQEnG4bJaau2/CFLWQQDdy1Aejcxrrzy v5YXFsop8twCEU/KJvdZVNnu2uYf/lv1yQtlCa+fQGpZk5TUpxZdv0jIhPgynJOa7c4T q1Slf7nI3dudTNW7Wdj1maiFfaYGgY8zHsxGvLG1QQLSUnoXx02sjNnq9pYFawYpTFjr +x0j4GiykSlv9fzyex7xclzqfJWECk1AFtjigwnAZgDa4PWf0muPxRKxlJ34pzLjA8aU Dl0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WOZmHCsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z21-20020a05640240d500b0043d9c8dbfd9si10761707edb.31.2022.08.15.16.08.34; Mon, 15 Aug 2022 16:09:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WOZmHCsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350748AbiHOWkj (ORCPT + 99 others); Mon, 15 Aug 2022 18:40:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350190AbiHOWfz (ORCPT ); Mon, 15 Aug 2022 18:35:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5900371BF1; Mon, 15 Aug 2022 12:49:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2CB52B8114D; Mon, 15 Aug 2022 19:49:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E22CC433D6; Mon, 15 Aug 2022 19:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592967; bh=MNK7u5dyCfo7vAH0daYRM5AOYYJy+wYIqzg5aLVcy9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WOZmHCspgGrBey04IOvCquv4ytgK9e8vWLYBTP5qQ2JWxEhDxNcvMCfJHcz3xjASw c6AXFa0JNAFoADVH5urdlHfaXNJMFMzEC9617mpvapCRIebF1lo+6a7FA4NIeUIpCI ODDsIX+Oe/Vrh5Y4GT7WJZhk4YJLYmnSnmM0FFsM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Starke , Sasha Levin Subject: [PATCH 5.18 0873/1095] tty: n_gsm: fix flow control handling in tx path Date: Mon, 15 Aug 2022 20:04:32 +0200 Message-Id: <20220815180505.489476843@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Starke [ Upstream commit 59ff0680ecbfec742b1e0381e7cc46b41eb06647 ] The current implementation constipates all transmission paths during flow control except for flow control frames. However, these may not be located at the beginning of the transmission queue of the control channel. Ensure that flow control frames in the transmission queue for the control channel are always handled even if constipated by skipping through other messages. Fixes: 0af021678d5d ("tty: n_gsm: fix deadlock and link starvation in outgoing data path") Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220707113223.3685-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 8b8c7312935f..7749de4f269a 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -891,7 +891,7 @@ static int gsm_data_kick(struct gsm_mux *gsm) /* Serialize control messages and control channel messages first */ list_for_each_entry_safe(msg, nmsg, &gsm->tx_ctrl_list, list) { if (gsm->constipated && !gsm_is_flow_ctrl_msg(msg)) - return -EAGAIN; + continue; ret = gsm_send_packet(gsm, msg); switch (ret) { case -ENOSPC: -- 2.35.1