Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp830415pxt; Fri, 6 Aug 2021 15:09:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwvO5EBdwj+s5fedVnGuXxQrMnlFxldyhXe+SG3kEbP53BWl+azrwRTw9n5IJHmo7U3C9n X-Received: by 2002:a17:906:9c84:: with SMTP id fj4mr11724686ejc.274.1628287755922; Fri, 06 Aug 2021 15:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628287755; cv=none; d=google.com; s=arc-20160816; b=DQcTilVPCqZ/UF3fpTcj0bJQJdAi3A4Ir3gtWY9u7gV05kt0n6rFKgEsteV37nm6mP AreyfMvyTB4LOzhBJ/nz83WP98vnKJzu++I1kiG7LkPoTOuS17hUTXJb2pK98hcMZuBK lHDxyOXvYOwkbSAVNrLGsGiIEJDyHw/+yEJdEIy/t5Adpt08RdvUo4HfxitAziejvPDj iQFy3eMutJqnBq8wTPNPB967q4QdcXHU3oEnNpTETUK5r5kHm0497+MIMMTyHC/J3rA6 dvLr5rDCJSXFIWzVt4p9lcBUXwoZn+jvw7b8DevWWLlGl2b25wMqU6UCB1wkoAJGtnZJ wsbQ== 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=uKn0kOsBNS3tO/VC52JXbb6Fwjtg4e6qZPVZealNh0Q=; b=UkEUn5rJ6Q4NnDBNv7TGDH+XiuH7EDtvH8bGGIIetUQIgXpq4eic0kXx3PZoltyl8W fVQvKamI6GfsrFncc5ZbUFs5PlKiYIi6tcnF3IPmQM9/vhja7SWjclaXQRs8zyz2E4b6 LYhmNbSFlhgMmZfOOSFIiBgs0h69qi/M5d3ip4uMtyYe90X2WbM1/cM8OEdly6maV2UR EFUu3o4olYKSZdzh2X1LaG5LEvPX4jf0JDvBMzFf6LYEGZrr4CnKd335j2rWrG+D4+Oq e2v189lVEs88OopqsWTXPEp2f5+amM89XacwKSQbGDK3SbXGDeYnFejUa5jCt2NBx0dd H4Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 e2si9146325eds.340.2021.08.06.15.08.53; Fri, 06 Aug 2021 15:09:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239089AbhHFO3o (ORCPT + 99 others); Fri, 6 Aug 2021 10:29:44 -0400 Received: from mslow1.mail.gandi.net ([217.70.178.240]:32991 "EHLO mslow1.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231979AbhHFO3n (ORCPT ); Fri, 6 Aug 2021 10:29:43 -0400 Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id C03ECC9857; Fri, 6 Aug 2021 14:23:05 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id AADA6FF80D; Fri, 6 Aug 2021 14:22:43 +0000 (UTC) Date: Fri, 6 Aug 2021 16:22:42 +0200 From: Thomas Petazzoni To: Maksim Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: marvell: fix MVNETA_TX_IN_PRGRS bit number Message-ID: <20210806162242.44a60c59@windsurf> In-Reply-To: <20210806140437.4016159-1-bigunclemax@gmail.com> References: <20210806140437.4016159-1-bigunclemax@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Fri, 6 Aug 2021 17:04:37 +0300 Maksim wrote: > According to Armada XP datasheet bit at 0 position is corresponding for > TxInProg indication. > > Signed-off-by: Maksim > --- > drivers/net/ethernet/marvell/mvneta.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c > index 76a7777c746da..de32e5b49053b 100644 > --- a/drivers/net/ethernet/marvell/mvneta.c > +++ b/drivers/net/ethernet/marvell/mvneta.c > @@ -105,7 +105,7 @@ > #define MVNETA_VLAN_PRIO_TO_RXQ 0x2440 > #define MVNETA_VLAN_PRIO_RXQ_MAP(prio, rxq) ((rxq) << ((prio) * 3)) > #define MVNETA_PORT_STATUS 0x2444 > -#define MVNETA_TX_IN_PRGRS BIT(1) > +#define MVNETA_TX_IN_PRGRS BIT(0) > #define MVNETA_TX_FIFO_EMPTY BIT(8) > #define MVNETA_RX_MIN_FRAME_SIZE 0x247c > /* Only exists on Armada XP and Armada 370 */ Indeed, I just checked the datasheet, and it's bit 0 in this register that indicates if transmit is in progress. The only function using this is mvneta_port_down(), which polls until MVNETA_TX_FIFO_EMPTY is set and MVNETA_TX_IN_PRGRS is cleared in this register. Bit 1 in this register is marked as reserved, read-only and read as zero, so I suppose that mvneta_port_down() was basically never waiting for MVNETA_TX_IN_PRGRS to clear. Have you seen some actual visible issue, or was this just found by code inspection ? Best regards, Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com