Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3514106pxf; Mon, 15 Mar 2021 11:13:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRgewxTQarxKaKFL6R8bOqPrM8PlNBLpQg+JSw0kxd/oPt9LNQ++QkrIwSD9usC+vY6DlS X-Received: by 2002:a17:906:4d18:: with SMTP id r24mr24629564eju.493.1615832012846; Mon, 15 Mar 2021 11:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832012; cv=none; d=google.com; s=arc-20160816; b=xlShleyGpby0SCkhICGKIutR7dzSXZC7EbrZv2shS5tnMliKiPZVeGqLXwp+Mj1UcQ iCQnjYiIglfwxbTodzvpS++Lf5RpQZu1Q+Hhd6OCSxvb/ziSN/Ua+25Sa4cpFDtkeV6b vngGEzPwjgHGuyewlOf84nM6Sf9tH/2b4I3jXywBY6HRRk8AK7t0e9kE0wBBDv5H+IVN BWllDiLbc0f6bMkZRkJhB7EidIjM7ILaoGcDBmGpYUgE6AXRc0lYaG/+6cFg6bvtNC/j SoFv1KRwoaK4+p5lpB67CvdQTpQaV0Q5jEkhI8t5AkLUtb5aRzTZZUbVR7pN352DDu7Y dTBQ== 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=SrvPiq3cDL4HTxYD14xpRZ/Isz/EcIzjS9WBJMNubKw=; b=fVNqERsgogRkywWt7MwMcQ3uCKT3YNtUibbVLAz7flm4rK8ZV8JrPpwnRUpKaI0BT+ fBKR9PQ1gG7x0OPGcdPFvoURHrXo6ZEf1syMZ9g27QN67Z8AR9mm2Nskr20I23Uuz7bn ATubvw9GFLyUbiga7s7qMhsBxaP7jrOoi9eoY3/wD5yUU2veQ47W9O/gOyt5jsnnv4B/ D7osE0rmahZp88Gh3ZPzoNFZ7CXH0fB/GE3TknzoOQm4I2eSQul3SVa8LAQACfYOTaO0 e8za3dOCPOfdmlMnY5PdyfyPrkroAbWgNXQwiUlJ+DqO3cHcaWTmYejbR24eH59Wk4NF Kg6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zRRxAhRt; 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 s18si12435800ejj.88.2021.03.15.11.13.10; Mon, 15 Mar 2021 11:13:32 -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=zRRxAhRt; 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 S235826AbhCOOLp (ORCPT + 99 others); Mon, 15 Mar 2021 10:11:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:35698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232085AbhCON5p (ORCPT ); Mon, 15 Mar 2021 09:57:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D08A464EED; Mon, 15 Mar 2021 13:57:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816664; bh=wXajcTNNbbgZvj7vVyXF5bBu54zG0aV+bKfA1wOFgDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zRRxAhRtKcdyybhKAPRKTgPjHvppiQIBpOcH7ECSiw9/A+TKydaZpKF0rUhv+pLxV HeNzAOUJv9vMpZ3+AW/Ke1jMs7CzC7Zm6mPpPwpl3q3xCXA/89kVGsaKLBN/ELqe+Q LqlgNL+HBGmQfOtlpLfUo5nDer9ccqIo7/wa3xSs= 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.10 042/290] net: enetc: remove bogus write to SIRXIDR from enetc_setup_rxbdr Date: Mon, 15 Mar 2021 14:52:15 +0100 Message-Id: <20210315135543.351716525@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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 @@ -1252,7 +1252,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);