public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Arun.Ramadoss@microchip.com
Cc: olteanv@gmail.com, linux-kernel@vger.kernel.org,
	UNGLinuxDriver@microchip.com, vivien.didelot@gmail.com,
	linux@armlinux.org.uk, Tristram.Ha@microchip.com,
	f.fainelli@gmail.com, kuba@kernel.org, edumazet@google.com,
	pabeni@redhat.com, netdev@vger.kernel.org,
	Woojung.Huh@microchip.com, davem@davemloft.net
Subject: Re: [RFC Patch net-next v3 3/3] net: dsa: microchip: lan937x: add interrupt support for port phy link
Date: Thu, 1 Sep 2022 14:32:46 +0200	[thread overview]
Message-ID: <YxCmbrKFyjtWIHha@lunn.ch> (raw)
In-Reply-To: <bd7fcde507f47b22f9a4140bb26b91d9bb7e1662.camel@microchip.com>

> > > +static irqreturn_t lan937x_girq_thread_fn(int irq, void *dev_id)
> > > +{
> > > +     struct ksz_device *dev = dev_id;
> > > +     unsigned int nhandled = 0;
> > > +     unsigned int sub_irq;
> > > +     unsigned int n;
> > > +     u32 data;
> > > +     int ret;
> > > +
> > > +     ret = ksz_read32(dev, REG_SW_INT_STATUS__4, &data);
> > > +     if (ret)
> > > +             goto out;
> > > +
> > > +     if (data & POR_READY_INT) {
> > > +             ret = ksz_write32(dev, REG_SW_INT_STATUS__4,
> > > POR_READY_INT);
> > > +             if (ret)
> > > +                     goto out;
> > > +     }
> > 
> > What do these two read/writes do? It seems like you are discarding an
> > interrupt?
> 
> This interrupt in Power on reset interrupt. It is enabled by default in
> the chip. I am not performing any operation based on POR. So I just
> cleared the interrupt. Do I need to disable the POR interrupt in the
> setup function, since no operation is performed based on it?

It is pretty normal during interrupt controller creation to first
disable all interrupt sources, then clear the interrupt status
register if that can be done with a single operation, and then
register the interrupt controller with the IRQ core. That way, any
outstanding interrupts don't fire.

	    Andrew

      reply	other threads:[~2022-09-01 12:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30 10:53 [RFC Patch net-next v3 0/3] net: dsa: microchip: lan937x: enable interrupt for internal phy link detection Arun Ramadoss
2022-08-30 10:53 ` [RFC Patch net-next v3 1/3] net: dsa: microchip: use dev_ops->reset instead of exit in ksz_switch_register Arun Ramadoss
2022-08-30 12:44   ` Andrew Lunn
2022-08-30 10:53 ` [RFC Patch net-next v3 2/3] net: dsa: microchip: add reference to ksz_device inside the ksz_port Arun Ramadoss
2022-08-30 12:47   ` Andrew Lunn
2022-08-30 10:53 ` [RFC Patch net-next v3 3/3] net: dsa: microchip: lan937x: add interrupt support for port phy link Arun Ramadoss
2022-08-30 13:25   ` Andrew Lunn
2022-09-01  9:02     ` Arun.Ramadoss
2022-09-01 12:32       ` Andrew Lunn [this message]

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=YxCmbrKFyjtWIHha@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Arun.Ramadoss@microchip.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --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