From patchwork Fri Jan 22 15:03:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Kleine-Budde X-Patchwork-Id: 12039589 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 3B5D8C433E0 for ; Fri, 22 Jan 2021 15:06:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01C7023AC2 for ; Fri, 22 Jan 2021 15:06:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728659AbhAVPFu (ORCPT ); Fri, 22 Jan 2021 10:05:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728984AbhAVPEW (ORCPT ); Fri, 22 Jan 2021 10:04:22 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37CB0C061794 for ; Fri, 22 Jan 2021 07:03:40 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2xyM-0002T8-5z for netdev@vger.kernel.org; Fri, 22 Jan 2021 16:03:38 +0100 Received: from dspam.blackshift.org (localhost [127.0.0.1]) by bjornoya.blackshift.org (Postfix) with SMTP id 14FC05CAA40 for ; Fri, 22 Jan 2021 15:03:37 +0000 (UTC) Received: from hardanger.blackshift.org (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by bjornoya.blackshift.org (Postfix) with ESMTPS id 81DEF5CAA39; Fri, 22 Jan 2021 15:03:36 +0000 (UTC) Received: from blackshift.org (localhost [::1]) by hardanger.blackshift.org (OpenSMTPD) with ESMTP id ede34be9; Fri, 22 Jan 2021 15:03:36 +0000 (UTC) From: Marc Kleine-Budde To: netdev@vger.kernel.org Cc: Andrew Lunn , Heiner Kallweit , kernel@pengutronix.de, Marc Kleine-Budde , Dan Murphy Subject: [PATCH] net: dp83tc811: fix link detection and possbile IRQ storm Date: Fri, 22 Jan 2021 16:03:34 +0100 Message-Id: <20210122150334.2378703-1-mkl@pengutronix.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In our setup the dp83tc811 is configure to master mode. When there is no slave connected the dp83tc811 triggers an interrupt is triggerd, several bits in the status registers are set, and te INT_N pin goes low. One of interrupt bits is the NO_FRAME interrupt. Reading the status register acknowledges the interrupt, but as there is still no slave connected, the NO_FRAME interrupt stays set and the INT_N pin low. For level triggered IRQs this results in an interrupt storm, as long as the slave is not connected. For edge triggered interupts the link change event, when the slave comes online, is lost. To fix this problem the NO_FRAME interrupt is not enabled. At least in our testcase with edge triggered interrupts link change events are now properly detected. Cc: Dan Murphy Signed-off-by: Marc Kleine-Budde Reviewed-by: Andrew Lunn --- drivers/net/phy/dp83tc811.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/phy/dp83tc811.c b/drivers/net/phy/dp83tc811.c index b8d802cbf615..2801492bfaad 100644 --- a/drivers/net/phy/dp83tc811.c +++ b/drivers/net/phy/dp83tc811.c @@ -222,7 +222,6 @@ static int dp83811_config_intr(struct phy_device *phydev) return err; misr_status = (DP83811_LPS_INT_EN | - DP83811_NO_FRAME_INT_EN | DP83811_POR_DONE_INT_EN); err = phy_write(phydev, MII_DP83811_INT_STAT3, misr_status);