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 A0A18C433EF for ; Tue, 17 May 2022 13:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347773AbiEQN26 (ORCPT ); Tue, 17 May 2022 09:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347736AbiEQN25 (ORCPT ); Tue, 17 May 2022 09:28:57 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D1E745053; Tue, 17 May 2022 06:28:46 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 43348C000D; Tue, 17 May 2022 13:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1652794125; 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=Y2TIGkHU/bgb24C6NMMMB7WfUQCEG4G7d+XAQKLwIqw=; b=cpI1zQpBVX0RhYaZxjeB/3YZpPtXaDxmRl1lYTqpURgRWied/8EIo2bSAruXxLDAEca9rl HdPR/6JAQap//U7wAgWA3boXRgA8ujFKau1xiF7EvP9CC9EeT5E/jCzyOXifE/iCBffu/A Qt77rxjBfHWuT34sKt1mzMsUeGtV11DB5LsKQYnkLNcbly6PJnoiRuByw9HwOp/5VYi0ct gJmTQrddaaFpq4RKRnb+BUPw2PKBpDTZu5qlfDfhgqe6ifgXWzsOA8M8vuAE+yfsVLU1K1 qkf/9nvkoG8+Hwx8kgDdjFjMz217JhYOj3Q7R4huGSHtTNCdXRAZVniyCCxk9g== Date: Tue, 17 May 2022 15:28:40 +0200 From: Miquel Raynal To: Alexander Aring Cc: Alexander Aring , 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: <20220517152840.5a01037b@xps-13> In-Reply-To: References: <20220512143314.235604-1-miquel.raynal@bootlin.com> <20220512143314.235604-6-miquel.raynal@bootlin.com> <20220517112726.4b89e907@xps-13> 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: linux-wpan@vger.kernel.org aahringo@redhat.com wrote on Tue, 17 May 2022 09:19:29 -0400: > Hi, >=20 > On Tue, May 17, 2022 at 5:28 AM Miquel Raynal = wrote: > > > > Hi Alex, > > =20 > > > > @@ -84,7 +118,7 @@ void ieee802154_xmit_complete(struct ieee802154_= hw *hw, struct sk_buff *skb, > > > > hw->phy->sifs_period * NSEC_P= ER_USEC, > > > > 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 > > > > > > 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. =20 > > > > 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. > > =20 >=20 > In my opinion it's necessary for the ifs hrtimer. Normal > spin_lock/unlock is not the right fit here. You're right, I forgot about hrtimers. Thanks, Miqu=C3=A8l