Commit dcc274b7 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

kernel/wr_pstats: restore CR register in IRQ handler

parent 7481b2f7
...@@ -263,16 +263,22 @@ static irqreturn_t pstats_irq_handler(int irq, void *devid) ...@@ -263,16 +263,22 @@ static irqreturn_t pstats_irq_handler(int irq, void *devid)
{ {
struct cntrs_dev *device = (struct cntrs_dev *)devid; struct cntrs_dev *device = (struct cntrs_dev *)devid;
uint32_t irqs, i; uint32_t irqs, i;
uint32_t tmp_cr;
irqs = pstats_irq_status(); irqs = pstats_irq_status();
pstats_irq_disable(PSTATS_ALL_MSK); pstats_irq_disable(PSTATS_ALL_MSK);
pstats_irq_clear(irqs); pstats_irq_clear(irqs);
device->port_irqs[device->irqs_head] = irqs; device->port_irqs[device->irqs_head] = irqs;
/* in case IRQ handler happens in the middle of counters readout, save
* current value of CR register */
tmp_cr = pstats_readl(pstats_dev, CR);
/* dump all overflow information so that we don't lose any if /* dump all overflow information so that we don't lose any if
* tasklet is delayed */ * tasklet is delayed */
for (i = 0; i < pstats_nports; ++i) for (i = 0; i < pstats_nports; ++i)
device->overflows[device->irqs_head][i] = pstats_irq_cntrs(i); device->overflows[device->irqs_head][i] = pstats_irq_cntrs(i);
/* Restore CR register for whoever was reading before the IRQ */
pstats_writel(tmp_cr | PSTATS_CR_RD_EN, pstats_dev, CR);
device->irqs_head = (device->irqs_head + 1) % PSTATS_IRQBUFSZ; device->irqs_head = (device->irqs_head + 1) % PSTATS_IRQBUFSZ;
/* device->port_irqs[device->irqs_head++ % PSTATS_IRQBUFSZ] = irqs; */ /* device->port_irqs[device->irqs_head++ % PSTATS_IRQBUFSZ] = irqs; */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment