Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4910750rwb; Tue, 20 Sep 2022 23:49:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6NvyhUoiUIDwbkK5Q5Gg3QZGnvSjof9DUWPdJs9WuiIAxWhLAOxF0dkdn/aZAcY7UiU5L5 X-Received: by 2002:a17:907:70a:b0:741:78ab:dce5 with SMTP id xb10-20020a170907070a00b0074178abdce5mr20124481ejb.527.1663742955425; Tue, 20 Sep 2022 23:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663742955; cv=none; d=google.com; s=arc-20160816; b=fO+29qXBvSVzhbnTVQ5Ft8TSNmSC4Id9rlbb7Ttcly4qWxQ8iNyoEsA0HaqDGrOD4j KHeBtaB9ebdiNRdNWYFxyVk3FZ2yf3wmIlV/A9m7rT/WYuGepguX2BdChcq0RNiUG/6M df0UPWkAYvjTdc2JsKl6KzSlCeiTbUn4Ncy4qCMcBDNjT4P5lXZmLoDsJvH0q1/TkcBg EsU6qdJqzrtuspyZa2HOeEJbvMoJ9FDsdnd3qOQxpPCl3D5UKBf5S/16XeV2H4iSqJ5e /ySXFWA8lxA2JRHNeHchPrngaUbfqfXk7tLtTORMvo2Wxh5Rma597aN0abTABBmjoV7y xp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EKfwLDYYMLZIx0YI5kk++rg/S3q8X3ldU95jN9tSZ2U=; b=zPOxv8uvqyZE9kubEanORgN5rgydeUNxD5gFrWkKR8y1p1VPmpA8pQaY/FlUxCi6C4 mgoivOrtPZsQbiSNTDMFCtk+HFpiiHBvFp9cTwKnaKE7V+cUZddzbYwi7DmOOCr364rv PkL3MEiD6rNeBEIV3V/hudbAMuVzpxUFOKEbjhsdivACAX5fA6AKiiXrtwQU2SnIUr7t k8eckGfnNq3lNSX/Q+P4RgRAqCmqHW7oXlaC0RNGnKrz+Co/P+gQNL35ZcsiyNDtri5B +TmXllxfuaaTZ7Y2pTEG9kWZPD4BvgbxD1/tuQpRvwogdUdVhG0E65dy2rEI2EAJtGbf pbwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Xl7E4hbM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c19-20020a05640227d300b00451d5c11293si1598853ede.496.2022.09.20.23.48.49; Tue, 20 Sep 2022 23:49:15 -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=@microchip.com header.s=mchp header.b=Xl7E4hbM; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229888AbiIUGf5 (ORCPT + 99 others); Wed, 21 Sep 2022 02:35:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbiIUGfz (ORCPT ); Wed, 21 Sep 2022 02:35:55 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0A3880526; Tue, 20 Sep 2022 23:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1663742155; x=1695278155; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Nkxt24wv5HxrgUvepgEnI0awH/CBrinsjOv6eoBXr4Y=; b=Xl7E4hbMLh6RWzUqKcKz5IWSUsV7MSgWAyIyDD8l07LoHoQbJDwgvEm1 MQCvOvN7Zl3L/7tBknVOzv55DkrDHv1qRM/vRKoA6KUfG0v+EjwJI+Rjx roxRyi1A0kDI2aywTbVaqnyGr1eYTymXm3YQSPNYdsqI5BIkT8/MckjQc p+EPSx2ydkVFSTHAK3/AQ/gPqEJP6urbS7Iwj0Cqle66ZNkcACDouph+f 7Dsz35eJIAvrYwuNfN38aRIWINbvqK8oJCr4cYsyTDeKClirK61oBfKt7 9Ng9KmcLpPc4prLUUXqxEQrivbanS4TAUyS2h9YMXwbMi5YowOYR256QH w==; X-IronPort-AV: E=Sophos;i="5.93,332,1654585200"; d="scan'208";a="181271568" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Sep 2022 23:35:54 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 20 Sep 2022 23:35:53 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 20 Sep 2022 23:35:53 -0700 Date: Wed, 21 Sep 2022 08:40:19 +0200 From: Horatiu Vultur To: Michael Walle CC: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Divya Koppera , , Subject: Re: [PATCH net] net: phy: micrel: fix shared interrupt on LAN8814 Message-ID: <20220921064019.at4pbog6d2gzjyjq@soft-dev3-1.localhost> References: <20220920141619.808117-1-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20220920141619.808117-1-michael@walle.cc> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,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 The 09/20/2022 16:16, Michael Walle wrote: > > 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: Horatiu Vultur > --- > 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 98e9bc101d96..21b6facf6e76 100644 > --- a/drivers/net/phy/micrel.c > +++ b/drivers/net/phy/micrel.c > @@ -2732,16 +2732,19 @@ static int lan8804_config_intr(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); > @@ -2750,12 +2753,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.30.2 > -- /Horatiu