Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp283917pxb; Thu, 20 Jan 2022 13:28:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzskLx1bSfmezlhZbH/DQ/TfoaBmH0G5LAypylTy1s6q3KD4wroybTFAzKRLbIae08f8CIX X-Received: by 2002:a63:ad42:: with SMTP id y2mr540926pgo.386.1642714131480; Thu, 20 Jan 2022 13:28:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642714131; cv=none; d=google.com; s=arc-20160816; b=X0Eqjy4Z8sdA93SR+ljM4RExmoiXDJPGVKj6t4iA7bmW3jMeZr8JBzkXDjhm557WyX gj7btFuxCGP6RlhSbYHk4u4N/efKFSJPMFrBnkxSMpAhJOj0gXiBxWK51kr6bJZ3sf/3 abBuPfgb/0T60jX7WLFGrIyZzkWU8g9qAciSP5TpLhXtLcxG7/XCbTLJynA+ToivX0qF XgkQvc27Xf5R/WPAYN996NinYWdWvk9pReyMihT18yh6jNkNlYp7eF2cb12xn02zCKfH LEs42e4Jw0vaA7z9Xo+ChVjnTq6oD2Oq3ZlfmgIcv0+3Jc3AQBni3lIBRVLI5TdOmxoi t6Qw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=WRf0ZzbKmrV76L/bQewrCjiblC/Z4qrIut0Colc5sK4=; b=CfIyZvipa6H+t++Zh8NrQXzEuyVUpvZbInFp9qsM++XG4ZlLkJmleB3dXwWfMxc3k8 N+PqivMcN67fBtKCFp2apzB209etlaEye5QzimF91iOGXCeEbLIc0Vy7toLPXrd5X5+W n4JBvCbvgqaBDoO9V0R1BjDrH3iO6sLx7vQGPt9SqdaA0dSYVhcaUDBgC4Fgtg3Z2CdK D5aYMrtd8l3NklyFCrI4NjtAs/bcM1FT+Kpja2mr7pKKoYwST8hQTSWX4DSikwJRU9pa oL/1NJYXBt50jQEhyL0rX67xMkuBbm+1B2PU5CbTWxWGYtq+JH+cOlEiwLlLlLdu1Dhz bp6g== 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 u11si5522353pgp.314.2022.01.20.13.28.42; Thu, 20 Jan 2022 13:28:51 -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 S1347599AbiARSUY convert rfc822-to-8bit (ORCPT + 70 others); Tue, 18 Jan 2022 13:20:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347553AbiARSUU (ORCPT ); Tue, 18 Jan 2022 13:20:20 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF1FEC061574; Tue, 18 Jan 2022 10:20:18 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 3EA05FF807; Tue, 18 Jan 2022 18:20:15 +0000 (UTC) Date: Tue, 18 Jan 2022 19:20:13 +0100 From: Miquel Raynal To: Alexander Aring Cc: Stefan Schmidt , linux-wpan - ML , "open list:NETWORKING [GENERAL]" , "linux-wireless@vger.kernel.org Wireless" , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Michael Hennerich , Jakub Kicinski , Varka Bhadram , Xue Liu , Alan Ott , Thomas Petazzoni Subject: Re: [PATCH v3 07/41] net: ieee802154: mcr20a: Fix lifs/sifs periods Message-ID: <20220118192013.46c42f82@xps13> In-Reply-To: References: <20220117115440.60296-1-miquel.raynal@bootlin.com> <20220117115440.60296-8-miquel.raynal@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) 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 Hi Alexander, alex.aring@gmail.com wrote on Mon, 17 Jan 2022 17:52:10 -0500: > Hi, > > On Mon, 17 Jan 2022 at 06:54, Miquel Raynal wrote: > > > > These periods are expressed in time units (microseconds) while 40 and 12 > > are the number of symbol durations these periods will last. We need to > > multiply them both with phy->symbol_duration in order to get these > > values in microseconds. > > > > Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver") > > Signed-off-by: Miquel Raynal > > --- > > drivers/net/ieee802154/mcr20a.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c > > index f0eb2d3b1c4e..e2c249aef430 100644 > > --- a/drivers/net/ieee802154/mcr20a.c > > +++ b/drivers/net/ieee802154/mcr20a.c > > @@ -976,8 +976,8 @@ static void mcr20a_hw_setup(struct mcr20a_local *lp) > > dev_dbg(printdev(lp), "%s\n", __func__); > > > > phy->symbol_duration = 16; > > - phy->lifs_period = 40; > > - phy->sifs_period = 12; > > + phy->lifs_period = 40 * phy->symbol_duration; > > + phy->sifs_period = 12 * phy->symbol_duration; > > I thought we do that now in register_hw(). Why does this patch exist? The lifs and sifs period are wrong. Fixing this silently by generalizing the calculation is simply wrong. I feel we need to do this in order: 1- Fix the period because it is wrong. 2- Now that the period is set to a valid value and the core is able to do the same operation and set the variables to an identical content, we can drop these lines from the driver. #2 being a mechanical change, doing it without #1 means that something that appears harmless actually changes the behavior of the driver. We generally try to avoid that, no? Thanks, Miquèl