From nobody Mon Apr 20 01:10:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83A64C433EF for ; Thu, 23 Jun 2022 13:08:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231818AbiFWNIC (ORCPT ); Thu, 23 Jun 2022 09:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbiFWNIA (ORCPT ); Thu, 23 Jun 2022 09:08:00 -0400 Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B515590; Thu, 23 Jun 2022 06:07:58 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 10A9D9C020F; Thu, 23 Jun 2022 09:07:58 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id bxgaT8NIpJQw; Thu, 23 Jun 2022 09:07:57 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 8E7919C022D; Thu, 23 Jun 2022 09:07:57 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 8E7919C022D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1655989677; bh=2W+lIf6qQ2lUkL8+3ZiA5lGY3Srk9AN/ouUZgnymuxg=; h=From:To:Date:Message-Id:MIME-Version; b=x1LucgElIr9jwfGficzBl1Gqb5zZz1q007Ea/Wczm2duLOXU+gRuKLQ4oD6+HDmhE m28w5Pz/1+zmJCE+CJyuTKekcbwFp7j3zNnNpaiseMpfiyDaWknT22L8U4j7Et8H7b Gr+5JGQxeSmjJ6gq14lh6Xs48Cbe89mVTptdEqQv1gVU2X3zpuFSQ8gPX5+pRvlQTu TUV1eptvSezWAQ/LMkJPN7abiXUpb7lMQAosmCgw0/v8VcRabJhUakEhF+QjLWKJ7g pTiOkWGsRIRnT2SmtGZJRrrFEnwHcEYjM0OvZFxnt8b9i6BQx+5Jg8NqxlV2Sv3m85 36WzYU3wyeP0Q== X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8sQ4xztY2Yl7; Thu, 23 Jun 2022 09:07:57 -0400 (EDT) Received: from sfl-deribaucourt.rennes.sfl (lfbn-ren-1-676-174.w81-53.abo.wanadoo.fr [81.53.245.174]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 90CE59C020F; Thu, 23 Jun 2022 09:07:56 -0400 (EDT) From: Enguerrand de Ribaucourt To: andrew@lunn.ch Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, hkallweit1@gmail.com, Enguerrand de Ribaucourt Subject: [PATCH v2 1/2] net: dp83822: disable false carrier interrupt Date: Thu, 23 Jun 2022 15:06:52 +0200 Message-Id: <20220623130651.1805615-2-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220623130651.1805615-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20220623130651.1805615-1-enguerrand.de-ribaucourt@savoirfairelinux.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When unplugging an Ethernet cable, false carrier events were produced by the PHY at a very high rate. Once the false carrier counter full, an interrupt was triggered every few clock cycles until the cable was replugged. This resulted in approximately 10k/s interrupts. Since the false carrier counter (FCSCR) is never used, we can safely disable this interrupt. In addition to improving performance, this also solved MDIO read timeouts I was randomly encountering with an i.MX8 fec MAC because of the interrupt flood. The interrupt count and MDIO timeout fix were tested on a v5.4.110 kernel. Signed-off-by: Enguerrand de Ribaucourt Reviewed-by: Andrew Lunn --- drivers/net/phy/dp83822.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index e6ad3a494d32..95ef507053a6 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -230,7 +230,6 @@ static int dp83822_config_intr(struct phy_device *phyde= v) return misr_status; misr_status |=3D (DP83822_RX_ERR_HF_INT_EN | - DP83822_FALSE_CARRIER_HF_INT_EN | DP83822_LINK_STAT_INT_EN | DP83822_ENERGY_DET_INT_EN | DP83822_LINK_QUAL_INT_EN); -- 2.25.1 From nobody Mon Apr 20 01:10:52 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 654F6C433EF for ; Thu, 23 Jun 2022 13:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231879AbiFWNIN (ORCPT ); Thu, 23 Jun 2022 09:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiFWNIK (ORCPT ); Thu, 23 Jun 2022 09:08:10 -0400 Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA1F4A3D9; Thu, 23 Jun 2022 06:08:07 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id B547C9C022D; Thu, 23 Jun 2022 09:08:06 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id bjSWMopkvg3c; Thu, 23 Jun 2022 09:08:06 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 497559C024D; Thu, 23 Jun 2022 09:08:06 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.savoirfairelinux.com 497559C024D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=savoirfairelinux.com; s=DFC430D2-D198-11EC-948E-34200CB392D2; t=1655989686; bh=nhSEKtgsyRwyL8XAN2d+CQz9eyJV9mv1KvBp5hYE1q0=; h=From:To:Date:Message-Id:MIME-Version; b=VELUfRT0pslpWvNx6sLe+HJASaTbFJs4X8Mg0YMm9q6GeahHFxhFAUTDLrmUEnWFb L9PPOOnF1q818fAp0rQurErhrLXnJN2ncPvKNL7XqJKrksAEqd8tB8D7kvxjrbJ4n5 M3DSpZgZfLv50epPtWmEpcMUNxq/1tOUKpzqyTV44DeJ7H1t780SHsXCrYUC+9pB79 /vYcFdFTzktE4YH8OgLMFk2xgoj/spJclCp24k3KcCqznUGuK9O5Y+IK0aLkTUXB4H llRToJk4Fs/k8jzOsApednpAqhUs4yq6P8g4H19lYYRKhwYC4eUKgMa4PW6zK9zar7 o+pMlK8e0V/7g== X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id EaLrX2CHWYws; Thu, 23 Jun 2022 09:08:06 -0400 (EDT) Received: from sfl-deribaucourt.rennes.sfl (lfbn-ren-1-676-174.w81-53.abo.wanadoo.fr [81.53.245.174]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 4F9539C022D; Thu, 23 Jun 2022 09:08:05 -0400 (EDT) From: Enguerrand de Ribaucourt To: andrew@lunn.ch Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, hkallweit1@gmail.com, Enguerrand de Ribaucourt Subject: [PATCH v2 2/2] net: dp83822: disable rx error interrupt Date: Thu, 23 Jun 2022 15:06:54 +0200 Message-Id: <20220623130651.1805615-3-enguerrand.de-ribaucourt@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220623130651.1805615-1-enguerrand.de-ribaucourt@savoirfairelinux.com> References: <20220623130651.1805615-1-enguerrand.de-ribaucourt@savoirfairelinux.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Some RX errors, notably when disconnecting the cable, increase the RCSR register. Once half full (0x7fff), an interrupt flood is generated. I measured ~3k/s interrupts even after the RX errors transfer was stopped. Since we don't read and clear the RCSR register, we should disable this interrupt. Signed-off-by: Enguerrand de Ribaucourt Reviewed-by: Andrew Lunn --- drivers/net/phy/dp83822.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index 95ef507053a6..8549e0e356c9 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -229,8 +229,7 @@ static int dp83822_config_intr(struct phy_device *phyde= v) if (misr_status < 0) return misr_status; - misr_status |=3D (DP83822_RX_ERR_HF_INT_EN | - DP83822_LINK_STAT_INT_EN | + misr_status |=3D (DP83822_LINK_STAT_INT_EN | DP83822_ENERGY_DET_INT_EN | DP83822_LINK_QUAL_INT_EN); -- 2.25.1