From nobody Wed Dec 17 04:09:37 2025 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 BB938C32771 for ; Mon, 26 Sep 2022 11:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238884AbiIZL4s (ORCPT ); Mon, 26 Sep 2022 07:56:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238981AbiIZLyN (ORCPT ); Mon, 26 Sep 2022 07:54:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E564DB00; Mon, 26 Sep 2022 03:50:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EC92B60B2F; Mon, 26 Sep 2022 10:48:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F11C5C433C1; Mon, 26 Sep 2022 10:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189338; bh=rSpcze+w5f8A6yGVWV9axhSYli8sV5dEXvHyPyy8LP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rMI1eKMW/+uz6oNgT84xg24fbpM9RFPw60WU1chWol4E9j6HlfejmJmtP9bAT8Wkn HyoA8okA15hS1iiSJ/RnfLSx9Izs7x97hNHxy5f5Ob6tXLDciN+l2Gau29aCW/T5Oj Whc/cFFM5CLp8xjsdf5RWHVz2fryEHjHxrCabges= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Andrew Lunn , Horatiu Vultur , Divya Koppera , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.19 153/207] net: phy: micrel: fix shared interrupt on LAN8814 Date: Mon, 26 Sep 2022 12:12:22 +0200 Message-Id: <20220926100813.496924103@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 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" From: Michael Walle [ Upstream commit 2002fbac743b6e2391b4ed50ad9eb626768dd78a ] Since commit ece19502834d ("net: phy: micrel: 1588 support for LAN8814 phy") the handler always returns IRQ_HANDLED, except in an error case. Before that commit, the interrupt status register was checked and if it was empty, IRQ_NONE was returned. Restore that behavior to play nice with the interrupt line being shared with others. Fixes: ece19502834d ("net: phy: micrel: 1588 support for LAN8814 phy") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Horatiu Vultur Reviewed-by: Divya Koppera Link: https://lore.kernel.org/r/20220920141619.808117-1-michael@walle.cc Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/micrel.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 34483a4bd688..e8e1101911b2 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -2662,16 +2662,19 @@ static int lan8804_config_init(struct phy_device *p= hydev) static irqreturn_t lan8814_handle_interrupt(struct phy_device *phydev) { int irq_status, tsu_irq_status; + int ret =3D IRQ_NONE; =20 irq_status =3D phy_read(phydev, LAN8814_INTS); - if (irq_status > 0 && (irq_status & LAN8814_INT_LINK)) - phy_trigger_machine(phydev); - if (irq_status < 0) { phy_error(phydev); return IRQ_NONE; } =20 + if (irq_status & LAN8814_INT_LINK) { + phy_trigger_machine(phydev); + ret =3D IRQ_HANDLED; + } + while (1) { tsu_irq_status =3D lanphy_read_page_reg(phydev, 4, LAN8814_INTR_STS_REG); @@ -2680,12 +2683,15 @@ static irqreturn_t lan8814_handle_interrupt(struct = phy_device *phydev) (tsu_irq_status & (LAN8814_INTR_STS_REG_1588_TSU0_ | LAN8814_INTR_STS_REG_1588_TSU1_ | LAN8814_INTR_STS_REG_1588_TSU2_ | - LAN8814_INTR_STS_REG_1588_TSU3_))) + LAN8814_INTR_STS_REG_1588_TSU3_))) { lan8814_handle_ptp_interrupt(phydev); - else + ret =3D IRQ_HANDLED; + } else { break; + } } - return IRQ_HANDLED; + + return ret; } =20 static int lan8814_ack_interrupt(struct phy_device *phydev) --=20 2.35.1