From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79400C433E0 for ; Tue, 23 Jun 2020 20:38:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CB9D21556 for ; Tue, 23 Jun 2020 20:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944688; bh=RKzGD6lcVFVuneTYXmOsS0SLZyi2rWyTN9HgVIs7GMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=y+9ZHGRZy+ebmOdmxw25xDvbmgLQZdABeeHGxfI+TXQT6n9OWId5zkRpFa2zNkoLd hcuCachzD7KLoZ+lKmzFkl3/RJ8lwtAowzJ5Sg6Q4GS08EM6Ix6auDTv6n4AiueEZa 3sp8K3IETNfE7RocaUBuLDzlDuAU5OWwC+Weiv5I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391917AbgFWUiG (ORCPT ); Tue, 23 Jun 2020 16:38:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:33446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391909AbgFWUiD (ORCPT ); Tue, 23 Jun 2020 16:38:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F1F321556; Tue, 23 Jun 2020 20:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592944683; bh=RKzGD6lcVFVuneTYXmOsS0SLZyi2rWyTN9HgVIs7GMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w8kdtqwAZCFw4IQ4q6a5nhMbYYyZQlkZ22wMLaY+xWPgujBXrOCyBfstQhZ0XWXGz wXv6dMv6tWz0NfDHffRzfNtV9yVoL4/UxTYbHNjFYuIcCej7mGhJ3zmQvnllSLuUVL oGle0eVVd75i+9J2bsWDoKfvRXfSBkgl+yiUwAp8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gregory CLEMENT , Sasha Levin Subject: [PATCH 4.19 084/206] tty: n_gsm: Fix SOF skipping Date: Tue, 23 Jun 2020 21:56:52 +0200 Message-Id: <20200623195321.078680703@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195316.864547658@linuxfoundation.org> References: <20200623195316.864547658@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Gregory CLEMENT [ Upstream commit 84d6f81c1fb58b56eba81ff0a36cf31946064b40 ] For at least some modems like the TELIT LE910, skipping SOF makes transfers blocking indefinitely after a short amount of data transferred. Given the small improvement provided by skipping the SOF (just one byte on about 100 bytes), it seems better to completely remove this "feature" than make it optional. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Signed-off-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20200512115323.1447922-3-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/n_gsm.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 86b7e20ffd7f1..8d8229dd27961 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -669,7 +669,6 @@ static void gsm_data_kick(struct gsm_mux *gsm) { struct gsm_msg *msg, *nmsg; int len; - int skip_sof = 0; list_for_each_entry_safe(msg, nmsg, &gsm->tx_list, list) { if (gsm->constipated && msg->addr) @@ -691,15 +690,10 @@ static void gsm_data_kick(struct gsm_mux *gsm) print_hex_dump_bytes("gsm_data_kick: ", DUMP_PREFIX_OFFSET, gsm->txframe, len); - - if (gsm->output(gsm, gsm->txframe + skip_sof, - len - skip_sof) < 0) + if (gsm->output(gsm, gsm->txframe, len) < 0) break; /* FIXME: Can eliminate one SOF in many more cases */ gsm->tx_bytes -= msg->len; - /* For a burst of frames skip the extra SOF within the - burst */ - skip_sof = 1; list_del(&msg->list); kfree(msg); -- 2.25.1