From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E8A2C55178 for ; Sat, 24 Oct 2020 20:08:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E036D222BA for ; Sat, 24 Oct 2020 20:08:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764296AbgJXUII (ORCPT ); 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: netdev@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