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 DF1ADC433DB for ; Wed, 30 Dec 2020 15:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89BD5207A6 for ; Wed, 30 Dec 2020 15:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbgL3PY0 (ORCPT ); Wed, 30 Dec 2020 10:24:26 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:44596 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgL3PYZ (ORCPT ); Wed, 30 Dec 2020 10:24:25 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kudK6-00F2yp-6X; Wed, 30 Dec 2020 16:23:38 +0100 Date: Wed, 30 Dec 2020 16:23:38 +0100 From: Andrew Lunn To: Marc Zyngier Cc: DENG Qingfang , "David S. Miller" , Florian Fainelli , Heiner Kallweit , Jakub Kicinski , Landen Chao , Matthias Brugger , Philipp Zabel , Russell King , Sean Wang , Thomas Gleixner , Vivien Didelot , Vladimir Oltean , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Weijie Gao , Chuanhong Guo , Linus Walleij , =?iso-8859-1?Q?Ren=E9?= van Dorst Subject: Re: Registering IRQ for MT7530 internal PHYs Message-ID: References: <20201230042208.8997-1-dqfext@gmail.com> <441a77e8c30927ce5bc24708e1ceed79@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <441a77e8c30927ce5bc24708e1ceed79@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 30, 2020 at 09:42:09AM +0000, Marc Zyngier wrote: > > +static irqreturn_t > > +mt7530_irq(int irq, void *data) > > +{ > > + struct mt7530_priv *priv = data; > > + bool handled = false; > > + int phy; > > + u32 val; > > + > > + val = mt7530_read(priv, MT7530_SYS_INT_STS); > > + mt7530_write(priv, MT7530_SYS_INT_STS, val); > > If that is an ack operation, it should be dealt with as such in > an irqchip callback instead of being open-coded here. Hi Qingfang Does the PHY itself have interrupt control and status registers? My experience with the Marvell Switch and its embedded PHYs is that the PHYs are just the same as the discrete PHYs. There are bits to enable different interrupts, and there are status bits indicating what event caused the interrupt. Clearing the interrupt in the PHY clears the interrupt in the switch interrupt controller. So in the mv88e6xxx interrupt code, you see i do a read of the switch interrupt controller status register, but i don't write to it as you have done. Andrew