Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp831258rwb; Mon, 26 Sep 2022 06:27:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5n++nOTGFNbMR1oT6uBFPDYqoVJEOmSwvyXPX2hZBGPEZ6EjaDyddNQ6f1YXGOy47RH09J X-Received: by 2002:a17:906:fd8b:b0:779:dcbe:3a9d with SMTP id xa11-20020a170906fd8b00b00779dcbe3a9dmr18765541ejb.235.1664198876296; Mon, 26 Sep 2022 06:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198876; cv=none; d=google.com; s=arc-20160816; b=FwqX0fV8sKPeuTL/Kjdc+k4m5OSyUPtPQ2cpFL++8E9cmuvuYxM5d8ZowxDH8ouimn Bth4gdCIlA2sdsTYAC4UiTPCK+72ar+F32fvAeNZPjsJ/wqN1qWWO5Vr5nXr+XyeZqPQ 5Vp75BZOrp3EqaMEsoZvRXD8kql6XH8bDngUVh2vOyQwcBMVg//CLyhXgRF4vwM6yNqI S/zcwzLTzFGbW9U8SX4J9xJjV3n24cbSxhozD5ZOHv0Ysluir45rjsCa3wZqhr4zvPOW 4kFHcDx6WNEDkBCJo0Ulp72Q09S6WVGhAFcz9MGse4ASLrquTRssEHFkRiZMxY7iFoTU fxEA== 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=fl707GDVE79xYRnddxh09THHvTK/UxdejCK5YFlmmho=; b=tOv0/NDZIgDEH7IOVo1kI17nYOC1JF0x5cTsIxTymXKetWXQwDNuJlSW4wKI1UEzIP XfLc9/o2VePEcWse6NpOz297x/AuWnyj7qcmGMtdNYpljhnOr7coyyvIX7FC6DLK8SG7 fXVS24TxXVy3d4Mo1agyZfSlVDyKZZyzZx1I4nOuHnzkTz1/LIFN/nW8YVp4I/kktyiV +88oS4EB27rE+JiY5BzXFskXz/048NT2mOR/d4UrFtZtW9XHjmpbZDRp+iHxyrORB66L uQ3y3MPOIjP/vvdVL48Axbzsmz+EgCfzHoYhRQ5u/44r/VYUjDh+Rd/5drWAhBZSKqOI 06lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rMI1eKMW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a1709064fc400b007721f88d3e0si19462968ejw.554.2022.09.26.06.27.28; Mon, 26 Sep 2022 06:27:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rMI1eKMW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S238881AbiIZL4r (ORCPT + 99 others); Mon, 26 Sep 2022 07:56:47 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 *phydev) static irqreturn_t lan8814_handle_interrupt(struct phy_device *phydev) { int irq_status, tsu_irq_status; + int ret = IRQ_NONE; irq_status = 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; } + if (irq_status & LAN8814_INT_LINK) { + phy_trigger_machine(phydev); + ret = IRQ_HANDLED; + } + while (1) { tsu_irq_status = 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 = IRQ_HANDLED; + } else { break; + } } - return IRQ_HANDLED; + + return ret; } static int lan8814_ack_interrupt(struct phy_device *phydev) -- 2.35.1