Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10627586pxu; Wed, 30 Dec 2020 07:25:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBVLD++VuquEF7eAQmcxm5s/96LlXosBPYsEfQlpW51Nc2h5WVBqkrZLkve8UQ/0IATHrI X-Received: by 2002:a17:906:7784:: with SMTP id s4mr50176946ejm.93.1609341915279; Wed, 30 Dec 2020 07:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609341915; cv=none; d=google.com; s=arc-20160816; b=q1Y7EmtjEj8hcTSj5ALIT5EbjniWgu0K7UErria0pdalOwK5y9GZGeuKHQEtoPen2q Qh+fbM2ElHbz4HLpfaMPQBGoF5ianJtCsTc5SR4aqZVIHjrD7qJUz7ihBOB96snBPV2m eXzmkembmO87/hmGaeaJ2tfh5HxpbZX1V0wdCawXmH6TxZyfns+dqB1mBT+iu5s+rt6R TbH6/yFhNi3zgv5SSJ5FXY+plUXkJVT6hw1ddDzz79OYqnm9AUSdOB9r/Qdh4iXKDcWg lGtphHR5IQZDcsLpKhq0oXvu4GcLcv9zHxrveeZhyO3e3XQN3GW4eZaIImute3Um9w// fmHg== 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=1p9aksXLLV+Hz1BUelVv5NqwvLxlFqrmTj6HoxD12k4=; b=HP/5mv9G5EmrG9HdDm4rjeDLZSzOlhEz/EOSAupOVa1qKS+Q0COfoZu/qO6o9y//cg zGCJrpIotOJt0wZ7X6BQLaRPYdXgok+qHeChFBd5bzRgcxjKOysgewlOHC0e0O5jE2zo /YHEeYViGjRRyuav6+lcKTCrMs4cpDeHKgcY5iGo4CZ4mGWFTZmvzMwxb4z1cueBA42d vyAgG0i2RoetbZptpItcI9Ced7OjYe/XVyZ//q7zkjrAdGaOCANpD+zRdUyTRyvLvJ2n rIzHprQkjw8fyzVwuVFsNDrR5EuNObVFlkRMzsIdeYlYVr92ZuYrsReOoqqv0mmC/HP5 YxMA== 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 o6si21902960ejj.354.2020.12.30.07.24.52; Wed, 30 Dec 2020 07:25:15 -0800 (PST) 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 S1726391AbgL3PYZ (ORCPT + 99 others); Wed, 30 Dec 2020 10:24:25 -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