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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C2DDC4332F for ; Tue, 17 May 2022 09:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244746AbiEQJ21 (ORCPT ); Tue, 17 May 2022 05:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245022AbiEQJ1k (ORCPT ); Tue, 17 May 2022 05:27:40 -0400 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 467C436315; Tue, 17 May 2022 02:27:30 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 0ACAB10000A; Tue, 17 May 2022 09:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1652779648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CElskWjOPxrjDEUSsIpuRKxeKZHvEqYNnoZQwVz/g6A=; b=lNALL991MHPqH4Tfrw0T0ia4mCQJ/8Uh9lBonY95K5msgntmglfdtaRXiq7VJHuwBaf406 5CCiGEL7Uz0kTv3DlLtaDeSKHcnUjT6c//B9v7z+Zm/z1LTsuD5Eeuz3WwZhvWqwSwXTPe 9EQExPYnpquRIrVJIHSZf9E+HSIAF14u3OFBh5qMQb6FdBcm7tig4CQuiqMbdrn9HHyX1+ uoD+KZczfKIL/Skf5DBpMb6w2ZWRNDWWeKSV2ecJgi2SNaF0gOGqEBXuMD1vBKRAuFWAoY YWDgfSyzGDUcNG9k0A5OGF51mKj7P0OKZGdcPxx1kwh+sKk88IB9CrOqh5udSw== Date: Tue, 17 May 2022 11:27:26 +0200 From: Miquel Raynal To: Alexander Aring Cc: Stefan Schmidt , linux-wpan - ML , "David S. Miller" , Jakub Kicinski , Paolo Abeni , "open list:NETWORKING [GENERAL]" , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni Subject: Re: [PATCH wpan-next v2 05/11] net: mac802154: Bring the hability to hold the transmit queue Message-ID: <20220517112726.4b89e907@xps-13> In-Reply-To: References: <20220512143314.235604-1-miquel.raynal@bootlin.com> <20220512143314.235604-6-miquel.raynal@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Alex, > > @@ -84,7 +118,7 @@ void ieee802154_xmit_complete(struct ieee802154_hw *= hw, struct sk_buff *skb, > > hw->phy->sifs_period * NSEC_PER_U= SEC, > > HRTIMER_MODE_REL); > > } else { > > - ieee802154_wake_queue(hw); > > + ieee802154_release_queue(local); > > } > > > > dev_consume_skb_any(skb); > > @@ -98,7 +132,7 @@ void ieee802154_xmit_error(struct ieee802154_hw *hw,= struct sk_buff *skb, > > struct ieee802154_local *local =3D hw_to_local(hw); > > > > local->tx_result =3D reason; > > - ieee802154_wake_queue(hw); > > + ieee802154_release_queue(local); > > dev_kfree_skb_any(skb); > > atomic_dec(&hw->phy->ongoing_txs); =20 >=20 > I am pretty sure that will end in a scheduling while atomic warning > with hwsim. If you don't hit it you have the wrong config, you need to > enable such warnings and have the right preemption model setting. I was using the "desktop" kernel preemption model (voluntary), I've switched to CONFIG_PREEMPT ("Preemptible kernel (Low-latency)"), and enabled CONFIG_DEBUG_ATOMIC_SLEEP. You are right that we should use a spinlock instead of a mutex here. However I don't think disabling IRQs is necessary, so I'll switch to spin_(un)lock() calls. > These calls xmit complete/error should even be allowed to be called > from a hardware irq context, however I _think_ we don't have a driver > which currently does that, but the mutex will break stuff here in the > xmit_do() callback of netdev which hwsim is calling it from. >=20 > Please check again... Will perform a new set of test runs with the new configuration, yes. Thanks, Miqu=C3=A8l