From patchwork Wed Aug 25 13:58:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kurt Kanzenbach X-Patchwork-Id: 12457663 X-Patchwork-Delegate: kuba@kernel.org 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 C1D37C4320A for ; Wed, 25 Aug 2021 13:58:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A71706103E for ; Wed, 25 Aug 2021 13:58:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240182AbhHYN7d (ORCPT ); Wed, 25 Aug 2021 09:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbhHYN73 (ORCPT ); Wed, 25 Aug 2021 09:59:29 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5FB2C0613CF for ; Wed, 25 Aug 2021 06:58:43 -0700 (PDT) From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1629899921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PmAigCY/2C2mbmbfA09witnGDE+mfM3JgDAyON82MKY=; b=tQCmKA/86gH8Nfq6z4MpxN5D7CBlEopmIOQQd2Qtv0a5TByyRhjBVEZXlfPqXjkUMhakzt HL6g/T9whWoghZ2aCBUxu/lmczCDHTzH7mAppjOPO3xqCjdJslxpgB1ATHK1hMF/3eN4bQ asPmvZ5DfxLa+TeY9H5qPHnkZ69es003lxnGFhAJ0ggdYQsSlvSxRluAIO5JAGRXldsIEr yS7sTA6PcAMCdr0UqKsXD+jbc1K1l+tOM0bFaGXdkhA3iRf2NZsHwuIXCQgas2N+yKHrO9 8OTqgWU8fqsRIXGCK/9Z+QDIqFGBXYJ5N7OHjZq9kZQi7Qr0aRNzhsXxLu1mQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1629899921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PmAigCY/2C2mbmbfA09witnGDE+mfM3JgDAyON82MKY=; b=xnMv/q2KHTBsozwulRNXiF/u5MEzxC7SXlxsBuowy6RdzLFhBzIHMe9SHuoqCkajUrbgeq jxTnni0puKnkbeDw== To: "David S. Miller" , Jakub Kicinski Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, Sebastian Andrzej Siewior , Kurt Kanzenbach Subject: [PATCH net 1/2] net: dsa: hellcreek: Fix incorrect setting of GCL Date: Wed, 25 Aug 2021 15:58:12 +0200 Message-Id: <20210825135813.73436-2-kurt@linutronix.de> In-Reply-To: <20210825135813.73436-1-kurt@linutronix.de> References: <20210825135813.73436-1-kurt@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Currently the gate control list which is programmed into the hardware is incorrect resulting in wrong traffic schedules. The problem is the loop variables are incremented before they are referenced. Therefore, move the increment to the end of the loop. Fixes: 24dfc6eb39b2 ("net: dsa: hellcreek: Add TAPRIO offloading support") Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli --- drivers/net/dsa/hirschmann/hellcreek.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c index 5c54ae1be62c..b57aea92684b 100644 --- a/drivers/net/dsa/hirschmann/hellcreek.c +++ b/drivers/net/dsa/hirschmann/hellcreek.c @@ -1472,9 +1472,6 @@ static void hellcreek_setup_gcl(struct hellcreek *hellcreek, int port, u16 data; u8 gates; - cur++; - next++; - if (i == schedule->num_entries) gates = initial->gate_mask ^ cur->gate_mask; @@ -1503,6 +1500,9 @@ static void hellcreek_setup_gcl(struct hellcreek *hellcreek, int port, (initial->gate_mask << TR_GCLCMD_INIT_GATE_STATES_SHIFT); hellcreek_write(hellcreek, data, TR_GCLCMD); + + cur++; + next++; } }