From: Landen Chao <landen.chao@mediatek.com>
To: DENG Qingfang <dqfext@gmail.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>, "Marc Zyngier" <maz@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Russell King" <linux@armlinux.org.uk>,
"Sean Wang" <Sean.Wang@mediatek.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Vivien Didelot" <vivien.didelot@gmail.com>,
"Vladimir Oltean" <olteanv@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
"Weijie Gao (高惟杰)" <Weijie.Gao@mediatek.com>,
"Chuanhong Guo" <gch981213@gmail.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"René van Dorst" <opensource@vdorst.com>
Subject: Re: Registering IRQ for MT7530 internal PHYs
Date: Mon, 18 Jan 2021 21:27:57 +0800 [thread overview]
Message-ID: <1610976477.24617.22.camel@mtksdccf07> (raw)
In-Reply-To: <CALW65ja33=+7TGQMYdr=Wztwy_simszSwO6saMvvSeqX3qWGxA@mail.gmail.com>
Hi Qingfang,
On Wed, 2021-01-06 at 16:54 +0800, DENG Qingfang wrote:
> Hi Andrew,
>
> On Wed, Dec 30, 2020 at 11:23 PM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > 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?
>
> MT7531's internal PHY has an interrupt status register, but I don't
> know if the same applies to MT7530.
Interrupt status/mask registers of MT7530 internal PHY is the same as
MT7531. The switch interrupt status register MT7530_SYS_INT_STS[14:8]
reflects internal PHY interrupt status. MT7530_SYS_INT_STS[6:0] we used
before does not related to internal PHY "interrupt".
However, base on MT753x hardware behavior, after read-clear interrupt
status of internal phy, we still need to write-clear
MT7530_SYS_INT_STS[14:8] to clear switch interrupt.
Landen
>
> >
> > 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
next prev parent reply other threads:[~2021-01-18 13:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 4:22 Registering IRQ for MT7530 internal PHYs DENG Qingfang
2020-12-30 7:39 ` Heiner Kallweit
2020-12-30 9:07 ` DENG Qingfang
2020-12-30 9:12 ` Heiner Kallweit
2020-12-30 16:15 ` Florian Fainelli
2020-12-30 16:53 ` Heiner Kallweit
2020-12-30 9:42 ` Marc Zyngier
2020-12-30 15:11 ` Andrew Lunn
2020-12-30 15:23 ` Andrew Lunn
2021-01-06 8:54 ` DENG Qingfang
2021-01-18 13:27 ` Landen Chao [this message]
2020-12-30 15:16 ` Andrew Lunn
2020-12-30 16:17 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1610976477.24617.22.camel@mtksdccf07 \
--to=landen.chao@mediatek.com \
--cc=Sean.Wang@mediatek.com \
--cc=Weijie.Gao@mediatek.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=gch981213@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=maz@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=opensource@vdorst.com \
--cc=p.zabel@pengutronix.de \
--cc=tglx@linutronix.de \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).