Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp50534pxu; Sat, 24 Oct 2020 15:30:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmJFEU65sw87S35ToNFjSr5XGETn1yqIA0n+IqsdAOQgUj3MY3VqbPhJUznCIIc5Zq3Fxf X-Received: by 2002:a17:906:3fc5:: with SMTP id k5mr1232657ejj.158.1603578607242; Sat, 24 Oct 2020 15:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603578607; cv=none; d=google.com; s=arc-20160816; b=Qnp15KOY2OqqS8x0UbSQ+JmdzsuKQj0V6wgxqYJrZNOUCRvzsT6Sz8y12ZHQykuUPK cw1rMhqw913z9rZadCUX1a6QTu90OQ+4H1TmGbNtwmUXXTF1wu9swyh8gHjsFOIUPKpP HHy4Pz8XfRdIPhT/f/TBwysCAfRpTTZQVlG8P6ytdT0hOVzpu3uQBi3ah4yON/auvFNs WTsqQk6WLVXTTXhJQ9YXlyfnfW9+bl/f2AiHi0duw9bEBpKei5KRGHyg+aAtF0AOpXCq vzGCOp/QjIPWQPjxxuUC6Vzde7mvIvqzQ63J+hok7hhRf4uR9JuB7ILKPF4kulEIX/E4 4Nnw== 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=rk3bdYu77TBpbk9mcb0A0QGbxrwyAbKGfEOA58OilOU=; b=P54ODGIOeUYV2gzQ0hGOs5lXfzYEOLkdOj7BQz2IwRKEzQn8XAcuYklhzJxYLlZh/1 iBECn5HdftgnNFOdBDO5SrMkiA2s4hkvod4OcZvQRZzeqIe9mo5uqqSC+AYYJrnlbNxX K7ShLtP7LYreb7O/3cZahRgxj1XnPIaHHKANFI0terIfFYJogN6ipAVA9/hb/UFZFM1c icFSqnpQWhvxOhspLBJiTqyP4Qx2ENfmVU69fKXSXs0nftzEs28hzvgwnQCLXnwkD3z7 gIhZXcgrNL6xBaANI4IJuV8Qol69h3jSTe43ujZrKx9yRbAdYBFmUwjn3143Jo+Ha3sf +jqA== 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 f11si3829523edt.426.2020.10.24.15.29.17; Sat, 24 Oct 2020 15:30:07 -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 S1764297AbgJXUII (ORCPT + 99 others); Sat, 24 Oct 2020 16:08:08 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:43084 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764089AbgJXUIH (ORCPT ); Sat, 24 Oct 2020 16:08:07 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kWPpO-003JlL-4r; Sat, 24 Oct 2020 22:07:50 +0200 Date: Sat, 24 Oct 2020 22:07:50 +0200 From: Andrew Lunn To: Russell King - ARM Linux admin Cc: Ioana Ciornei , Heiner Kallweit , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandru Ardelean , Andre Edich , Antoine Tenart , Baruch Siach , Christophe Leroy , Dan Murphy , Divya Koppera , Florian Fainelli , Hauke Mehrtens , Jerome Brunet , Kavya Sree Kotagiri , Linus Walleij , Marco Felsch , Marek Vasut , Martin Blumenstingl , Mathias Kresin , Maxim Kochetkov , Michael Walle , Neil Armstrong , Nisar Sayed , Oleksij Rempel , Philippe Schenker , Willy Liu , Yuiko Oshino Subject: Re: [RFC net-next 0/5] net: phy: add support for shared interrupts Message-ID: <20201024200750.GL745568@lunn.ch> References: <20201024121412.10070-1-ioana.ciornei@nxp.com> <20201024171705.GK745568@lunn.ch> <20201024180952.GG1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201024180952.GG1551@shell.armlinux.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 24, 2020 at 07:09:53PM +0100, Russell King - ARM Linux admin wrote: > On Sat, Oct 24, 2020 at 07:17:05PM +0200, Andrew Lunn wrote: > > > - Every PHY driver gains a .handle_interrupt() implementation that, for > > > the most part, would look like below: > > > > > > irq_status = phy_read(phydev, INTR_STATUS); > > > if (irq_status < 0) { > > > phy_error(phydev); > > > return IRQ_NONE; > > > } > > > > > > if (irq_status == 0) > > > return IRQ_NONE; > > > > > > phy_trigger_machine(phydev); > > > > > > return IRQ_HANDLED; > > > > Hi Ioana > > > > It looks like phy_trigger_machine(phydev) could be left in the core, > > phy_interrupt(). It just needs to look at the return code, IRQ_HANDLED > > means trigger the state machine. > > Is this appropriate for things such as the existing user of > handle_interrupt - vsc8584_handle_interrupt() ? Ah, yes, you are likely to get a lot more ptp interrupts than link up/down interrupts, and there is no point running the phy state machine after each ptp interrupt. So Ioana's structure is better. And now that phy_trigger_machine is exported, that driver can swap from phy_mac_interrupt() to phy_trigger_machine(). Andrew