Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1346029pxy; Fri, 23 Apr 2021 06:11:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1CunvAZ0SSp4qwNDsT2rqbmaqd3DnITtPeMMUUnpL8hd1KLui6HaLlGp7hoTkNb6mTAr0 X-Received: by 2002:a17:90a:d488:: with SMTP id s8mr5803283pju.125.1619183466324; Fri, 23 Apr 2021 06:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619183466; cv=none; d=google.com; s=arc-20160816; b=EXRaPyogof0978rASvNdeQy6IJrO+CHeoToWvPERIjyg4R5ZbjLls2sLXkRbcSGMfq d/s22zvyPJ0R8Xu/E7Ws0TECiMHg4HSm/gXHBQRFNOa5fFSZW8+w4W5H+HFmb0yrkt7Z qAa9iuc03OtcOYo3yy7BcP0k5PyfToXMzcHS9XBdT71rJLwufph1QlZAYDvvxe3xbHsY InU8buS3by4Fp7OwvOQAtThwVo2+JD3URbSpKwSyQ7iifObwucaVH7Rc1FIuW6913jFW nV4F7zxYWwrbgAIzTCq9SURxZAk1o3kR/Jn9H+wLehuYtDNULH0s1BO6RqPEr8cA08OH eqxQ== 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; bh=6Z6bsNUb2Q4qDu+8Eii7/vdUs6KjYo7be9rFGsjJw1I=; b=OERlw7aWDAWzAuRhorrmcA0kiLp6ioN8BYxRuFpK6IqSwTtAPkfpzv89zEsaHeOj6v wfSxkk1c2ntRcMm2J5V45DpN0a5Y2K9yUBrtsMYYFwIa26tcVMh+tt8Ze1ETAo3B/K51 KM4ieH8EIEaYyM9t8vVZliA8q1dHOs+YBcf52nDPu0064y2cK2hpUaBiFpul0oTca8eO lUZ6ORk9c/rRQVvkS/bVOQ20RtQN2dyCWaB8emEMuEoE02MURGFqpa3oNmBkZtxfdQuE 5aSIeXBJqfNNvnXPpFK7e1hxQFWv9TK9RW8rDTrbsQ+DCsQxSP0vC1zGgnYmy3x1zr8k 4otQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si8069660pgb.45.2021.04.23.06.10.48; Fri, 23 Apr 2021 06:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242681AbhDWNIm (ORCPT + 99 others); Fri, 23 Apr 2021 09:08:42 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:37968 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242646AbhDWNId (ORCPT ); Fri, 23 Apr 2021 09:08:33 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lZvXD-000elp-OF; Fri, 23 Apr 2021 15:07:51 +0200 Date: Fri, 23 Apr 2021 15:07:51 +0200 From: Andrew Lunn To: "Radu Pirea (NXP OSS)" Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: nxp-c45-tja11xx: add interrupt support Message-ID: References: <20210423124329.993850-1-radu-nicolae.pirea@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210423124329.993850-1-radu-nicolae.pirea@oss.nxp.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static irqreturn_t nxp_c45_handle_interrupt(struct phy_device *phydev) > +{ > + irqreturn_t ret = IRQ_NONE; > + int irq; > + > + irq = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_PHY_IRQ_STATUS); > + if (irq & PHY_IRQ_LINK_EVENT) { > + phy_trigger_machine(phydev); > + phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_PHY_IRQ_ACK, > + PHY_IRQ_LINK_EVENT); The ordering here is interesting. Could phy_trigger_machine() cause a second interrupt? Which you then clear without acting upon before exiting the interrupt handler? I think you should ACK the interrupt before calling phy_trigger_machine(). Andrew