lkml.org 
[lkml]   [2022]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC Patch net-next v3 3/3] net: dsa: microchip: lan937x: add interrupt support for port phy link
> > > +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

\
 
 \ /
  Last update: 2022-09-01 14:33    [W:0.035 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site