Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3261898rwb; Mon, 15 Aug 2022 22:37:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR4D/kGKa9ClhlA/em6KrcRPqhDG6GeBzeDbbagbu+VVFcVlZUFw3+vuCvL5pOXy0J4uDytu X-Received: by 2002:a17:902:ef81:b0:16d:cd36:7955 with SMTP id iz1-20020a170902ef8100b0016dcd367955mr19909175plb.24.1660628240466; Mon, 15 Aug 2022 22:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628240; cv=none; d=google.com; s=arc-20160816; b=vXWnxkR1kFlysmok+t34/jxplQSCpwu0hQRxoO7hWTx88H49iMBnRghFTFNeHwBo5K LkBpeLjMF6PrKk9K1PbAQ/i603fH5KCy8xWc8dMJndsoiUqw6vmG15Xv2kzai7Hf29e0 qiD93y5BrsVbCyq0QQvvZI6Nbt6YIQj954+TgT827MHTwRnfTE5AZKJ3QwNYylC1Tzsh djAyGHRPNEjaD9DO2cLK52EaWCDlo2SCTqaNqhS1UxeVIh3Y3odO8LOS0tF4pbRr+t8w u/po0cZLJZyiB2JEHlQoy5KCNXlw6osrUarRj40UDcwKLd2qmfZ3XXiG4FaFvEnH5uL2 JFjA== 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=whF3xF5CrI3O/JdWcSTiwP76k7WH1qClv96CnKjy5ws=; b=xG9qV4Qc9vqGpa+7XCIUUFbHOX/8fBGcVUzzLyGTUE5Y7btns1K1XTvmY8Xy7zYe+d pCBomgXY4LArLhJtGY5d6gAx1EBlTs/Xcf2NR3qWFkRE+K2biTrUFBodAwBV5Ipl1byR jaGXWO8gbNrsj0+BUh//r1hiJy/G1nmj6/5VDl5viEcHsoKMLvMbvL/fvynRmm+ZOQ+m +MCgdBjNuBHFkdH5D69TojZ3Q5PyQjP4pb8lGO8K2fOrUr3L9rrQwXY8IhtxnpoN8wdK +IOGkcO5tlPFMYKobMneQlSrh8pX2Cg74ek0V3R1Pyiuaa3KSMHo5CEkZsDtZpEgR0d+ YPxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HZsYEmHM; 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 p29-20020a056a0026dd00b0052523d203a0si11214669pfw.77.2022.08.15.22.37.10; Mon, 15 Aug 2022 22:37:20 -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=HZsYEmHM; 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 S232487AbiHPErG (ORCPT + 99 others); Tue, 16 Aug 2022 00:47:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232184AbiHPEoB (ORCPT ); Tue, 16 Aug 2022 00:44:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 018DD191378; Mon, 15 Aug 2022 13:40:09 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CD0FC6123A; Mon, 15 Aug 2022 20:40:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D67BEC433C1; Mon, 15 Aug 2022 20:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596008; bh=BwivCXdpVUnrCIEe7lBbklIGrOowao4E3xi5XGbnH7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HZsYEmHMGp2QwyIlGCocKBcsEjUdPxOwQPtmyx7pzc3Q/U7B3PHig0bit5vhtfDZb 6x4MbhWnNp6E1aNeXEa1lisDt6EubSJnHnsxtBfnSBxwJ0L7nNVpQSSZV8xE2ehECo 2ujlK38ikbyhqoPRC0oPs52podz3ficEaK3mezNo= 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.19 0945/1157] tty: n_gsm: fix flow control handling in tx path Date: Mon, 15 Aug 2022 20:05:01 +0200 Message-Id: <20220815180517.348862851@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 90060018928f..51447ccccbab 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