Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3512802pxf; Mon, 15 Mar 2021 11:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoS8dtCx2ocwx7K/v3qC78GY4254pNVIqMmIBBW1Sm6cuB+XeaEAW08jALf3y5zWTfTLYe X-Received: by 2002:a17:906:8147:: with SMTP id z7mr24168469ejw.436.1615831898060; Mon, 15 Mar 2021 11:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831898; cv=none; d=google.com; s=arc-20160816; b=zDKlqX/4jQyFtQWS0EQhpxVGYQM6wRzxRYGien7g2cSKlauMgBVtUqlkEOwnaIiKWL mLoyvYXpO7R6U314X3gRKlSK/JqJPtuhV9p5aMaMOvFy8a+BFsepAxQhidSZzPRYAR4m tppBAukY/DEHvdx2rcOtIBJHkxJE3rhLM3BLg8c6JVMcUpbEmNKmHNqY7yk4f/GCtz/K wosH2ItC0p7e47Hhe9F8NW/QCaY0894pxFOwpSVm7DZw8AemGyLUGyUu9TxYtKOevnoV LK4BXsE1z4SMKgFcawvjifTwBpGJSeSKpvYHWbiVjFKUUK8IKWzzqsllGcJUc8Bmui1L Hr6A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rsAqmLIukDHIIZSkO9O9D1Tt3R2ep3YTjWABjjd9pUQ=; b=uhQI1V7C0HHpB8IYaEYF1Is5eMzMjUwvaaHa8lMbhV4PmTkQSG10H0JnzwWQeJNOcq QjtOG8R8REvVwpSJk//oMz6A46vo6nhBqRBXSYy0Tk74I3LnsNGV6UhTW2iCaG4ylLmD 56F00mTzdLlyE58h9ky1DusIDBtV9iFfLKBOIUNiSL8EiAtP3HwLlzLm/r1TiwBtlxdM i6tbH6UTZsdH7fJWeEBMaaTZ/rqtS7/H3o4YNoz51gZuTKt8C91sPZM7LT9uOtjSeCGt odanLtDSAzrxb6ov+pl+rojsz6e3dfFZYMzcZwgBCwOluQQBikrNZobt2m9WQZbgyYKS a0mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BufZtyMu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si4087118edo.368.2021.03.15.11.11.10; Mon, 15 Mar 2021 11:11:38 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BufZtyMu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235871AbhCOOLd (ORCPT + 99 others); Mon, 15 Mar 2021 10:11:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:35904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232116AbhCON5t (ORCPT ); Mon, 15 Mar 2021 09:57:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A278C64F1A; Mon, 15 Mar 2021 13:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816667; bh=vFRmbBK0M2OQW8V+CUumkxqvezOiQ2jYY7POR7dYWI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BufZtyMunCfWmASNOkCFv8plXHMrrDdOyTKz9hUeD8ngcpDd7u1dnykk0F58pHwJY ZRN5zZewxj9kTS8Qt6FSiymCRIb8OG57ZamAllWU5OZpD9bOmGLeVwG66SkK3Wmoqj KPTu+RF8OoR+pDYuyWSZfYVsDD9fNnK+sgx9hlJE= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Oltean , "David S. Miller" Subject: [PATCH 5.11 052/306] net: enetc: remove bogus write to SIRXIDR from enetc_setup_rxbdr Date: Mon, 15 Mar 2021 14:51:55 +0100 Message-Id: <20210315135509.408889744@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Vladimir Oltean commit 96a5223b918c8b79270fc0fec235a7ebad459098 upstream. The Station Interface Receive Interrupt Detect Register (SIRXIDR) contains a 16-bit wide mask of 'interrupt detected' events for each ring associated with a port. Bit i is write-1-to-clean for RX ring i. I have no explanation whatsoever how this line of code came to be inserted in the blamed commit. I checked the downstream versions of that patch and none of them have it. The somewhat comical aspect of it is that we're writing a binary number to the SIRXIDR register, which is derived from enetc_bd_unused(rx_ring). Since the RX rings have 512 buffer descriptors, we end up writing 511 to this register, which is 0x1ff, so we are effectively clearing the 'interrupt detected' event for rings 0-8. This register is not what is used for interrupt handling though - it only provides a summary for the entire SI. The hardware provides one separate Interrupt Detect Register per RX ring, which auto-clears upon read. So there doesn't seem to be any adverse effect caused by this bogus write. There is, however, one reason why this should be handled as a bugfix: next_to_clean _should_ be committed to hardware, just not to that register, and this was obscuring the fact that it wasn't. This is fixed in the next patch, and removing the bogus line now allows the fix patch to be backported beyond that point. Fixes: fd5736bf9f23 ("enetc: Workaround for MDIO register access issue") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/enetc/enetc.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -1212,7 +1212,6 @@ static void enetc_setup_rxbdr(struct ene rx_ring->idr = hw->reg + ENETC_SIRXIDR; enetc_refill_rx_ring(rx_ring, enetc_bd_unused(rx_ring)); - enetc_wr(hw, ENETC_SIRXIDR, rx_ring->next_to_use); /* enable ring */ enetc_rxbdr_wr(hw, idx, ENETC_RBMR, rbmr);