Received: by 10.213.65.68 with SMTP id h4csp2024211imn; Thu, 5 Apr 2018 07:45:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ZdtcvZmdJj8u4DsEneHFpHCXMp8IZDlbIyBPwq6tKxjsbq8gaLcNLk6x5CeLuWrsbGpbJ X-Received: by 10.99.121.131 with SMTP id u125mr15339000pgc.48.1522939545791; Thu, 05 Apr 2018 07:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522939545; cv=none; d=google.com; s=arc-20160816; b=Nxdyz8AKLRzrZ1kaA5iSl3k1KyX1745S1WtgRxKyYtzEPqWD7jy+rdw+Ne/uH96+DW rGFYXXp/hIRQ9udRGPnyuB9wOnLV96Pozeh8yie+8qGtq+T0PuxXGwulGmw8xepMxsqm IbpyMMxOZ9Nr2ixnlY4DCEWY6qg+ZNuFhrw16Ixo0F2D3S5zLAJIqPyj6EVZKtOcLLfi tBChkwGU6GpaLYEvzr//82o4r8ddoSZdgswRgbeHgHI6ecHcmHX0UESioE9MU424kIlw 57P5Iwi4NujBtpWmfWz6twwoCrsGPz/t8EBlKgWI1A3fI9ZLZ2nmKaOFQyJViUuvbP+a /uig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Wykq8q8emQR/yEvczKQ+iHzZ4DwpefUi/a9FnzJ4Ys0=; b=lnBQWju7nAsaavTVXzQlEm5egIj3Mom2LUoIaIgdy2WdWJG1a3oX344pfALQm4Gfbw vyizYdJonZM6Ll/nWYDXExV1R6u4seyRL5wdZdyGXLWUMWVFRCePog3ZP3aUuH84sIGo F/vURHMPtptO12Km2pgaBhYLgCQY5Zro2Jmjmbz+OKetpM2y/zO0Afr3LRROfDfeTiv2 4DijeIi1K7Gq+njbHMlOg33i1iQy3fF01y2u5w2mPnX0ImXelc8f+ba7trKqBDkiF9Vn vQlHyys4xOE8hhcVfji7Fj6fACSiL7v9btBR4dbM2oZcrVcusoho55DvZcabrLH40Itm ddTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=KAzlSAu1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si8899900plk.567.2018.04.05.07.45.31; Thu, 05 Apr 2018 07:45:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=KAzlSAu1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751638AbeDEOoJ (ORCPT + 99 others); Thu, 5 Apr 2018 10:44:09 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:51749 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbeDEOoG (ORCPT ); Thu, 5 Apr 2018 10:44:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=Wykq8q8emQR/yEvczKQ+iHzZ4DwpefUi/a9FnzJ4Ys0=; b=KAzlSAu1qoVkY0X5V++5ljZ0+ljg9L/bgYadCbp6QeUJciuobrnL6NB5DIBAh4po4OKLr7a8Aq58sStDhqVo6TQ7Muh52OzjZqjzfAAvJIX0Vd757Wes8EkSSX4uuv2cxDoOWrptjqpz8jUGnvt0OykJcWKjdxeCIwsySUqWvtM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1f467H-0004HA-66; Thu, 05 Apr 2018 16:43:55 +0200 Date: Thu, 5 Apr 2018 16:43:55 +0200 From: Andrew Lunn To: Bhadram Varka Cc: Esben Haabendal , Esben Haabendal , Rasmus Villemoes , Florian Fainelli , open list , "netdev@vger.kernel.org" Subject: Re: [PATCH] net: phy: marvell: Enable interrupt function on LED2 pin Message-ID: <20180405144355.GB32663@lunn.ch> References: <20180405133504.12257-1-esben.haabendal@gmail.com> <4d9e0665abf7408988fc4ce20c26a08f@bgmail102.nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4d9e0665abf7408988fc4ce20c26a08f@bgmail102.nvidia.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 0e0978d8a0eb..f03a510f1247 100644 > --- a/drivers/net/phy/marvell.c > +++ b/drivers/net/phy/marvell.c > @@ -457,6 +457,21 @@ static int marvell_of_reg_init(struct phy_device *phydev) } #endif /* CONFIG_OF_MDIO */ > > +static int m88e1318_config_intr(struct phy_device *phydev) { > + int err; > + > + err = marvell_config_intr(phydev); > + if (err) > + return err; > + > + /* Setup LED[2] as interrupt pin (active low) */ > + return phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, > + MII_88E1318S_PHY_LED_TCR_FORCE_INT, > + MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | > + MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW); > > Can we move this part of the code to m88e1121_config_init() ? > > Every time whether we disable or enable the interrupts this part of code will execute. Yes, doing this once would be better. But please allow the LED pin to be used as an LED when not using interrupts. phy_interrupt_is_valid() should be involved somehow. Andrew