Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1198402 > unrolled thread

Deadlock in grgpio_irq_unmap()

Started byAlexey Khoroshilov <khoroshilov@ispras.ru>
First post2015-08-02 18:20 +0200
Last post2015-08-02 18:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  Deadlock in grgpio_irq_unmap() Alexey Khoroshilov <khoroshilov@ispras.ru> - 2015-08-02 18:20 +0200

#1198402 — Deadlock in grgpio_irq_unmap()

FromAlexey Khoroshilov <khoroshilov@ispras.ru>
Date2015-08-02 18:20 +0200
SubjectDeadlock in grgpio_irq_unmap()
Message-ID<pT49s-Ha-7@gated-at.bofh.it>
Dear colleagus,

grgpio_irq_unmap() code looks quite suspicious regarding usage of
priv->bgc.lock spinlock.

It locks the spinlock in line 310:
        spin_lock_irqsave(&priv->bgc.lock, flags);
and then it can call grgpio_set_imask() in line 317:
        grgpio_set_imask(priv, i, 0);

But grgpio_set_imask() unconditionally locks the spinlock by itself.

static void grgpio_set_imask(struct grgpio_priv *priv, unsigned int offset,
			     int val)
{
	struct bgpio_chip *bgc = &priv->bgc;
	unsigned long mask = bgc->pin2mask(bgc, offset);
	unsigned long flags;

	spin_lock_irqsave(&bgc->lock, flags);

	if (val)
		priv->imask |= mask;
	else
		priv->imask &= ~mask;
	bgc->write_reg(priv->regs + GRGPIO_IMASK, priv->imask);

	spin_unlock_irqrestore(&bgc->lock, flags);
}

So, it looks like unavoidable deadlock here.

Found by Linux Driver Verification project (linuxtesting.org).

--
Alexey Khoroshilov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web