Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2974126pxb; Mon, 17 Jan 2022 09:16:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyzKQ9M9XRaRJBlzLqCgIvSmh2zG/hzlBSyiXFPBpqxSXbRcshLlquFwqNSRDMlnhsD3Jk X-Received: by 2002:a17:902:dad0:b0:14a:26ae:4e68 with SMTP id q16-20020a170902dad000b0014a26ae4e68mr23927840plx.123.1642439765507; Mon, 17 Jan 2022 09:16:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642439765; cv=none; d=google.com; s=arc-20160816; b=wVhwnhp+1p0L1sq7BXJvzezv8XwyI8qkv2h6nb1VXLv22XmtEL47Z/gzkccR2teaoN fiwIgvF3+hKaMsiLg966IcMmSNXXaoCMxtKA3MmPmBsIPh14OcqcqsQHaoWdl7oPoh7U Td8/3/WN8tAnNOgqk5uFwxKccld2XrLPniL+Vd6/uuzHVfVjAI40JAm1O0g+06qudUKf J0wvIcReg/4zS5RtDCULluvqQDdWBRoxGBT2SLOoZg0B2v0LnhQW+TGFcF9nuPFyQoUZ HWFzfBWFDKLOzw4WSyO4hgBHbAWNBE4SyHhmhyyykXXo1g3JJsdDUtxI4gqlzPtes2lS m2xQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=c+HLKE0ysJv88qShRszKeKEg8x4zHEhU9xkHWsho1Kw=; b=auTOcGzU5pwVuQzQzbE9jGselnfuaXZ6EWLWXYsFAmqPXZOc5ysz78rbkxc7kQ1MpW FiNKZUe4w+HQpOpdtYmj6P6dIdyd0aupuW3wiyAzcFhzQ1q5NdNWJMI2y1LC4fESY7xv fJKngupp+5B2gYyAJC00i6dEvlqZwJ0ybjj5voSg7cwZv1GooF3d4vQqB2Jty9RDM10g NRmsEcx2sA3WxQYSn7naFdfYN7deYdEJwMAuF52baC5WvghdF0abqqZuoYSH1PZ5Jisb XbL3ztB8kD/gajDZd67h3QkMkIA96JYYw3F1hMGwu+0UsP8GefhdfRRbnKW4+OD6wEyz 7afw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si1768003pll.197.2022.01.17.09.15.54; Mon, 17 Jan 2022 09:16:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239416AbiAQLz2 (ORCPT + 70 others); Mon, 17 Jan 2022 06:55:28 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:39685 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239377AbiAQLzU (ORCPT ); Mon, 17 Jan 2022 06:55:20 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 2CEEA200012; Mon, 17 Jan 2022 11:55:17 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Michael Hennerich , Jakub Kicinski , Varka Bhadram , Xue Liu , Alan Ott , Thomas Petazzoni , Miquel Raynal Subject: [PATCH v3 18/41] net: ieee802154: atusb: Call the complete helper when a transmission is over Date: Mon, 17 Jan 2022 12:54:17 +0100 Message-Id: <20220117115440.60296-19-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220117115440.60296-1-miquel.raynal@bootlin.com> References: <20220117115440.60296-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org ieee802154_xmit_complete() is the right helper to call when a transmission is over. The fact that it completed or not is not really a question, but drivers must tell the core that the completion is over, even if it was canceled. Do not call ieee802154_wake_queue() manually, in order to let full control of this task to the core. Here the skb is freed with a particular helper because it is done in irq context. It is not necessary to do that as the *_xmit_complete() helper will handle it properly anyway. Signed-off-by: Miquel Raynal --- drivers/net/ieee802154/atusb.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c index 1a56073c1c52..4bc7b2dcbdd2 100644 --- a/drivers/net/ieee802154/atusb.c +++ b/drivers/net/ieee802154/atusb.c @@ -262,19 +262,16 @@ static void atusb_tx_done(struct atusb *atusb, u8 seq) u8 expect = atusb->tx_ack_seq; dev_dbg(&usb_dev->dev, "%s (0x%02x/0x%02x)\n", __func__, seq, expect); - if (seq == expect) { - /* TODO check for ifs handling in firmware */ - ieee802154_xmit_complete(atusb->hw, atusb->tx_skb, false); - } else { - /* TODO I experience this case when atusb has a tx complete - * irq before probing, we should fix the firmware it's an - * unlikely case now that seq == expect is then true, but can - * happen and fail with a tx_skb = NULL; - */ - ieee802154_wake_queue(atusb->hw); - if (atusb->tx_skb) - dev_kfree_skb_irq(atusb->tx_skb); - } + + /* TODO: + * seq == expect: Check for ifs handling in firmware. + * seq != expect: I experience this case when atusb has a tx complete + * irq before probing, we should fix the firmware it's an unlikely case + * now that seq == expect is then true, but can happen and fail with a + * tx_skb = NULL; + */ + + ieee802154_xmit_complete(atusb->hw, atusb->tx_skb, false); } static void atusb_in_good(struct urb *urb) -- 2.27.0